testing-strategy
Skill1 starsChanged 7 months agoMITView on GitHub
Design test strategies and test plans. Trigger with "how should we test", "test strategy for", "write tests for", "test plan", "what tests do we need", or when the user needs help with testing approaches, coverage, or test architecture.
54 other projects use a version of this, 6 of them edited.
Adopted by
Most recently taken up by
- jDxve/avengers-kittheir own version, first seen Nov 8, 2026
- ccoalm/ccl-skillstheir own version, first seen Nov 8, 2026
- komluk/scaffoldingtheir own version, first seen Nov 7, 2026
- bmsuisse/skillstheir own version, first seen Nov 6, 2026
- Cure-Consulting-Group/ProductEngineeringSkillstheir own version, first seen Nov 4, 2026
- CsHeng/agent-skillstheir own version, first seen Nov 4, 2026
Used with
Projects with it also use api-contract-design, react-patterns and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MohOneXSkillapi-contract-design
Designs and reviews API contracts (REST, RPC, GraphQL, library interfaces) for evolvability, backward compatibility, and failure semantics. Use when defining new endpoints/interfaces, versioning an API, reviewing a schema, or deciding how breaking changes propagate to clients.
Also in 3 projects that use this
xenitV1Skillreact-patterns
Modern React patterns and principles. Hooks, composition, performance, TypeScript best practices.
Also in 4 projects that use this
Microsoft AzureSkillrelease-readiness
Complete ODIN release documentation and validation checks before declaring user-visible work complete, preparing a release, or opening the Release-to-main pull request.
Also in 3 projects that use this
MicrosoftSkilldeep-review
Multi-agent deep code review for regorus. Three diverse parallel discovery agents with context asymmetry, risk-triggered micro-passes, adversarial gap-finder, and verification with disproval mandates. Use for high-stakes changes.
Also in 3 projects that use this
Other versions54 projects use a version of this.
Word for word · 0
None found.
Edited · 6
- anthropics/knowledge-work-plugins★ 35k24% same
- Blushyes/reef★ 8424% same
- edu6565/claude-skills★ 024% same
- InfiniteRoomLabs/agent-ops★ 023% same
- jgamaraalv/delivery-loop★ 024% same
- KevinReactiv8/claude-skills★ 024% same
Wrote their own version · 48
- chthollyphile/folia-major★ 12ksame name
- Community-Access/accessibility-agents★ 409same name
- AnastasiyaW/claude-code-config★ 214same name
- AnastasiyaW/codex-claude-code-config★ 214same name
- irahardianto/awesome-agv★ 157same name
- shinpr/agentic-code★ 51same name
- addxai/enterprise-harness-engineering★ 44same name
- drafthq/draft★ 40same name
- zakariaf/Flutter-Skills★ 32same name
- suhailkakar/the-skills★ 26same name
38 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository164 other files it gives its agents.
- instrument-data-to-allotropeSkill
- literature-reviewSkill
- nextflow-developmentSkill
- scientific-problem-selectionSkill
- scvi-toolsSkill
- single-cell-rna-qcSkill
- discover-brandSkill
- enforce-voiceSkill
- generate-guidelinesSkill
- csat-reportSkill
- customer-escalationSkill
- customer-researchSkill
- draft-responseSkill
- kb-articleSkill
- sentiment-analysisSkill
- ticket-triageSkill
- analyzeSkill
- build-dashboardSkill
- create-vizSkill
- data-context-extractorSkill
- data-modelingSkill
- data-pipelineSkill
- etl-designSkill
- explore-dataSkill
- sql-queriesSkill
- statistical-analysisSkill
- validate-dataSkill
- write-querySkill
- accessibility-reviewSkill
- component-librarySkill
- design-critiqueSkill
- design-handoffSkill
- design-systemSkill
- frontend-designSkill
- research-synthesisSkill
- user-researchSkill
- ux-copySkill
- wireframingSkill
- Agent DevelopmentSkill
- CLAUDE.md ManagementSkill
- MCP Server BuilderSkill
- Plugin DevelopmentSkill
- Prompt EngineeringSkill
- Skill CreatorSkill
- curriculum-designSkill
- lesson-planningSkill
- quiz-generatorSkill
- study-guideSkill
- tutoringSkill
- api-designSkill
- architectureSkill
- ci-cd-pipelineSkill
- code-reviewSkill
- database-migrationSkill
- debugSkill
- dependency-auditSkill
- deploy-checklistSkill
- documentationSkill
- error-handlingSkill
- git-workflowSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 12 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 44 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 110
Use real databases with test containers for integration tests.
- Distinctive: line 111
Avoid mocking internal modules — that couples tests to implementation.
- Distinctive: line 112
Use dependency injection to make mocking straightforward.
- Distinctive: line 138
Use factories or builders for test data, not raw objects.
- Distinctive: line 140
Avoid shared mutable state between tests.
- Distinctive: line 141
Use realistic but deterministic data (seeded random).
- Distinctive: line 144
Create helpers for common setup (authenticated requests, seeded DB).
- Distinctive: line 261
Action: Read existing tests. Check for common anti-patterns (testing implementation, flaky tests, excessive mocking).
- Distinctive: line 265
Test behavior, not implementation.
- Distinctive: line 269
Test names should describe the scenario and expected outcome: "returns 404 when order does not exist" is good.
- Distinctive: line 270
Use factories for test data, not copy-pasted objects.
- Distinctive: line 271
Avoid testing third-party code.
“Common” is measured: kept by at least 6 in 10 of the 44 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Testing Strategy
Design comprehensive test strategies covering unit, integration, and end-to-end testing. Analyze coverage gaps, define test architecture, and create actionable test plans.
Workflow
Step 1: Understand the Testing Context
Gather information about what needs testing and the current state:
# Check existing test framework and config
cat jest.config.* vitest.config.* pytest.ini pyproject.toml 2>/dev/null | head -40
# Find existing tests
find . -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" | grep -v node_modules | head -30
# Count test vs source files
echo "Source:" && find src -name "*.ts" -o -name "*.js" -o -name "*.py" 2>/dev/null | wc -l
echo "Tests:" && find . \( -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" \) -not -path "*/node_modules/*" 2>/dev/null | wc -l
# Check for test scripts in package.json
grep -A5 '"scripts"' package.json 2>/dev/null | grep -i test
# Check coverage config
grep -r "coverage" jest.config.* vitest.config.* pyproject.toml 2>/dev/nullIdentify:
- What test framework is in use?
- What test types exist (unit, integration, e2e)?
- What coverage exists and where are the gaps?
- What test utilities or fixtures are established?
- What CI integration exists for tests?
Step 2: Map the Testing Pyramid
Define what to test at each level based on the system's architecture:
Unit Tests (70% of tests)
- Pure functions and business logic.
- Data transformations and validations.
- State management logic.
- Utility functions and helpers.
- Individual class methods.
Characteristics: Fast (< 10ms each), isolated (no I/O), deterministic.
Integration Tests (20% of tests)
- API endpoint request-response cycles.
- Database operations (queries, transactions, migrations).
- Service-to-service communication.
- Message queue producers and consumers.
- Authentication and authorization flows.
- Third-party API integrations (with contract tests or sandboxes).
Characteristics: Use real databases (test containers), real HTTP, controlled test data.
End-to-End Tests (10% of tests)
- Critical user journeys (signup, purchase, core workflow).
- Cross-service flows that span multiple systems.
- Smoke tests for deployment verification.
Characteristics: Slow, brittle, expensive. Test only the most critical paths.
Step 3: Design the Test Strategy
For each component or feature, define:
What to test:
- Happy path: Does it work with valid input?
- Edge cases: Empty input, boundary values, maximum sizes.
- Error cases: Invalid input, missing dependencies, network failures.
- Security cases: Unauthorized access, injection, privilege escalation.
- Concurrency: Race conditions, duplicate submissions, stale data.
What NOT to test:
- Framework internals (don't test that React renders a div).
- Third-party library behavior (test your usage, not the library).
- Implementation details (test behavior, not how it's achieved).
- Trivial code (getters, setters, simple pass-through).
Mocking Strategy:
- Mock external services and APIs at the HTTP boundary.
- Mock the clock for time-dependent logic.
- Use real databases with test containers for integration tests.
- Avoid mocking internal modules — that couples tests to implementation.
- Use dependency injection to make mocking straightforward.
Step 4: Define Test Architecture
Establish patterns for the test suite:
Test Organization
src/
services/
order-service.ts
order-service.test.ts # Unit tests co-located
tests/
integration/
api/
orders.test.ts # Integration tests by feature
e2e/
checkout-flow.test.ts # E2E tests by user journey
fixtures/
orders.ts # Shared test data
helpers/
test-db.ts # Test utilities
api-client.tsTest Data Management
- Use factories or builders for test data, not raw objects.
- Reset database state between tests (transactions or truncation).
- Avoid shared mutable state between tests.
- Use realistic but deterministic data (seeded random).
Test Utilities
- Create helpers for common setup (authenticated requests, seeded DB).
- Build custom matchers for domain-specific assertions.
- Standardize error assertion patterns.
Step 5: Create the Test Plan
Produce a concrete list of test cases organized by priority.
Output Format
Test Strategy Document
# Test Strategy: <Feature/Service Name>
## Overview
<What is being tested and why this strategy>
## Testing Pyramid
### Unit Tests
| Module/Function | Test Cases | Priority |
|------------------------|-------------------------------------|----------|
| validateOrder() | Valid order, empty items, negative qty | High |
| calculateTotal() | Normal, discounts, tax, rounding | High |
| formatCurrency() | USD, EUR, zero, large numbers | Medium |
### Integration Tests
| Flow | Test Cases | Priority |
|------------------------|-------------------------------------|----------|
| POST /api/orders | Create, validation error, auth, idempotency | High |
| Order + Payment | Success, payment failure, retry | High |
| Order + Inventory | In stock, out of stock, concurrent | High |
### End-to-End Tests
| Journey | Steps | Priority |
|------------------------|-------------------------------------|----------|
| Checkout | Browse -> Add to cart -> Pay -> Confirm | Critical |
| Returns | Order history -> Request return -> Refund | High |
## Mocking Strategy
| Dependency | Strategy |
|-----------------------|--------------------------------------|
| Payment API | HTTP mock with recorded responses |
| Database | Test container with reset per test |
| Email service | In-memory spy |
| Clock/time | Fake timers for expiration logic |
## Test Data
| Entity | Factory | Key Variants |
|---------|---------------------------|--------------------------|
| User | createTestUser(overrides) | admin, customer, guest |
| Order | createTestOrder(overrides) | pending, paid, refunded |
| Product | createTestProduct(overrides)| in-stock, discontinued |
## Coverage Targets
| Layer | Current | Target | Notes |
|--------------|---------|--------|-----------------------------|
| Unit | 45% | 80% | Focus on business logic |
| Integration | 20% | 60% | API endpoints first |
| E2E | 5% | N/A | Critical paths only |
## CI Integration
- Unit tests: run on every push (< 2 min)
- Integration tests: run on every PR (< 10 min)
- E2E tests: run before deploy to staging (< 20 min)Specific Test Plan (for a single feature)
## Test Plan: <Feature Name>
### Unit Tests
#### Test: validateOrder rejects empty items
```<language>
test('rejects order with no items', () => {
const result = validateOrder({ items: [] });
expect(result.valid).toBe(false);
expect(result.errors).toContain('Order must have at least one item');
});Test: calculateTotal applies discount correctly
test('applies percentage discount', () => {
const total = calculateTotal({
items: [{ price: 1000, quantity: 2 }],
discount: { type: 'percentage', value: 10 }
});
expect(total).toBe(1800);
});Integration Tests
Test: POST /api/orders creates order successfully
...
## Examples
**User**: "How should we test the new payment integration?"
**Action**: Analyze the payment code, identify integration points (payment API, database, webhooks), and design a test strategy with unit tests for validation logic, integration tests for the API flow with mocked payment provider, and e2e tests for the critical checkout journey.
**User**: "We have low test coverage, where should we start?"
**Action**: Identify the highest-risk, least-tested code paths. Prioritize core business logic and critical API endpoints. Create a phased plan to improve coverage where it matters most.
**User**: "Write tests for this function" (with code)
**Action**: Analyze the function's inputs, outputs, and edge cases. Write concrete test cases covering happy path, error paths, and boundaries.
**User**: "Review our test suite"
**Action**: Read existing tests. Check for common anti-patterns (testing implementation, flaky tests, excessive mocking). Identify coverage gaps and suggest improvements.
## Best Practices
- Test behavior, not implementation. Tests should verify WHAT code does, not HOW it does it. This makes tests resilient to refactoring.
- The testing pyramid matters. Most tests should be fast unit tests. Integration and e2e tests should be targeted at high-risk flows. An inverted pyramid (mostly e2e) is slow, flaky, and expensive.
- Flaky tests are worse than no tests. They erode trust in the suite. Fix or remove them immediately.
- One assertion per test is a guideline, not a rule. A test should verify one BEHAVIOR, which may require multiple assertions.
- Test names should describe the scenario and expected outcome: "returns 404 when order does not exist" is good. "test1" is not.
- Use factories for test data, not copy-pasted objects. Factories make tests readable and maintainable.
- Avoid testing third-party code. Trust that the library works. Test YOUR usage of it.
- Mock at boundaries, not internally. Mock the HTTP client, not the service that uses it. This keeps tests realistic.
- Fast tests get run. Slow tests get skipped. Optimize for speed at every level.
- Coverage is a useful metric but a bad target. 100% coverage with bad tests gives false confidence. Focus on testing the right things well.Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

