TDD ला प्रभावीपणे सराव करणे Red-Green-Refactor चक्र जाणून घेण्यापेक्षा अधिक आहे — यामध्ये लहान पावले घेणे, योग्य चाचण्या लिहिणे, रिफॅक्टर चरण योग्यरित्या करणे, आणि TDD कुठे बसते याबद्दल निर्णय घेणे समाविष्ट आहे. चांगल्या प्रकारे केल्यास, हे चांगले डिজाइन आणि उच्च-गुणवत्ता, सु-चाचणी केलेले कोड प्राप्त करते.
शिस्तबद्ध चक्र
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.
