BLOCKING GATE: Feature or bug to implement.
- Write test FIRST - name:
test_<component>_<scenario>_<expected> - Run test - verify it FAILS with expected error
- If test passes immediately → delete and rewrite (it proves nothing)
EXIT CRITERIA: Test fails for the right reason.
Phase 2: GREEN - Minimal Implementation
BLOCKING GATE: Failing test from Phase 1.
- Write simplest code to pass current test only
- No extra features, no premature optimization
- Run test - verify PASSES
EXIT CRITERIA: Test passes. Nothing more.
Phase 3: REFACTOR - Clean Up
BLOCKING GATE: Passing test from Phase 2.
- Improve code quality while keeping tests green
- Run tests after each change
- If refactoring breaks tests → revert immediately
EXIT CRITERIA: Code clean, all tests green.
Test Quality Checklist
Every test MUST have:
- At least one assertion with descriptive failure message
- Descriptive name:
test_<component>_<scenario>_<expected> - Independent setup - no test order dependency
- Deterministic - no random data, real timestamps, network calls
Test behavior, not implementation:
- ✅ Public interfaces, observable outcomes
- ❌ Private methods, internal state
Warning Signs
Methodology failing when:
- Writing code before tests
- Tests passing immediately (no RED phase)
- tdd-guard frequently disabled
- Large commits mixing tests and implementation
Recovery: Delete implementation → Write failing test → Verify fails → Minimal code → Commit together
Converted and distributed by TomeVault — claim your Tome and manage your conversions.