test-design
Skill0 starsChanged 5 days agoMITView on GitHub
Use when writing or reviewing tests: how to STRUCTURE and NAME them, what one test should cover, and when to split versus parameterize versus use soft assertions. Covers test structure and design, not the red-green-refactor workflow.
18 other projects use a version of this.
Adopted by
Most recently taken up by
- Agenta-AI/agentatheir own version, first seen Nov 8, 2026
- LeanMeanCleanApps/CleanModelContextProtocoltheir own version, first seen Nov 8, 2026
- zxyycom/skillstheir own version, first seen Nov 8, 2026
- mblauberg/provenanttheir own version, first seen Nov 1, 2026
- fang2hou/skillstheir own version, first seen Nov 1, 2026
- umararshad4/honey-stacktheir own version, first seen Nov 1, 2026
Used with
Projects with it also use diff-review.
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.
MidnightDarlingSkilldiff-review
使用场景:按 raw.review.md 清单改完稿后,对 raw.md(OCR 原始)和 final.md(定稿)做对比。说"看我改了哪些""对比一下""diff""校对完了让我看看""我到底接受了哪些建议""我漏改了啥""改动统计""核对一下改动""闭环检查"都走这个 skill。生成段落级 HTML diff,关联 raw.review.md 的 A/B/C 标注,一目了然:接受了哪些 agent 建议、拒绝了哪些、清单外修正了哪些、agent 标过但漏改了哪些。主动触发,不必等用户说 "diff-review"。
Also in 3 projects that use this
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- Agenta-AI/agenta★ 4.9ksame name
- adamentwistle/fable-skills★ 98same name
- nahid-sparktales/agent-dispatcher★ 59same name
- shabaraba/vibing.nvim★ 13same name
- tlzmw001/aitest-kit★ 13same name
- yasunori0418/skills★ 9same name
- umararshad4/honey-stack★ 5same name
- Lixiuxiu559/AgentForge★ 4same name
- Gusen1453/creed★ 3same name
- adolfoaranaes12/BMAD-ENHANCED★ 2same name
8 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 repository108 other files it gives its agents.
- adaptive-estimationSkill
- adaptive-loop-budgetingSkill
- adopt-and-deleteSkill
- adversarial-reviewSkill
- agent-drives-uiSkill
- agentic-coding-loopSkill
- agent-otel-trajectorySkill
- agents-as-iac-modulesSkill
- ascii-ui-mockupsSkill
- authoring-html-emailSkill
- authoring-skills-vs-mcpSkill
- batched-ssh-enumerationSkill
- c4-architectureSkill
- challenge-the-premiseSkill
- codegraph-bootstrapSkill
- codegraph-worktree-startupSkill
- colocated-pod-tolerationsSkill
- command-creatorSkill
- complexity-budgetsSkill
- connector-readinessSkill
- context-anchored-patchingSkill
- continuous-issue-resolutionSkill
- credential-proxySkill
- criticality-tiered-reportingSkill
- data-connector-buildingSkill
- declarative-firstSkill
- disk-pressure-forensicsSkill
- early-return-over-elseSkill
- email-triageSkill
- enums-codify-behaviorSkill
- ephemeral-workspace-lifecycleSkill
- event-sourcingSkill
- evidence-claim-boundariesSkill
- exhaustive-matchSkill
- feature-coverage-not-just-line-coverageSkill
- full-disk-forensicsSkill
- gate-before-pushSkill
- github-pr-shepherdingSkill
- graceful-shutdown-stateful-agentsSkill
- grounded-generationSkill
- iac-incident-responseSkill
- iac-not-ad-hocSkill
- instrumented-service-scaffoldSkill
- interface-over-conditionalsSkill
- knowledge-routingSkill
- lean-on-oss-standardsSkill
- live-money-disciplineSkill
- live-state-verificationSkill
- loop-governance-and-learningSkill
- low-level-executor-task-specSkill
- map-dispatch-over-conditionalsSkill
- merge-conflict-disciplineSkill
- mermaid-diagramsSkill
- oke-arc-runners-opentofuSkill
- orchestrate-agySkill
- orchestrate-claudeSkill
- orchestrate-codexSkill
- orchestrate-geminiSkill
- otel-emit-at-willSkill
- parameter-designSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
2
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 13
Every test visibly separates Arrange → Act → Assert (Given/When/Then), by blank line or comment.
- Very specific: line 18
Use soft assertions (assertSoftly / assertAll / expect.soft) to check several properties of one result and report all failures at once — …
- Distinctive: line 35
Use separate test methods for DIFFERENT behaviors — don't cram two rules into one parameterized table.
- Distinctive: line 48
Test replay after a lost response both while the original operation is pending and after its effect has committed or completed.
“Common” is measured: kept by at least 6 in 10 of the 12 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 Design
How to design tests that localize failures and read like a spec. This complements — does not duplicate — the upstream TDD-workflow skills (red→green→refactor) and pairs with the code-style foundation: those cover when/how you drive code with tests; this covers what a good test looks like.
Principles are language-agnostic; per-language bindings are at the end.
1. Visible AAA / Given-When-Then
Every test visibly separates Arrange → Act → Assert (Given/When/Then), by blank line or comment. The three phases should be findable at a glance. A test where setup, action, and verification are tangled is a test you can't read at failure time.
2. One concept per test (NOT literally one assertion)
Each test verifies ONE behavior, so a failure localizes precisely and the test name describes exactly one thing.
- This usually means one or a few assertions — but multiple physical assertions are correct when they jointly verify ONE concept (e.g. asserting every field of one returned object = "constructed correctly" = one concept).
- Use soft assertions (
assertSoftly/assertAll/expect.soft) to check several properties of one result and report all failures at once — strictly better than splitting into N tests that each re-run the same arrange/act. - Split into separate tests only when the BEHAVIORS differ, never when the PROPERTIES of one result differ.
- Honest framing: "single concept, not literally single assert." Do not ship one-assert-per-test dogma.
3. Small, focused cases with descriptive, sentence-like names
The name is the spec. returns_404_when_run_id_is_unknown, not test3. A reader should know what broke from the failed test's name alone, without opening the body.
For a workflow or transition test, invoke the production entrypoint and its real collaborators through the boundary named by the test. Keep relevant adapters, parsers and predicates composed; fake external effects at their boundary (see [[prefer-fakes-over-mocks]]). Separate helper tests, source-text order checks and fixtures never passed to the entrypoint do not prove that composition. Choose inputs that expose a broken hand-off, and keep each test's name and conclusion within the boundary it actually exercises.
4. Parameterize data variation; separate methods for different behaviors
- Parameterize (table-driven) across DATA variation of ONE behavior — many inputs, same rule. Give each case a descriptive label so a failure names the offending case.
- Use separate test methods for DIFFERENT behaviors — don't cram two rules into one parameterized table.
5. DAMP over DRY
Optimize tests for readability-at-failure, not DRY elegance. Inline repetition in tests is fine and often better. DAMP ≠ no helpers — do use test-data builders/factories where they aid clarity — just never hide the AAA behind abstraction layers. A test you must trace through three helpers to understand is a bad test even if it's DRY.
6. Comments: name + structure carry the WHAT; comment the WHY
The test name and AAA structure tell the story. Reserve comments for the WHY — business-rule rationale, non-obvious edge cases — not a play-by-play of the WHAT. Density is language-dependent: expressive languages (e.g. Kotlin) need very few; if the code reads like English, comment only business logic / non-obvious implementation. Don't go heavy.
7. Honest cost
Single-concept tests multiply the test count → more suite time + maintenance. State the tradeoff; don't pretend it's free. Mitigate with: parameterization (one method, many cases), cheap arrange (builders, fixtures), and soft assertions (one arrange/act, many checks). The goal is precise failure localization at acceptable cost — not maximum test count.
8. Recovery across lifecycle and context changes
Test replay after a lost response both while the original operation is pending and after its effect has committed or completed. Assert recovery of the original operation identity and outcome without applying its effect again. Also leave a context with unresolved work, visit another, then return; verify that recovery remains available in its original context. Keep controls for a deliberate new operation and a foreign context, so replay safety does not collapse distinct operations or reuse another context's state.
When to use / not
- Use for designing or reviewing test structure/quality.
- Not the place for the red-green-refactor loop, or test-double strategy (fakes-vs-mocks) — see the upstream TDD skills and [[prefer-fakes-over-mocks]].
Per-language bindings
- Python (pytest): AAA with blank lines;
@pytest.mark.parametrizewithids=[...]for labels; soft checks viapytest.raises/pytest-checkor grouping asserts on one object; descriptivetest_<behavior>_when_<condition>names. - Kotlin/JVM (JUnit5 / Kotest): backtick sentence names (
`returns 404 when run id unknown`);assertAll {}(JUnit) /assertSoftly {}(Kotest) for one-concept multi-property;@ParameterizedTest+@MethodSourcewith named args; comments rare. - TypeScript (vitest/jest):
describe/it('returns 404 when ...');expect.soft(...)for multi-property one-concept;it.each([...])(table) with a label template. - Go: table-driven with
t.Run(tc.name, ...); each case named;t.Runsubtests localize failures;requirefor fatal preconditions,assertfor soft checks.
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.

