Design acceptance criteria tests in Claude Code
Map acceptance criteria to test types and keep their IDs in happy-path, error and boundary test names.
中文Install in Claude Code
Claude Code and a specification with numbered acceptance criteria. The example uses a cart subtotal function with no dependency on network services.
- Review `.claude/skills/test-strategy/SKILL.md` and its requirements at the pinned GitHub commit.
- Create `.claude/skills/test-strategy/` in your project and save the reviewed file as `.claude/skills/test-strategy/SKILL.md`.
- Start Claude Code from that project's root, then select `/test-strategy` in the slash menu.
Example task
The criterion requires cart subtotals in cents, nonnegative quantities, and 0 for an empty cart. Sample data follows.
AC-7: cart=[{priceCents:250,qty:2},{priceCents:700,qty:1}]; invalid={priceCents:250,qty:-1}; empty=[]What to check
Map AC-7 to unit tests. Assert `valid=1200; negativeQuantity=rejected; empty=0`. Each test name includes AC-7. Isolate the calculation from the network.
Original SKILL.md on GitHub · Updated
Frequently asked question
How can I design unit tests from an acceptance criterion and trace boundary cases?
Classify the criterion by calculation, API, or user flow. Cover valid and invalid inputs, and add a boundary case where relevant. Keep the criterion ID in the test name.