Praticare il TDD efficacemente va oltre la conoscenza del ciclo Red-Green-Refactor — implica fare piccoli passi, scrivere i test giusti, eseguire correttamente il passo di refactoring, e applicare giudizio su quando il TDD è appropriato. Fatto bene, guida a un buon design e a codice di alta qualità, ben testato.
Il ciclo disciplinato
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.
