Ag cleachtadh TDD go héifeachtach, bíonn sé thar an gCyclus Red-Green-Refactor a bheith ar eolas agat — bíonn sé i gceist céimeanna beaga a ghlacadh, na tástáil cheart a scríobh, an chéim athbhreithnithe a dhéanamh i gceart, agus breithiúnachas a chur i bhfeidhm faoi cathain a bhíonn TDD oiriúnach. Nuair a dhéantar go maith é, bíonn sé ag tiomáint dearadh maith agus cód ard-chaighdeáin, tástáilte go maith.
An timthriall disciplínithe
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.
