Documentation
README
Test-Driven Development (TDD)
From obra/superpowers
Core Principle
Write tests before implementation. Watch them fail. Write minimal code to pass.
THE IRON LAW: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
When to Apply TDD
- New features
- Bug fixes
- Refactoring
- Any behavior changes
The Red-Green-Refactor Cycle
RED: Write a Failing Test
- Write ONE minimal test demonstrating desired behavior
- Use clear, descriptive test names
- Use real code, avoid unnecessary mocks
- Test should fail for the RIGHT reason
# Verify RED
- Run the test
- Confirm it fails
- Confirm failure is NOT due to syntax errors
- Confirm you're not testing existing functionality
GREEN: Make It Pass
This is the opening of the README. Read the full README on GitHub.