What problem does it solve?
Test-driven development prevents shipping unverified or regression-prone changes by forcing every behavior change to start from a failing test that proves the code meets the intended requirements.
Core Features & Use Cases
- Iron Law enforcement: NO production code without a failing test first, including the rule to delete and restart if you write code before the failing test.
- Red-Green-Refactor discipline: Watch the test fail, implement minimal code to pass, then refactor while keeping tests green, with explicit verification steps for RED and GREEN.
- Test quality guardrails: Good Tests and Red Flags guidance that stops common rationalizations (like “tests after”) and avoids vague, coupled, or mock-only assertions.
Use case example: When fixing a bug where “empty email is accepted,” write a failing test that asserts the expected error, implement the smallest validation change to make the test pass, then refactor without changing behavior while re-running the full suite.
Quick Start
Ask your human partner or AI to guide you to write a single minimal failing test for the next behavior you want, then implement only enough code to make that test pass before refactoring.