name: tdd-workflow description: Test-Driven Development workflow principles. RED-GREEN-REFACTOR cycle. category: security version: 4.1.0-fractal layer: master-skill
TDD Workflow
Write tests first, code second.
1. The TDD Cycle
๐ด RED โ Write failing test
โ
๐ข GREEN โ Write minimal code to pass
โ
๐ต REFACTOR โ Improve code quality
โ
Repeat...
2. The Three Laws of TDD
- Write production code only to make a failing test pass
- Write only enough test to demonstrate failure
- Write only enough code to make the test pass