[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EKX4BXZJMBJB5XQZY0Q85D":3,"skill-same:01M6EKX4BXZJMBJB5XQZY0Q85D":95},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":6,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M6EKX4BXZJMBJB5XQZY0Q85D","testing-strategy-builder",null,"Use this skill when creating comprehensive testing strategies for applications. Provides test planning templates, coverage targets, test case structures, and guidance for unit, integration, E2E, and performance testing. Ensures robust quality assurance across the development lifecycle.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fariegoldkin\u002Ftesting-strategy-builder\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"testing strategy builder","strategy builder","strategy","testing strategy","builder","testing","hub","targets","unit","case","strategies","development lifecycle","guidance","use","coverage","quality","lifecycle","applications","templates","integration","2026-11-10 10:12:30",false,"---\nname: testing-strategy-builder\ndescription: Use this skill when creating comprehensive testing strategies for applications. Provides test planning templates, coverage targets, test case structures, and guidance for unit, integration, E2E, and performance testing. Ensures robust quality assurance across the development lifecycle.\nversion: 1.0.0\nauthor: AI Agent Hub\ntags: [testing, quality-assurance, test-strategy, automation, coverage]\n---\n\n# Testing Strategy Builder\n\n## Overview\n\nThis skill provides comprehensive guidance for building effective testing strategies that ensure software quality, reliability, and maintainability. Whether starting from scratch or improving existing test coverage, this framework helps teams design robust testing approaches.\n\n**When to use this skill:**\n- Planning testing strategy for new projects or features\n- Improving test coverage in existing codebases\n- Establishing quality gates and coverage targets\n- Designing test automation architecture\n- Creating test plans and test cases\n- Choosing appropriate testing tools and frameworks\n- Implementing continuous testing in CI\u002FCD pipelines\n\n**Bundled Resources:**\n- `references\u002Fcode-examples.md` - Detailed testing code examples\n- `templates\u002Ftest-plan-template.md` - Comprehensive test plan template\n- `templates\u002Ftest-case-template.md` - Test case documentation template\n- `checklists\u002Ftest-coverage-checklist.md` - Coverage verification checklist\n\n## Required Tools\n\nThis skill references the following testing tools. Not all are required - the skill will recommend appropriate tools based on your project.\n\n### JavaScript\u002FTypeScript Testing\n- **Jest:** Most popular testing framework\n  - **Install:** `npm install --save-dev jest @types\u002Fjest`\n  - **Config:** `npx jest --init`\n\n- **Vitest:** Vite-native testing framework\n  - **Install:** `npm install --save-dev vitest`\n  - **Config:** Add to vite.config.ts\n\n- **Playwright:** End-to-end testing\n  - **Install:** `npm install --save-dev @playwright\u002Ftest`\n  - **Setup:** `npx playwright install`\n\n- **k6:** Performance testing\n  - **Install (macOS):** `brew install k6`\n  - **Install (Linux):** Download from k6.io\n  - **Command:** `k6 run script.js`\n\n### Python Testing\n- **pytest:** Standard Python testing framework\n  - **Install:** `pip install pytest`\n  - **Command:** `pytest`\n\n- **pytest-cov:** Coverage reporting\n  - **Install:** `pip install pytest-cov`\n  - **Command:** `pytest --cov=.`\n\n- **Locust:** Performance testing\n  - **Install:** `pip install locust`\n  - **Command:** `locust -f locustfile.py`\n\n### Coverage Tools\n- **c8:** JavaScript\u002FTypeScript coverage\n  - **Install:** `npm install --save-dev c8`\n  - **Command:** `c8 npm test`\n\n- **Istanbul\u002Fnyc:** Alternative JS coverage\n  - **Install:** `npm install --save-dev nyc`\n  - **Command:** `nyc npm test`\n\n### Installation Verification\n```bash\n# JavaScript\u002FTypeScript\njest --version\nvitest --version\nplaywright --version\nk6 version\n\n# Python\npytest --version\nlocust --version\n\n# Coverage\nc8 --version\nnyc --version\n```\n\n**Note:** The skill will guide you to select tools based on your project framework (React, Vue, FastAPI, Django, etc.) and testing needs.\n\n## Testing Philosophy\n\n### The Testing Trophy ?\n\nModern testing follows the \"Testing Trophy\" model (evolved from the testing pyramid):\n\n```\n         ?\n       \u002F    \\\n      \u002F  E2E  \\         ← Few (critical user journeys)\n     \u002F----------\\\n    \u002F Integration\\      ← Many (component interactions)\n   \u002F--------------\\\n  \u002F     Unit       \\    ← Most (business logic)\n \u002F------------------\\\n\u002F  Static Analysis   \\  ← Foundation (linting, type checking)\n```\n\n**Principles:**\n1. **Static Analysis**: Catch syntax errors, type issues, and common bugs before runtime\n2. **Unit Tests**: Test individual functions and components in isolation\n3. **Integration Tests**: Test how components work together\n4. **E2E Tests**: Validate critical user workflows end-to-end\n\n**Balance:** 70% integration, 20% unit, 10% E2E (adjust based on context)\n\n---\n\n## Testing Strategy Framework\n\n### 1. Coverage Targets\n\n**Recommended Targets:**\n- **Overall Code Coverage**: 80% minimum\n- **Critical Paths**: 95-100% (payment, auth, data mutations)\n- **New Features**: 100% coverage requirement\n- **Business Logic**: 90%+ coverage\n- **UI Components**: 70%+ coverage\n\n**Coverage Types:**\n- **Line Coverage**: Percentage of code lines executed\n- **Branch Coverage**: Percentage of decision branches taken\n- **Function Coverage**: Percentage of functions called\n- **Statement Coverage**: Percentage of statements executed\n\n**Important:** Coverage is a metric, not a goal. 100% coverage ≠ bug-free code.\n\n### 2. Test Classification\n\n#### Static Analysis\n**Purpose**: Catch errors before runtime\n**Tools**: ESLint, Prettier, TypeScript, Pylint, mypy, Ruff\n**When to run:** Pre-commit hooks, CI pipeline\n\n#### Unit Tests\n**Purpose**: Test isolated business logic\n**Tools**: Jest, Vitest, pytest, JUnit\n**Characteristics:**\n- Fast execution (\u003C 100ms per test)\n- No external dependencies (database, API, filesystem)\n- Deterministic (same input = same output)\n- Test single responsibility\n\n**Coverage Target:** 90%+ for business logic\n\nSee `references\u002Fcode-examples.md` for detailed unit test examples.\n\n#### Integration Tests\n**Purpose**: Test component interactions\n**Tools:** Testing Library, Supertest, pytest with fixtures\n**Characteristics:**\n- Test multiple units working together\n- May use test databases or mocked external services\n- Moderate execution time (\u003C 1s per test)\n- Focus on interfaces and contracts\n\n**Coverage Target:** 70%+ for API endpoints and component interactions\n\nSee `references\u002Fcode-examples.md` for API integration test examples.\n\n#### End-to-End (E2E) Tests\n**Purpose**: Validate critical user journeys\n**Tools:** Playwright, Cypress, Selenium\n**Characteristics:**\n- Test entire application flow (frontend + backend + database)\n- Slow execution (5-30s per test)\n- Run against production-like environment\n- Focus on business-critical paths\n\n**Coverage Target:** 5-10 critical user journeys\n\nSee `references\u002Fcode-examples.md` for complete E2E test examples.\n\n#### Performance Tests\n**Purpose**: Validate system performance under load\n**Tools:** k6, Artillery, JMeter, Locust\n**Types:**\n- **Load Testing**: System behavior under expected load\n- **Stress Testing**: Breaking point identification\n- **Spike Testing**: Sudden traffic surge handling\n- **Soak Testing**: Sustained load over time (memory leaks)\n\n**Coverage Target:** Test all performance-critical endpoints\n\nSee `references\u002Fcode-examples.md` for k6 load test examples.\n\n---\n\n## Test Planning\n\n### 1. Risk-Based Testing\n\nPrioritize testing based on risk assessment:\n\n**High Risk (100% coverage required):**\n- Payment processing\n- Authentication and authorization\n- Data mutations (create, update, delete)\n- Security-critical operations\n- Compliance-related features\n\n**Medium Risk (80% coverage):**\n- Business logic\n- Data transformations\n- API integrations\n- Email\u002Fnotification systems\n\n**Low Risk (50% coverage):**\n- UI styling\n- Static content\n- Read-only operations\n- Non-critical features\n\n### 2. Test Case Design\n\n**Given-When-Then Pattern:**\n```\nGiven [initial context]\nWhen [action occurs]\nThen [expected outcome]\n```\n\nThis pattern keeps tests clear and focused. See `references\u002Fcode-examples.md` for implementation examples.\n\n### 3. Test Data Management\n\n**Strategies:**\n- **Fixtures**: Pre-defined test data in JSON\u002FYAML files\n- **Factories**: Generate test data programmatically\n- **Seeders**: Populate test database with known data\n- **Faker Libraries**: Generate realistic random data\n\nSee `references\u002Fcode-examples.md` for test factory and fixture examples.\n\n---\n\n## Testing Patterns and Best Practices\n\n### 1. AAA Pattern (Arrange-Act-Assert)\n\nStructure tests in three clear phases:\n- **Arrange**: Set up test data and context\n- **Act**: Perform the action being tested\n- **Assert**: Verify expected outcomes\n\nSee `references\u002Fcode-examples.md` for detailed AAA pattern examples.\n\n### 2. Test Isolation\n\n**Each test should be independent:**\n- Use fresh test database for each test\n- Clean up resources after each test\n- Tests don't depend on execution order\n\nSee `references\u002Fcode-examples.md` for test isolation patterns.\n\n### 3. Mocking vs Real Dependencies\n\n**When to Mock:**\n- External APIs (payment gateways, third-party services)\n- Slow operations (file I\u002FO, network calls)\n- Non-deterministic behavior (current time, random values)\n- Hard-to-test scenarios (error conditions, edge cases)\n\n**When to Use Real Dependencies:**\n- Fast, deterministic operations\n- Critical business logic\n- Database operations (use test database)\n- Internal service interactions\n\nSee `references\u002Fcode-examples.md` for mocking examples.\n\n### 4. Snapshot Testing\n\n**Use for:** UI components, API responses, generated code\n\n**Warning:** Snapshots can become brittle. Use for stable components, not rapidly changing UI.\n\n### 5. Parameterized Tests\n\nTest multiple scenarios with same logic using data tables.\n\nSee `references\u002Fcode-examples.md` for parameterized test patterns.\n\n---\n\n## Continuous Testing\n\n### 1. CI\u002FCD Integration\n\n**Pipeline Stages:**\n```yaml\n# Example: GitHub Actions\nname: Test Pipeline\n\non: [push, pull_request]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v3\n      - name: Install dependencies\n        run: npm ci\n      - name: Lint\n        run: npm run lint\n      - name: Type check\n        run: npm run typecheck\n      - name: Unit & Integration Tests\n        run: npm test -- --coverage\n      - name: Upload coverage\n        uses: codecov\u002Fcodecov-action@v3\n      - name: E2E Tests\n        run: npm run test:e2e\n      - name: Performance Tests (on main branch)\n        if: github.ref == 'refs\u002Fheads\u002Fmain'\n        run: npm run test:performance\n```\n\n### 2. Quality Gates\n\n**Block merges\u002Fdeployments if:**\n- Code coverage drops below threshold (e.g., 80%)\n- Any tests fail\n- Linting errors exist\n- Performance regression detected (> 10% slower)\n- Security vulnerabilities found\n\n### 3. Test Execution Strategy\n\n**On Every Commit:**\n- Static analysis (lint, type check)\n- Unit tests\n- Fast integration tests (\u003C 5 min total)\n\n**On Pull Request:**\n- All tests (unit + integration + E2E)\n- Coverage report\n- Performance benchmarks\n\n**On Deploy to Staging:**\n- Full E2E suite\n- Load testing\n- Security scans\n\n**On Deploy to Production:**\n- Smoke tests (critical paths only)\n- Health checks\n- Canary deployments with monitoring\n\n---\n\n## Testing Tools Recommendations\n\n### JavaScript\u002FTypeScript\n\n| Category | Tool | Use Case |\n|----------|------|----------|\n| **Unit\u002FIntegration** | Vitest | Fast, Vite-native, modern |\n| **Unit\u002FIntegration** | Jest | Mature, extensive ecosystem |\n| **E2E** | Playwright | Cross-browser, reliable, fast |\n| **E2E** | Cypress | Developer-friendly, visual debugging |\n| **Component Testing** | Testing Library | User-centric, framework-agnostic |\n| **API Testing** | Supertest | HTTP assertions, Express integration |\n| **Performance** | k6 | Load testing, scriptable |\n\n### Python\n\n| Category | Tool | Use Case |\n|----------|------|----------|\n| **Unit\u002FIntegration** | pytest | Powerful, extensible, fixtures |\n| **API Testing** | httpx + pytest | Async support, modern |\n| **E2E** | Playwright (Python) | Browser automation |\n| **Performance** | Locust | Load testing, Python-based |\n| **Mocking** | unittest.mock | Standard library, reliable |\n\n---\n\n## Common Testing Anti-Patterns\n\n❌ **Testing Implementation Details**\n```typescript\n\u002F\u002F Bad: Testing internal state\nexpect(component.state.isLoading).toBe(false);\n\n\u002F\u002F Good: Testing user-visible behavior\nexpect(screen.queryByText('Loading...')).not.toBeInTheDocument();\n```\n\n❌ **Tests Too Coupled to Code**\n```typescript\n\u002F\u002F Bad: Test breaks when implementation changes\nexpect(userService.save).toHaveBeenCalledTimes(1);\n\n\u002F\u002F Good: Test behavior, not implementation\nconst user = await db.users.findOne({ email: 'test@example.com' });\nexpect(user).toBeTruthy();\n```\n\n❌ **Flaky Tests**\n```typescript\n\u002F\u002F Bad: Non-deterministic timeout\nawait waitFor(() => {\n  expect(screen.getByText('Success')).toBeInTheDocument();\n}, { timeout: 1000 }); \u002F\u002F Might fail on slow CI\n\n\u002F\u002F Good: Use explicit waits with longer timeout\nawait screen.findByText('Success', {}, { timeout: 5000 });\n```\n\n❌ **Giant Test Cases**\n```typescript\n\u002F\u002F Bad: One test does too much\ntest('user workflow', async () => {\n  \u002F\u002F 100 lines testing signup, login, profile update, logout...\n});\n\n\u002F\u002F Good: Focused tests\ntest('user can sign up', async () => { \u002F* ... *\u002F });\ntest('user can login', async () => { \u002F* ... *\u002F });\ntest('user can update profile', async () => { \u002F* ... *\u002F });\n```\n\n---\n\n## Integration with Agents\n\n### Code Quality Reviewer\n- Reviews test coverage reports\n- Suggests missing test cases\n- Validates test quality and structure\n- Ensures tests follow patterns from this skill\n\n### Backend System Architect\n- Uses test strategy templates when designing services\n- Ensures APIs are testable (dependency injection, clear interfaces)\n- Plans integration test architecture\n\n### Frontend UI Developer\n- Applies component testing patterns\n- Uses Testing Library best practices\n- Implements E2E tests for user flows\n\n### AI\u002FML Engineer\n- Adapts testing patterns for ML models (data validation, model performance tests)\n- Uses performance testing for inference endpoints\n\n---\n\n## Quick Start Checklist\n\nWhen starting a new project or feature:\n\n- [ ] Define coverage targets (overall, critical paths, new code)\n- [ ] Choose testing framework (Jest\u002FVitest, Playwright, etc.)\n- [ ] Set up test infrastructure (test database, fixtures, factories)\n- [ ] Create test plan (see `templates\u002Ftest-plan-template.md`)\n- [ ] Implement static analysis (ESLint, TypeScript)\n- [ ] Write unit tests for business logic (80%+ coverage)\n- [ ] Write integration tests for API endpoints (70%+ coverage)\n- [ ] Write E2E tests for critical user journeys (5-10 flows)\n- [ ] Configure CI\u002FCD pipeline with quality gates\n- [ ] Set up coverage reporting (Codecov, Coveralls)\n- [ ] Document testing conventions in project README\n\n**For detailed code examples**: See `references\u002Fcode-examples.md`\n\n---\n\n**Skill Version**: 1.0.0\n**Last Updated**: 2025-10-31\n**Maintained by**: AI Agent Hub Team\n","# Testing Strategy Builder\n\n## Overview\n\nThis skill provides comprehensive guidance for building effective testing strategies that ensure software quality, reliability, and maintainability. Whether starting from scratch or improving existing test coverage, this framework helps teams design robust testing approaches.\n\n**When to use this skill:**\n- Planning testing strategy for new projects or features\n- Improving test coverage in existing codebases\n- Establishing quality gates and coverage targets\n- Designing test automation architecture\n- Creating test plans and test cases\n- Choosing appropriate testing tools and frameworks\n- Implementing continuous testing in CI\u002FCD pipelines\n\n**Bundled Resources:**\n- `references\u002Fcode-examples.md` - Detailed testing code examples\n- `templates\u002Ftest-plan-template.md` - Comprehensive test plan template\n- `templates\u002Ftest-case-template.md` - Test case documentation template\n- `checklists\u002Ftest-coverage-checklist.md` - Coverage verification checklist\n\n## Required Tools\n\nThis skill references the following testing tools. Not all are required - the skill will recommend appropriate tools based on your project.\n\n### JavaScript\u002FTypeScript Testing\n- **Jest:** Most popular testing framework\n  - **Install:** `npm install --save-dev jest @types\u002Fjest`\n  - **Config:** `npx jest --init`\n\n- **Vitest:** Vite-native testing framework\n  - **Install:** `npm install --save-dev vitest`\n  - **Config:** Add to vite.config.ts\n\n- **Playwright:** End-to-end testing\n  - **Install:** `npm install --save-dev @playwright\u002Ftest`\n  - **Setup:** `npx playwright install`\n\n- **k6:** Performance testing\n  - **Install (macOS):** `brew install k6`\n  - **Install (Linux):** Download from k6.io\n  - **Command:** `k6 run script.js`\n\n### Python Testing\n- **pytest:** Standard Python testing framework\n  - **Install:** `pip install pytest`\n  - **Command:** `pytest`\n\n- **pytest-cov:** Coverage reporting\n  - **Install:** `pip install pytest-cov`\n  - **Command:** `pytest --cov=.`\n\n- **Locust:** Performance testing\n  - **Install:** `pip install locust`\n  - **Command:** `locust -f locustfile.py`\n\n### Coverage Tools\n- **c8:** JavaScript\u002FTypeScript coverage\n  - **Install:** `npm install --save-dev c8`\n  - **Command:** `c8 npm test`\n\n- **Istanbul\u002Fnyc:** Alternative JS coverage\n  - **Install:** `npm install --save-dev nyc`\n  - **Command:** `nyc npm test`\n\n### Installation Verification\n```bash\n# JavaScript\u002FTypeScript\njest --version\nvitest --version\nplaywright --version\nk6 version\n\n# Python\npytest --version\nlocust --version\n\n# Coverage\nc8 --version\nnyc --version\n```\n\n**Note:** The skill will guide you to select tools based on your project framework (React, Vue, FastAPI, Django, etc.) and testing needs.\n\n## Testing Philosophy\n\n### The Testing Trophy ?\n\nModern testing follows the \"Testing Trophy\" model (evolved from the testing pyramid):\n\n```\n         ?\n       \u002F    \\\n      \u002F  E2E  \\         ← Few (critical user journeys)\n     \u002F----------\\\n    \u002F Integration\\      ← Many (component interactions)\n   \u002F--------------\\\n  \u002F     Unit       \\    ← Most (business logic)\n \u002F------------------\\\n\u002F  Static Analysis   \\  ← Foundation (linting, type checking)\n```\n\n**Principles:**\n1. **Static Analysis**: Catch syntax errors, type issues, and common bugs before runtime\n2. **Unit Tests**: Test individual functions and components in isolation\n3. **Integration Tests**: Test how components work together\n4. **E2E Tests**: Validate critical user workflows end-to-end\n\n**Balance:** 70% integration, 20% unit, 10% E2E (adjust based on context)\n\n---\n\n## Testing Strategy Framework\n\n### 1. Coverage Targets\n\n**Recommended Targets:**\n- **Overall Code Coverage**: 80% minimum\n- **Critical Paths**: 95-100% (payment, auth, data mutations)\n- **New Features**: 100% coverage requirement\n- **Business Logic**: 90%+ coverage\n- **UI Components**: 70%+ coverage\n\n**Coverage Types:**\n- **Line Coverage**: Percentage of code lines executed\n- **Branch Coverage**: Percentage of decision branches taken\n- **Function Coverage**: Percentage of functions called\n- **Statement Coverage**: Percentage of statements executed\n\n**Important:** Coverage is a metric, not a goal. 100% coverage ≠ bug-free code.\n\n### 2. Test Classification\n\n#### Static Analysis\n**Purpose**: Catch errors before runtime\n**Tools**: ESLint, Prettier, TypeScript, Pylint, mypy, Ruff\n**When to run:** Pre-commit hooks, CI pipeline\n\n#### Unit Tests\n**Purpose**: Test isolated business logic\n**Tools**: Jest, Vitest, pytest, JUnit\n**Characteristics:**\n- Fast execution (\u003C 100ms per test)\n- No external dependencies (database, API, filesystem)\n- Deterministic (same input = same output)\n- Test single responsibility\n\n**Coverage Target:** 90%+ for business logic\n\nSee `references\u002Fcode-examples.md` for detailed unit test examples.\n\n#### Integration Tests\n**Purpose**: Test component interactions\n**Tools:** Testing Library, Supertest, pytest with fixtures\n**Characteristics:**\n- Test multiple units working together\n- May use test databases or mocked external services\n- Moderate execution time (\u003C 1s per test)\n- Focus on interfaces and contracts\n\n**Coverage Target:** 70%+ for API endpoints and component interactions\n\nSee `references\u002Fcode-examples.md` for API integration test examples.\n\n#### End-to-End (E2E) Tests\n**Purpose**: Validate critical user journeys\n**Tools:** Playwright, Cypress, Selenium\n**Characteristics:**\n- Test entire application flow (frontend + backend + database)\n- Slow execution (5-30s per test)\n- Run against production-like environment\n- Focus on business-critical paths\n\n**Coverage Target:** 5-10 critical user journeys\n\nSee `references\u002Fcode-examples.md` for complete E2E test examples.\n\n#### Performance Tests\n**Purpose**: Validate system performance under load\n**Tools:** k6, Artillery, JMeter, Locust\n**Types:**\n- **Load Testing**: System behavior under expected load\n- **Stress Testing**: Breaking point identification\n- **Spike Testing**: Sudden traffic surge handling\n- **Soak Testing**: Sustained load over time (memory leaks)\n\n**Coverage Target:** Test all performance-critical endpoints\n\nSee `references\u002Fcode-examples.md` for k6 load test examples.\n\n---\n\n## Test Planning\n\n### 1. Risk-Based Testing\n\nPrioritize testing based on risk assessment:\n\n**High Risk (100% coverage required):**\n- Payment processing\n- Authentication and authorization\n- Data mutations (create, update, delete)\n- Security-critical operations\n- Compliance-related features\n\n**Medium Risk (80% coverage):**\n- Business logic\n- Data transformations\n- API integrations\n- Email\u002Fnotification systems\n\n**Low Risk (50% coverage):**\n- UI styling\n- Static content\n- Read-only operations\n- Non-critical features\n\n### 2. Test Case Design\n\n**Given-When-Then Pattern:**\n```\nGiven [initial context]\nWhen [action occurs]\nThen [expected outcome]\n```\n\nThis pattern keeps tests clear and focused. See `references\u002Fcode-examples.md` for implementation examples.\n\n### 3. Test Data Management\n\n**Strategies:**\n- **Fixtures**: Pre-defined test data in JSON\u002FYAML files\n- **Factories**: Generate test data programmatically\n- **Seeders**: Populate test database with known data\n- **Faker Libraries**: Generate realistic random data\n\nSee `references\u002Fcode-examples.md` for test factory and fixture examples.\n\n---\n\n## Testing Patterns and Best Practices\n\n### 1. AAA Pattern (Arrange-Act-Assert)\n\nStructure tests in three clear phases:\n- **Arrange**: Set up test data and context\n- **Act**: Perform the action being tested\n- **Assert**: Verify expected outcomes\n\nSee `references\u002Fcode-examples.md` for detailed AAA pattern examples.\n\n### 2. Test Isolation\n\n**Each test should be independent:**\n- Use fresh test database for each test\n- Clean up resources after each test\n- Tests don't depend on execution order\n\nSee `references\u002Fcode-examples.md` for test isolation patterns.\n\n### 3. Mocking vs Real Dependencies\n\n**When to Mock:**\n- External APIs (payment gateways, third-party services)\n- Slow operations (file I\u002FO, network calls)\n- Non-deterministic behavior (current time, random values)\n- Hard-to-test scenarios (error conditions, edge cases)\n\n**When to Use Real Dependencies:**\n- Fast, deterministic operations\n- Critical business logic\n- Database operations (use test database)\n- Internal service interactions\n\nSee `references\u002Fcode-examples.md` for mocking examples.\n\n### 4. Snapshot Testing\n\n**Use for:** UI components, API responses, generated code\n\n**Warning:** Snapshots can become brittle. Use for stable components, not rapidly changing UI.\n\n### 5. Parameterized Tests\n\nTest multiple scenarios with same logic using data tables.\n\nSee `references\u002Fcode-examples.md` for parameterized test patterns.\n\n---\n\n## Continuous Testing\n\n### 1. CI\u002FCD Integration\n\n**Pipeline Stages:**\n```yaml\n# Example: GitHub Actions\nname: Test Pipeline\n\non: [push, pull_request]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v3\n      - name: Install dependencies\n        run: npm ci\n      - name: Lint\n        run: npm run lint\n      - name: Type check\n        run: npm run typecheck\n      - name: Unit & Integration Tests\n        run: npm test -- --coverage\n      - name: Upload coverage\n        uses: codecov\u002Fcodecov-action@v3\n      - name: E2E Tests\n        run: npm run test:e2e\n      - name: Performance Tests (on main branch)\n        if: github.ref == 'refs\u002Fheads\u002Fmain'\n        run: npm run test:performance\n```\n\n### 2. Quality Gates\n\n**Block merges\u002Fdeployments if:**\n- Code coverage drops below threshold (e.g., 80%)\n- Any tests fail\n- Linting errors exist\n- Performance regression detected (> 10% slower)\n- Security vulnerabilities found\n\n### 3. Test Execution Strategy\n\n**On Every Commit:**\n- Static analysis (lint, type check)\n- Unit tests\n- Fast integration tests (\u003C 5 min total)\n\n**On Pull Request:**\n- All tests (unit + integration + E2E)\n- Coverage report\n- Performance benchmarks\n\n**On Deploy to Staging:**\n- Full E2E suite\n- Load testing\n- Security scans\n\n**On Deploy to Production:**\n- Smoke tests (critical paths only)\n- Health checks\n- Canary deployments with monitoring\n\n---\n\n## Testing Tools Recommendations\n\n### JavaScript\u002FTypeScript\n\n| Category | Tool | Use Case |\n|----------|------|----------|\n| **Unit\u002FIntegration** | Vitest | Fast, Vite-native, modern |\n| **Unit\u002FIntegration** | Jest | Mature, extensive ecosystem |\n| **E2E** | Playwright | Cross-browser, reliable, fast |\n| **E2E** | Cypress | Developer-friendly, visual debugging |\n| **Component Testing** | Testing Library | User-centric, framework-agnostic |\n| **API Testing** | Supertest | HTTP assertions, Express integration |\n| **Performance** | k6 | Load testing, scriptable |\n\n### Python\n\n| Category | Tool | Use Case |\n|----------|------|----------|\n| **Unit\u002FIntegration** | pytest | Powerful, extensible, fixtures |\n| **API Testing** | httpx + pytest | Async support, modern |\n| **E2E** | Playwright (Python) | Browser automation |\n| **Performance** | Locust | Load testing, Python-based |\n| **Mocking** | unittest.mock | Standard library, reliable |\n\n---\n\n## Common Testing Anti-Patterns\n\n❌ **Testing Implementation Details**\n```typescript\n\u002F\u002F Bad: Testing internal state\nexpect(component.state.isLoading).toBe(false);\n\n\u002F\u002F Good: Testing user-visible behavior\nexpect(screen.queryByText('Loading...')).not.toBeInTheDocument();\n```\n\n❌ **Tests Too Coupled to Code**\n```typescript\n\u002F\u002F Bad: Test breaks when implementation changes\nexpect(userService.save).toHaveBeenCalledTimes(1);\n\n\u002F\u002F Good: Test behavior, not implementation\nconst user = await db.users.findOne({ email: 'test@example.com' });\nexpect(user).toBeTruthy();\n```\n\n❌ **Flaky Tests**\n```typescript\n\u002F\u002F Bad: Non-deterministic timeout\nawait waitFor(() => {\n  expect(screen.getByText('Success')).toBeInTheDocument();\n}, { timeout: 1000 }); \u002F\u002F Might fail on slow CI\n\n\u002F\u002F Good: Use explicit waits with longer timeout\nawait screen.findByText('Success', {}, { timeout: 5000 });\n```\n\n❌ **Giant Test Cases**\n```typescript\n\u002F\u002F Bad: One test does too much\ntest('user workflow', async () => {\n  \u002F\u002F 100 lines testing signup, login, profile update, logout...\n});\n\n\u002F\u002F Good: Focused tests\ntest('user can sign up', async () => { \u002F* ... *\u002F });\ntest('user can login', async () => { \u002F* ... *\u002F });\ntest('user can update profile', async () => { \u002F* ... *\u002F });\n```\n\n---\n\n## Integration with Agents\n\n### Code Quality Reviewer\n- Reviews test coverage reports\n- Suggests missing test cases\n- Validates test quality and structure\n- Ensures tests follow patterns from this skill\n\n### Backend System Architect\n- Uses test strategy templates when designing services\n- Ensures APIs are testable (dependency injection, clear interfaces)\n- Plans integration test architecture\n\n### Frontend UI Developer\n- Applies component testing patterns\n- Uses Testing Library best practices\n- Implements E2E tests for user flows\n\n### AI\u002FML Engineer\n- Adapts testing patterns for ML models (data validation, model performance tests)\n- Uses performance testing for inference endpoints\n\n---\n\n## Quick Start Checklist\n\nWhen starting a new project or feature:\n\n- [ ] Define coverage targets (overall, critical paths, new code)\n- [ ] Choose testing framework (Jest\u002FVitest, Playwright, etc.)\n- [ ] Set up test infrastructure (test database, fixtures, factories)\n- [ ] Create test plan (see `templates\u002Ftest-plan-template.md`)\n- [ ] Implement static analysis (ESLint, TypeScript)\n- [ ] Write unit tests for business logic (80%+ coverage)\n- [ ] Write integration tests for API endpoints (70%+ coverage)\n- [ ] Write E2E tests for critical user journeys (5-10 flows)\n- [ ] Configure CI\u002FCD pipeline with quality gates\n- [ ] Set up coverage reporting (Codecov, Coveralls)\n- [ ] Document testing conventions in project README\n\n**For detailed code examples**: See `references\u002Fcode-examples.md`\n\n---\n\n**Skill Version**: 1.0.0\n**Last Updated**: 2025-10-31\n**Maintained by**: AI Agent Hub Team\n",{"name":5,"tags":44,"author":48,"version":49,"description":7},[24,45,46,47,33],"quality-assurance","test-strategy","automation","AI Agent Hub","1.0.0","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Fariegoldkin\u002Ftesting-strategy-builder",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill testing-strategy-builder",{"tool":65,"command":66},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill testing-strategy-builder",{"tool":68,"command":69},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill testing-strategy-builder","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fariegoldkin\u002Ftesting-strategy-builder\u002FSKILL.md",true,[73,79,83,87,91],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"checklists\u002Ftest-coverage-checklist.md","REFERENCE","参考文档",12325,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fariegoldkin\u002Ftesting-strategy-builder\u002Fchecklists\u002Ftest-coverage-checklist.md",{"path":80,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fcode-examples.md",7886,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fariegoldkin\u002Ftesting-strategy-builder\u002Freferences\u002Fcode-examples.md",{"path":84,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":85,"sourceHtmlUrl":86},"skill-report.json",25274,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fariegoldkin\u002Ftesting-strategy-builder\u002Fskill-report.json",{"path":88,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":89,"sourceHtmlUrl":90},"templates\u002Ftest-case-template.md",6821,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fariegoldkin\u002Ftesting-strategy-builder\u002Ftemplates\u002Ftest-case-template.md",{"path":92,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":93,"sourceHtmlUrl":94},"templates\u002Ftest-plan-template.md",8785,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fariegoldkin\u002Ftesting-strategy-builder\u002Ftemplates\u002Ftest-plan-template.md",[96,105,114,123,129,135],{"skillNo":97,"name":98,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":39},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[102,103,104],"model","model hierarchy","model hierarchy skill",{"skillNo":106,"name":107,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":39},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[111,112,113],"MCP","zoom","zoom mcp",{"skillNo":115,"name":116,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":39},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[120,121,122,112],"sdk","zoom apps sdk","apps",{"skillNo":124,"name":125,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":39},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[125],{"skillNo":130,"name":131,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":39},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[131],{"skillNo":136,"name":137,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":39},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[137]]