A TDD hatékony gyakorlása túlmegy a Red-Green-Refactor ciklus ismeretén — kis lépések megtétele, a helyes tesztek írása, a refactoring lépés megfelelő végrehajtása, valamint a megítélés szükséges ahhoz, hogy mikor alkalmazható a TDD. Jól alkalmazva, ez jó tervezéshez és magas minőségű, jól tesztelt kódhoz vezet.
A fegyelmezett ciklus
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.
