test-strategy
Skill1 starsChanged 12 days agoMITView on GitHub
Choose the right test level for each behaviour and write tests that fail only for real reasons. Covers the microservice test portfolio — unit, component (service in isolation with real infrastructure and stubbed collaborators), integration, and narrow end-to-end — plus what each level must not own, test doubles discipline, determinism and flakiness, arrange-act-assert structure, assertion quality, coverage versus value, mutation testing, and test data management. Use when writing or reviewing any test, deciding what level to test at, diagnosing a flaky or slow suite, or when the user says 'tests', 'unit test', 'component test', 'test pyramid', 'mocking', 'flaky', or 'coverage'. This skill governs test design inside a service — cross-service contract verification belongs to contract-testing.
44 other projects use a version of this.
Adopted by
Most recently taken up by
- afine907/skillstheir own version, first seen Nov 29, 2026
- ericgandrade/agentic-sdlctheir own version, first seen Nov 29, 2026
- l-gevity/l-gevity-skillstheir own version, first seen Nov 22, 2026
- rui66648/agents-dev-rulestheir own version, first seen Nov 22, 2026
- meaningfy-ws/skillerytheir own version, first seen Nov 16, 2026
- swap-cameroon/kuro-antigravity-configtheir own version, first seen Nov 15, 2026
Used with
Projects with it also use database-testing, exploratory-testing and 9 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.
petrkindlmannSkilldatabase-testing
Validate database integrity, test migrations forward and backward, verify schema constraints, manage seed data, detect migration drift, and identify query performance issues. Covers PostgreSQL, MySQL, MongoDB with Prisma, TypeORM, Drizzle, and SQLAlchemy, plus Testcontainers test databases. Use when: "database test," "migration test," "migration rollback," "rollback test," "data integrity," "SQL test," "schema validation," "seed data," "query performance," "Testcontainers." Not for: synthetic data generation/masking at scale — use test-data-management; Docker/IaC test-environment provisioning — use test-environments; SQL injection — use security-testing. Related: test-data-management, test-environments, security-testing, ci-cd-integration.
Also in 3 projects that use this
testified-ossSkillexploratory-testing
Guide exploratory testing sessions including charter creation, session-based testing, heuristics application, and finding documentation. Use when planning exploratory testing, conducting test sessions, or documenting discoveries.
Also in 4 projects that use this
jayavibhavnkSkilldata-pipelines
Build ETL/data pipelines - extract, transform, load with proper error handling and monitoring.
Also in 3 projects that use this
mahsumaktasSkillverification-gate
Verification gate before claiming task completion. No completion claim without fresh evidence.
Also in 3 projects that use this
ffsshhttiikkSkillunit-testing
Unit testing best practices and patterns
Also in 4 projects that use this
AnthropicSkillincident-response
Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.
Also in 8 projects that use this
Other versions44 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 44
- nurettincoban/ai-prd-workflow★ 317same name
- petrkindlmann/qa-skills★ 274same name
- kid-sid/claude-spellbook★ 190same name
- avelikiy/great_cto★ 115same name
- ericgandrade/agentic-sdlc★ 109same name
- l-gevity/l-gevity-skills★ 93same name
- fishzjp/qa-skills★ 64same name
- nahid-sparktales/agent-dispatcher★ 59same name
- nimadorostkar/Claude-Skills-collection★ 41same name
- caiaffa/claude-code-ultimate-engineering-system★ 17same name
34 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 repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- api-contractsSkill
- api-protocolsSkill
- clean-architectureSkill
- collaborative-judgmentSkill
- config-and-dependenciesSkill
- contract-testingSkill
- cqrs-and-consistencySkill
- data-accessSkill
- design-firstSkill
- design-serviceSkill
- domain-modellingSkill
- idempotency-and-immutabilitySkill
- implement-serviceSkill
- infrastructure-adaptersSkill
- refactor-safelySkill
- resilience-patternsSkill
- review-serviceSkill
- secure-serviceSkill
- service-boundariesSkill
- stack-profileSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 37 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Read .msskills/config.yaml in the repo root.
- Very specific: line 25
No config file or no paths.testing key → use defaults.
- Distinctive: line 32
Test each behaviour once, at the cheapest level that can genuinely prove it.
- Distinctive: line 53
If it asserts on internal calls, private state, or field order → rewrite against observable outcomes.
- Distinctive: line 78
All checks pass → state "Test holds: <level>, <behaviour>, deterministic."
“Common” is measured: kept by at least 6 in 10 of the 37 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
Test Strategy
A test suite has one job: tell you, quickly and truthfully, whether a change is safe to ship. Most suites fail at this in one of two ways — they are so slow and flaky that people stop believing them, or they are so tightly bound to implementation that every refactor breaks a hundred tests while real defects walk through.
Both come from testing at the wrong level. The level is the decision that matters; everything else is craft.
Config Resolution
- Read
.msskills/config.yamlin the repo root; look uppaths.testing. - A custom document exists at that path → read its frontmatter
mode:override→ use it alone as the testing standard; ignore the defaults below.overlay(default, or nomodekey) → read defaults first, then apply the custom document's sections on top, matched by exact heading; new sections append.
- A path is configured but no file exists there → say which path is missing, then use the defaults.
- No config file or no
paths.testingkey → use defaults. .msskills/stack.mdexists → use its test framework, assertion style, container/stub tooling, and naming convention. Match the conventions of the tests already in the repository over these defaults.
Choosing the level
Test each behaviour once, at the cheapest level that can genuinely prove it.
| Level | Boundary | Real | Stubbed | Owns |
| Unit | A class or function | The code under test and its value objects | Everything with I/O | Business rules, calculations, state machines, edge cases |
| Component | One whole service | The service, its database, its HTTP and message entry points | Every other service | Wiring, serialisation, persistence, validation, error mapping, auth |
| Contract | One consumer–provider pair | The message shape | Both sides' internals | That two services agree — see contract-testing |
| Integration | One adapter and one real dependency | That adapter and that dependency | Everything else | Queries, migrations, client configuration, broker semantics |
| End-to-end | The deployed system | Everything | Nothing | A handful of critical user journeys, and nothing more |
Component tests are the highest-value level in a microservice and the most often missing. One service, real database in a container, real HTTP in and out, collaborators stubbed at the network boundary: fast enough to run on every commit, and it proves the thing actually starts and works.
Self-Validation Checklist
STOP after writing or reviewing each test. Verify every check. Fix failures before presenting.
- RIGHT LEVEL: Is this the cheapest level that can prove this behaviour? A rule covered by a unit test does not also need an end-to-end test.
- BEHAVIOUR NOT IMPLEMENTATION: Would this test survive a refactor that preserves behaviour? If it asserts on internal calls, private state, or field order → rewrite against observable outcomes.
- ONE REASON TO FAIL: Does the test have a single clear subject? Multiple unrelated assertions → split, so a failure names the defect.
- NAMED BY BEHAVIOUR: Does the name state the scenario and the expected outcome, so a failure in CI is self-explanatory without opening the file?
- AAA VISIBLE: Are arrange, act, and assert distinguishable? Assertions interleaved with actions → restructure.
- DETERMINISTIC: Does it depend on wall-clock time, real randomness, timezone, locale, ordering, network, or another test's state? → inject the clock and the ID source; sort before comparing; seed randomness.
- ISOLATED: Does it pass when run alone, in a different order, and in parallel? Shared mutable fixtures → give each test its own data.
- NO SLEEP: Does it wait on a fixed sleep? → poll with a bounded timeout on the actual condition.
- DOUBLES JUSTIFIED: Is each test double replacing something slow, non-deterministic, or external? Mocking a pure value object or the type under test → use the real thing.
- ASSERTS THE POINT: Does the assertion check what the test claims to prove — including
values, not just that a call happened?
verify(save called)does not prove the right thing was saved. - FAILURE PATHS COVERED: Are timeouts, rejections, and compensation paths tested, not just the happy path? Untested error handling is the code that runs during an incident.
- FAILS FIRST: Would this test fail if the behaviour were removed? A test that passes against a broken implementation proves nothing — check it.
All checks pass → state "Test holds: <level>, <behaviour>, deterministic."
Active Anti-Pattern Scan
Any box you can check is a defect. Fix it before presenting.
- Ice Cream Cone: mostly end-to-end tests, few unit tests → slow, flaky feedback; push coverage down to the cheapest level that proves each behaviour.
- Mockery: everything mocked including the subject's own collaborators, so the test asserts the implementation back to itself → use real objects for anything without I/O.
- Assertion-Free Test: exercises code and asserts nothing, or only that no exception was thrown → assert the outcome.
- Sleep-Based Waiting:
sleep(2000)for async work → poll the condition with a timeout. - Shared Mutable Fixture: tests that pass only in a particular order, or fail in parallel → per-test data with unique keys.
- Snapshot Everything: large auto-generated snapshots accepted without reading → assert the fields that matter.
- Coverage Theatre: tests written to raise a percentage, exercising getters → delete them; cover behaviour instead.
- Test Logic: conditionals and loops in tests, so the test itself needs testing → use parameterised cases.
- Retried Flake: a failing test wrapped in a retry annotation → find the non-determinism; a retried test is a test nobody trusts.
- Mocked Third Party at the Wrong Layer: mocking the vendor SDK rather than stubbing its HTTP → stub at the network boundary so serialisation is exercised.
- Happy Path Only: no test for timeout, rejection, duplicate delivery, or compensation.
- Slow Unit Suite: unit tests that start a container or a framework context → that is a component test; move it.
- Disabled Test:
@Ignore/skipwith no linked issue → fix or delete; a skipped test is false comfort.
Ambiguity Signals
Route these through collaborative-judgment. Each has two defensible answers.
- Unit or component. A rule reachable only through the HTTP layer can be unit tested by extracting it, or component tested where it lives. Extraction is cleaner and is also a design change.
- How many end-to-end tests. They catch integration and environment faults nothing else does, and they are the slowest and flakiest thing you own. The right number is small and non-zero.
- Test doubles for another service. A stub is fast and can drift from reality; a real instance
in a container is faithful and slow. Contract tests are how you get both, at the cost of a broker
(see
contract-testing). - Coverage targets. A number drives behaviour, and not always the behaviour you wanted. Mutation score measures the same thing more honestly and costs more to run.
- Fixtures versus builders. Shared fixtures are concise and couple tests together; per-test builders are explicit and verbose.
- Whether to test a thin adapter. Some layers are pure delegation, and a test for them asserts the framework works.
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.

