Effectief TDD oefenen gaat verder dan alleen het Red-Green-Refactor-cycle kennen — het gaat om het nemen van kleine stappen, het schrijven van de juiste tests, het refactor-stap correct uitvoeren, en oordeel toepassen over wanneer TDD past. Goed gedaan, stuurt het goed design en kwalitatief hoogwaardig, goed getest code.
De gedisciplineerde cyclus
1. RED — write ONE small failing test for the NEXT bit of behavior (run it, see it fail —
confirms the test works and the feature is missing)
2. GREEN — write the SIMPLEST code to pass (don't over-engineer; even "fake it" first)
3. REFACTOR — now improve the design (remove duplication, clean up) with tests as a safety net
→ SMALL steps; one behavior at a time; stay in short cycles.
