TDD Workflow
Phase 1: Write Tests
- •Write tests based on expected input/output pairs
- •Do NOT create mock implementations for functionality that doesn't exist yet
- •Run tests and confirm they FAIL
- •Do NOT write implementation code yet
- •Commit tests:
git commit -m "test: add tests for [feature]"
Phase 2: Implement
- •Write code to pass the tests
- •Do NOT modify the tests
- •Keep iterating until all tests pass
- •Verify with independent subagents that implementation isn't overfitting to tests
Phase 3: Commit
- •Run full test suite
- •Commit:
git commit -m "feat: implement [feature]"