← ClaudeAtlas

test-isolation-baselisted

Guide test isolation principles — naming the regression, defaulting to hand-written stubs, and understanding that test tiers are not a ladder of quality. Use when writing or reviewing a test in any language, or when the specific decision (boundary, double type, third-party, nondeterminism) is not yet clear.
ecoma-io/touchstone · ★ 1 · AI & Automation · score 60
Install: claude install-skill ecoma-io/touchstone
# Test Isolation Principles A test earns its place by failing when the behaviour breaks. Before writing a single assertion, name the regression: "which specific change to this code must turn this test red?" If the honest answer is "nothing I can name," stop. The default test double is a hand-written stub or fake. A mocking framework earns its keep only when the interface is wide enough that writing the double by hand is real work. The tiers are not a ladder of quality. A behaviour tested at the wrong tier is worse than one tested at the right one, in both directions: an integration test standing in for a unit test buries the cause; a unit test standing in for an integration test pins a contract nobody actually holds. ## Related decisions This skill states the principles. Four peer skills own the specific decisions: - [test-boundary](../test-boundary/SKILL.md) — unit vs integration, packaging tiers - [test-double-type](../test-double-type/SKILL.md) — stub, fake, spy, mock - [test-third-party](../test-third-party/SKILL.md) — never substitute, inject boundary - [test-nondeterminism](../test-nondeterminism/SKILL.md) — clocks, random, fs, media features Per-language mechanics: [TypeScript](references/typescript.md)