Praticar TDD efetivamente vai além de conhecer o ciclo Red-Green-Refactor — envolve dar pequenos passos, escrever os testes certos, fazer o passo de refatoração corretamente, e aplicar julgamento sobre quando TDD é apropriado. Feito bem, isso impulsiona um bom design e código de alta qualidade e bem testado.
O ciclo disciplinado
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.
