kid-sid/claude-spellbook/test-strategy
Claude Code and agent skill by kid-sid/claude-spellbook
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Use when choosing a testing model for a new project, auditing a test suite that is slow or provides low confidence, setting coverage targets, or writing a QA test plan for a release.
Install
npx vskill@latest install kid-sid/claude-spellbook/test-strategySemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as kid-sid/claude-spellbook/test-strategy.
Test Strategy
Design a complete testing strategy for any project: choose the right model, set meaningful coverage targets, shift quality left, and plan non-functional testing.
When to Activate
- Starting a new project and deciding on a testing approach
- Auditing an existing test suite that is slow or provides low confidence
- Writing a QA plan or test plan document
- Deciding how to balance unit vs integration vs E2E tests for a feature
- Setting coverage targets for a team or project
- Planning non-functional testing (load, security, accessibility)
Testing Models
Choosing the right testing model is the first decision. Each reflects a different philosophy about where confidence comes from.
The Pyramid (Classic)
- Best for: well-defined layers, strong service boundaries, experienced team
- Risk: integration tests are often underdone; false confidence from high unit coverage
The Trophy (Kent C. Dodds)
- Best for: React/frontend apps, services where user behavior drives quality
- The "integration" layer tests realistic slices (full request/response, not mocked)
The Honeycomb (Spotify / Microservices)
- Emphasized: service integration tests (call your API, hit a real DB)
- De-emphasized: pure unit tests (too many mocks = low confidence)
- Best for: microservices, event-driven systems
Decision Table
| Context | Recommended Model | Reason | |
|---|---|---|---|
| Monolith, complex business logic | Pyramid | Units test business rules cheaply | |
| Frontend-heavy application | Trophy | Integration tests reflect user behavior | |
| Microservices (many small services) | Honeycomb | Service integration > unit isolation | |
| Data pipeline | Custom (mostly integration) | Units are trivial; real data matters |
Coverage Target Setting
What Coverage Measures
| Metric | What It Measures | How to Get It | |
|---|---|---|---|
| Line coverage | Were these lines executed? | --cov, --coverage, go test -cover | |
| Branch coverage | Were all if/else paths taken? | --branch flag | |
| Mutation coverage | Do tests catch logic mutations? | mutmut (Python), stryker (TS), go-mutesting |
Realistic Targets
| Codebase Type | Line Coverage Target | Notes | |
|---|---|---|---|
| New greenfield project | 80%+ | Enforce from day 1 | |
| Adding tests to legacy | Raise by 5% per sprint | Ratchet: never let it drop | |
| Critical path (payments, auth) | 95%+ | Include branch coverage | |
| Generated code, migrations, config loaders | Exclude from measurement | Noisy, not meaningful |
Rule: coverage is a floor, not a goal. 60% with excellent integration tests > 100% with trivial mocks.
Enforcing Coverage in CI
Shift-Left Testing
Shift-left = catch defects earlier in the development cycle (before code review, before CI).
| Technique | When It Runs | What It Catches | |
|---|---|---|---|
| Type checking (mypy, tsc, go vet) | IDE + pre-commit | Type errors, wrong function signatures | |
| Linting (ruff, eslint, staticcheck) | IDE + pre-commit | Style, common bugs, dead code | |
| Pre-commit hooks | On git commit | Both above, secret scanning | |
| Contract tests | CI on PR | API contract violations between services | |
| Property-based tests | CI | Edge cases the developer didn't think of |
Pre-Commit Configuration
Contract Testing (Pact)
Contract tests verify that two services agree on the shape of requests and responses without needing both services running simultaneously.
Property-Based Testing
Non-Functional Test Types
| Type | What It Tests | Tools | When to Run | |
|---|---|---|---|---|
| Load testing | Behavior under expected traffic | k6, Locust, JMeter | Pre-launch, nightly | |
| Stress testing | Behavior beyond capacity | k6, Gatling | Before scaling decisions | |
| Soak testing | Behavior over extended time (memory leaks) | k6, Locust | Weekly | |
| Spike testing | Sudden traffic burst handling | k6 | Before big events | |
| Security testing | Vulnerability scanning | OWASP ZAP, Snyk, pip-audit | Every CI run (SAST), nightly (DAST) | |
| Accessibility (a11y) | WCAG compliance | axe-core, Playwright + axe | Every PR for UI changes | |
| Visual regression | Unintended UI changes | Playwright screenshots, Percy | Every PR for UI changes |
k6 Load Test Example
Accessibility Testing with Playwright
Test Plan Template
See also:unit-testing,integration-testing,solution-testing,performance-testing
Red Flags
- Applying the test pyramid without considering system architecture — the pyramid assumes cheap unit tests; for integration-heavy microservices or event-driven systems, the Honeycomb model often fits better
- Coverage percentage as the primary quality metric — 90% line coverage can coexist with zero behavior coverage if tests assert on implementation rather than outcomes; track branch coverage and mutation scores
- E2E tests for edge cases and error paths — edge cases should live in unit or integration tests; E2E tests should cover critical user journeys only, not every conditional branch
- Consumer-driven contract tests treated as optional — for service-to-service dependencies, a broken contract is a production outage; Pact catches this class of failure in CI before it ships
- Load and security tests planned for "after launch" — non-functional tests deferred post-launch are perpetually skipped; include them in the Definition of Done for every API feature
- No test plan before a major release — releases without a test plan have undefined risk; write a one-page plan listing scenarios, owners, and pass/fail criteria before any major release
- Shared mutable test state across the suite — a test that leaves the database dirty causes cascading failures in subsequent tests; treat test isolation as a first-class constraint
Checklist
- [ ] Testing model chosen (Pyramid/Trophy/Honeycomb) and matches team context
- [ ] Coverage targets defined per layer and enforced in CI
- [ ] Branch coverage measured for critical business logic
- [ ] Pre-commit hooks configured for linting, type-checking, secret scanning
- [ ] Non-functional test types identified (at least: load testing and security scanning)
- [ ] Test plan written for major releases
- [ ] Generated code and config loaders excluded from coverage measurement
- [ ] Test suite runs in under 10 minutes in CI (unit + integration; E2E separate)
- [ ] Contract tests in place for any service-to-service API dependencies
- [ ] Accessibility tests run on every PR touching UI components
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/test-strategy/skill.md
Popularity
- Repository stars
- 186
- Repository forks
- 15
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kid-sid/claude-spellbook/test-strategy)