Documentation
README
Test-Driven Development (TDD)
When to use
- Starting implementation of new feature
- Starting implementation of bugfix
- Writing new production code
Skip when
- Reviewing/modifying existing tests
- Exploratory/spike work โ TDD is for known requirements, not exploration.
Write the test first. Watch it fail. Write minimal code to pass.
Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.
The Iron Law
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
RED โ GREEN โ REFACTOR
RED: Write Failing Test
Write one minimal test showing what should happen. Name describes behavior. Tests real code (not mocks unless unavoidable).
Time limit: <5 minutes. Complex setup = design too complex.
This is the opening of the README. Read the full README on GitHub.