Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/aiskillstore-testing-strategy-builder/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | 134% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 541% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 95% | 0% |
| case-18 | ✓→✓ | = Same ✓ | 185% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 226% | 0% |
This 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.
When to use this skill:
Bundled Resources:
references/code-examples.md - Detailed testing code examplestemplates/test-plan-template.md - Comprehensive test plan templatetemplates/test-case-template.md - Test case documentation templatechecklists/test-coverage-checklist.md - Coverage verification checklistThis skill references the following testing tools. Not all are required - the skill will recommend appropriate tools based on your project.
npm install --save-dev jest @types/jestnpx jest --initnpm install --save-dev vitestnpm install --save-dev @playwright/testnpx playwright installbrew install k6k6 run script.jspip install pytestpytestpip install pytest-covpytest --cov=.pip install locustlocust -f locustfile.pynpm install --save-dev c8c8 npm testnpm install --save-dev nycnyc npm testbash# JavaScript/TypeScript jest --version vitest --version playwright --version k6 version # Python pytest --version locust --version # Coverage c8 --version nyc --version
Note: The skill will guide you to select tools based on your project framework (React, Vue, FastAPI, Django, etc.) and testing needs.
Modern testing follows the "Testing Trophy" model (evolved from the testing pyramid):
🏆
/ \
/ E2E \ ← Few (critical user journeys)
/----------\
/ Integration\ ← Many (component interactions)
/--------------\
/ Unit \ ← Most (business logic)
/------------------\
/ Static Analysis \ ← Foundation (linting, type checking)Principles:
Balance: 70% integration, 20% unit, 10% E2E (adjust based on context)
Recommended Targets:
Coverage Types:
Important: Coverage is a metric, not a goal. 100% coverage ≠ bug-free code.
Purpose: Catch errors before runtime Tools: ESLint, Prettier, TypeScript, Pylint, mypy, Ruff When to run: Pre-commit hooks, CI pipeline
Purpose: Test isolated business logic Tools: Jest, Vitest, pytest, JUnit Characteristics:
Coverage Target: 90%+ for business logic
See references/code-examples.md for detailed unit test examples.
Purpose: Test component interactions Tools: Testing Library, Supertest, pytest with fixtures Characteristics:
Coverage Target: 70%+ for API endpoints and component interactions
See references/code-examples.md for API integration test examples.
Purpose: Validate critical user journeys Tools: Playwright, Cypress, Selenium Characteristics:
Coverage Target: 5-10 critical user journeys
See references/code-examples.md for complete E2E test examples.
Purpose: Validate system performance under load Tools: k6, Artillery, JMeter, Locust Types:
Coverage Target: Test all performance-critical endpoints
See references/code-examples.md for k6 load test examples.
Prioritize testing based on risk assessment:
High Risk (100% coverage required):
Medium Risk (80% coverage):
Low Risk (50% coverage):
Given-When-Then Pattern:
Given [initial context]
When [action occurs]
Then [expected outcome]This pattern keeps tests clear and focused. See references/code-examples.md for implementation examples.
Strategies:
See references/code-examples.md for test factory and fixture examples.
Structure tests in three clear phases:
See references/code-examples.md for detailed AAA pattern examples.
Each test should be independent:
See references/code-examples.md for test isolation patterns.
When to Mock:
When to Use Real Dependencies:
See references/code-examples.md for mocking examples.
Use for: UI components, API responses, generated code
Warning: Snapshots can become brittle. Use for stable components, not rapidly changing UI.
Test multiple scenarios with same logic using data tables.
See references/code-examples.md for parameterized test patterns.
Pipeline Stages:
yaml# Example: GitHub Actions name: Test Pipeline on: [push, pull_request] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install dependencies run: npm ci - name: Lint run: npm run lint - name: Type check run: npm run typecheck - name: Unit & Integration Tests run: npm test -- --coverage - name: Upload coverage uses: codecov/codecov-action@v3 - name: E2E Tests run: npm run test:e2e - name: Performance Tests (on main branch) if: github.ref == 'refs/heads/main' run: npm run test:performance
Block merges/deployments if:
On Every Commit:
On Pull Request:
On Deploy to Staging:
On Deploy to Production:
| Category | Tool | Use Case | |----------|------|----------| | Unit/Integration | Vitest | Fast, Vite-native, modern | | Unit/Integration | Jest | Mature, extensive ecosystem | | E2E | Playwright | Cross-browser, reliable, fast | | E2E | Cypress | Developer-friendly, visual debugging | | Component Testing | Testing Library | User-centric, framework-agnostic | | API Testing | Supertest | HTTP assertions, Express integration | | Performance | k6 | Load testing, scriptable |
| Category | Tool | Use Case | |----------|------|----------| | Unit/Integration | pytest | Powerful, extensible, fixtures | | API Testing | httpx + pytest | Async support, modern | | E2E | Playwright (Python) | Browser automation | | Performance | Locust | Load testing, Python-based | | Mocking | unittest.mock | Standard library, reliable |
❌ Testing Implementation Details
typescript// Bad: Testing internal state expect(component.state.isLoading).toBe(false); // Good: Testing user-visible behavior expect(screen.queryByText('Loading...')).not.toBeInTheDocument();
❌ Tests Too Coupled to Code
typescript// Bad: Test breaks when implementation changes expect(userService.save).toHaveBeenCalledTimes(1); // Good: Test behavior, not implementation const user = await db.users.findOne({ email: 'test@example.com' }); expect(user).toBeTruthy();
❌ Flaky Tests
typescript// Bad: Non-deterministic timeout await waitFor(() => { expect(screen.getByText('Success')).toBeInTheDocument(); }, { timeout: 1000 }); // Might fail on slow CI // Good: Use explicit waits with longer timeout await screen.findByText('Success', {}, { timeout: 5000 });
❌ Giant Test Cases
typescript// Bad: One test does too much test('user workflow', async () => { // 100 lines testing signup, login, profile update, logout... }); // Good: Focused tests test('user can sign up', async () => { /* ... */ }); test('user can login', async () => { /* ... */ }); test('user can update profile', async () => { /* ... */ });
When starting a new project or feature:
templates/test-plan-template.md)For detailed code examples: See references/code-examples.md
Skill Version: 1.0.0 Last Updated: 2025-10-31 Maintained by: AI Agent Hub Team
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-18 | pass→pass | 10,983 | 22,561 | +105% | 1 | 1 | 0% | 1,744 | 4,963 | +185% | 0 | 0 | — |
case-07 | fail→fail | 18,953 | 14,861 | -22% | 1 | 1 | 0% | 3,058 | 6,056 | +98% | 0 | 0 | — |
case-01 | fail→fail | 42,880 | 32,410 | -24% | 1 | 1 | 0% | 6,030 | 8,337 | +38% | 0 | 0 | — |
case-02 | fail→fail | 29,753 | 20,613 | -31% | 1 | 1 | 0% | 3,931 | 7,148 | +82% | 0 | 0 | — |
case-03 | pass→pass | 11,896 | 13,765 | +16% | 1 | 1 | 0% | 1,584 | 5,158 | +226% | 0 | 0 | — |
case-04 | pass→pass | 8,242 | 7,901 | -4% | 1 | 1 | 0% | 513 | 3,895 | +659% | 0 | 0 | — |
case-05 | pass→pass | 10,442 | 11,799 | +13% | 1 | 1 | 0% | 928 | 4,623 | +398% | 0 | 0 | — |
case-06 | fail→pass | 19,865 | 10,230 | -49% | 1 | 1 | 0% | 2,316 | 5,427 | +134% | 0 | 0 | — |
case-08 | fail→fail | 16,411 | 16,653 | +1% | 1 | 1 | 0% | 2,557 | 6,113 | +139% | 0 | 0 | — |
case-09 | fail→pass | 9,650 | 10,389 | +8% | 1 | 1 | 0% | 681 | 4,368 | +541% | 0 | 0 | — |
case-10 | pass→pass | 5,946 | 3,450 | -42% | 1 | 1 | 0% | 977 | 4,067 | +316% | 0 | 0 | — |
case-11 | pass→pass | 5,578 | 7,016 | +26% | 1 | 1 | 0% | 926 | 4,628 | +400% | 0 | 0 | — |
case-12 | pass→pass | 13,821 | 13,726 | -1% | 1 | 1 | 0% | 2,332 | 5,763 | +147% | 0 | 0 | — |
case-13 | fail→pass | 14,337 | 10,243 | -29% | 1 | 1 | 0% | 2,215 | 4,319 | +95% | 0 | 0 | — |
case-14 | fail→fail | 20,201 | 22,204 | +10% | 1 | 1 | 0% | 2,451 | 5,904 | +141% | 0 | 0 | — |
case-15 | fail→fail | 18,240 | 22,263 | +22% | 1 | 1 | 0% | 2,062 | 5,842 | +183% | 0 | 0 | — |
case-16 | pass→pass | 14,012 | 19,728 | +41% | 1 | 1 | 0% | 2,211 | 5,697 | +158% | 0 | 0 | — |
case-17 | pass→pass | 16,106 | 14,307 | -11% | 1 | 1 | 0% | 2,177 | 5,136 | +136% | 0 | 0 | — |
case-19 | pass→pass | 21,862 | 15,607 | -29% | 1 | 1 | 0% | 2,497 | 5,940 | +138% | 0 | 0 | — |
case-20 | pass→pass | 12,349 | 5,591 | -55% | 1 | 1 | 0% | 1,416 | 4,451 | +214% | 0 | 0 | — |
case-21 | pass→pass | 22,244 | 12,158 | -45% | 1 | 1 | 0% | 2,350 | 5,574 | +137% | 0 | 0 | — |
case-22 | pass→pass | 14,807 | 21,519 | +45% | 1 | 1 | 0% | 2,464 | 5,947 | +141% | 0 | 0 | — |
case-23 | pass→pass | 17,351 | 6,925 | -60% | 1 | 1 | 0% | 1,512 | 4,755 | +214% | 0 | 0 | — |
case-24 | pass→pass | 17,583 | 14,915 | -15% | 1 | 1 | 0% | 2,217 | 5,221 | +135% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.