test-first
Drive meaningful behaviour changes with the smallest useful failing test.
- License 许可
- MIT
- 最近更新
- 2026-08-08
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- test-first
- description
- Drive meaningful behaviour changes with the smallest useful failing test.
03 SKILL.md 正文
Test-first Workflow
behaviour -> smallest failing test -> minimal implementation
-> test passes -> refactor if useful -> increase fidelity for remaining risk
Ask:
- What behaviour are we proving?
- What is the cheapest test that can fail for the right reason?
- Which integration semantics remain untested?
- Is a real dependency cheap enough to use?
- What added fidelity buys real confidence?
Do not force theatre when work is exploratory or test cost exceeds learning.
Structure: Arrange-Act-Assert
Every test has three visible parts, in order:
- Arrange — build the starting state from a real fixture: a setup/teardown method, a fixture function, or a factory. Never reuse another test's shared mutable state (a module-level object, a leftover database row, a file another test wrote) — that is what makes tests order-dependent and flaky.
- Act — exercise exactly one behaviour.
- Assert — check the specific outcome the test names, not incidental side effects.
A test whose arrange step is copy-pasted setup with no isolation, or that silently depends on a previous test having run first, is not arranged — it is coupled.
FIRST
| Property | Means | |
|---|---|---|
| F | Fast | runs in the feedback loop a developer actually uses, not just CI |
| I | Independent | no ordering dependency, no shared fixture state between tests |
| R | Repeatable | deterministic — no unseeded randomness, wall clock or live network |
| S | Self-validating | pass/fail is programmatic; no reading log output to decide |
| T | Timely | written with the behaviour it guards, not backfilled long after |
A suite that only passes in file order, or that needs a human to eyeball output, has failed FIRST even if every assertion is individually correct.
04 同仓库更多 Skills
agentic-template
Start or continue work in this repository using the canonical AGENTS.md contract and repository skill catalog.
wiki-tidy
Reconcile the wiki against the knowledge graph, specs and code; prune stale, keep links resolving.
update-handoff
Update HANDOFF.toon with current semantic work state.
test-change
Select and run tests that prove a change at suitable fidelity.
specify
Create proportional OpenSpec-shaped structured change proposals for meaningful changes.
review-loop
Bounded clean-up review for boy-scout, code and architectural smells and inappropriate coupling.