testing-guide
について
このスキルは、単体テスト、統合テスト、システムテスト、エンドツーエンドテストの各レベルにわたる体系的なテストのための、テストピラミッド基準とベストプラクティスを提供します。テスト作成時、カバレッジの議論時、または適切なテスト比率と命名規則を実施するためのテスト戦略定義時にご活用ください。構造化されたテストアプローチを実装する開発者向けに、簡易参照ガイドと実践的な基準を提供します。
クイックインストール
Claude Code
推奨/plugin add https://github.com/AsiaOstrich/universal-dev-skillsgit clone https://github.com/AsiaOstrich/universal-dev-skills.git ~/.claude/skills/testing-guideこのコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします
ドキュメント
Testing Guide
This skill provides testing pyramid standards and best practices for systematic testing.
Quick Reference
Testing Pyramid
┌─────────┐
│ E2E │ ← Fewer, slower (3%)
─┴─────────┴─
┌─────────────┐
│ ST │ ← System (7%)
─┴─────────────┴─
┌─────────────────┐
│ IT │ ← Integration (20%)
─┴─────────────────┴─
┌─────────────────────┐
│ UT │ ← Unit (70%)
└─────────────────────┘
Test Levels Overview
| Level | Scope | Speed | Dependencies |
|---|---|---|---|
| UT | Single function/class | < 100ms | Mocked |
| IT | Component interaction | 1-10s | Real DB (containerized) |
| ST | Full system | Minutes | Production-like |
| E2E | User journeys | 30s+ | Everything real |
Coverage Targets
| Metric | Minimum | Recommended |
|---|---|---|
| Line | 70% | 85% |
| Branch | 60% | 80% |
| Function | 80% | 90% |
Detailed Guidelines
For complete standards, see:
Naming Conventions
File Naming
[ClassName]Tests.cs # C#
[ClassName].test.ts # TypeScript
[class_name]_test.py # Python
[class_name]_test.go # Go
Method Naming
[MethodName]_[Scenario]_[ExpectedResult]()
should_[behavior]_when_[condition]()
test_[method]_[scenario]_[expected]()
Test Doubles
| Type | Purpose | When to Use |
|---|---|---|
| Stub | Returns predefined values | Fixed API responses |
| Mock | Verifies interactions | Check method called |
| Fake | Simplified implementation | In-memory database |
| Spy | Records calls, delegates | Partial mocking |
When to Use What
- UT: Use mocks/stubs for all external deps
- IT: Use fakes for DB, stubs for external APIs
- ST: Real components, fake only external services
- E2E: Real everything
AAA Pattern
test('method_scenario_expected', () => {
// Arrange - Setup test data
const input = createTestInput();
const sut = new SystemUnderTest();
// Act - Execute behavior
const result = sut.execute(input);
// Assert - Verify result
expect(result).toBe(expected);
});
FIRST Principles
- Fast - Tests run quickly
- Independent - Tests don't affect each other
- Repeatable - Same result every time
- Self-validating - Clear pass/fail
- Timely - Written with production code
Anti-Patterns to Avoid
- ❌ Test Interdependence (tests must run in order)
- ❌ Flaky Tests (sometimes pass, sometimes fail)
- ❌ Testing Implementation Details
- ❌ Over-Mocking
- ❌ Missing Assertions
- ❌ Magic Numbers/Strings
Configuration Detection
This skill supports project-specific configuration.
Detection Order
- Check
CONTRIBUTING.mdfor "Disabled Skills" section- If this skill is listed, it is disabled for this project
- Check
CONTRIBUTING.mdfor "Testing Standards" section - If not found, default to standard coverage targets
First-Time Setup
If no configuration found and context is unclear:
- Ask the user: "This project hasn't configured testing standards. Would you like to customize coverage targets?"
- After user selection, suggest documenting in
CONTRIBUTING.md:
## Testing Standards
### Coverage Targets
| Metric | Target |
|--------|--------|
| Line | 80% |
| Branch | 70% |
| Function | 85% |
Configuration Example
In project's CONTRIBUTING.md:
## Testing Standards
### Coverage Targets
| Metric | Target |
|--------|--------|
| Line | 80% |
| Branch | 70% |
| Function | 85% |
### Testing Framework
- Unit Tests: Jest
- Integration Tests: Supertest
- E2E Tests: Playwright
License: CC BY 4.0 | Source: universal-doc-standards
GitHub リポジトリ
関連スキル
content-collections
メタThis skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.
creating-opencode-plugins
メタThis skill provides the structure and API specifications for creating OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It offers implementation patterns for JavaScript/TypeScript modules that intercept and extend the AI assistant's lifecycle. Use it when you need to build event-driven plugins for monitoring, custom handling, or extending OpenCode's capabilities.
evaluating-llms-harness
テストThis Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.
polymarket
メタThis skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.
