Test-Driven Development (TDD) என்பது கோட்டுக்கு முன் டெஸ্ட்டுகளை எழுதும் செயல்முறை — ஒரு குறுகிய, மீண்டும் நிகழும் சுழற்சியைப் பின்பற்றுகிறது: ஒரு தோல்வியடைந்த டெஸ்ட்டை எழுதவும், அதை கடக்க கோடு எழுதவும், பின்னர் மறுசீரமைக்கவும். இது டெஸ்ட்டுகள் மூலம் வடிவமைப்பை இயக்குகிறது மற்றும் கோடு பরীட்சனை செய்யக்கூடியது மற்றும் நன்கு பরீட்சைக்குள்ளாகி உள்ளது என்பதை உறுதிசெய்கிறது.
TDD சுழற்சி: Red, Green, Refactor
1. RED → write a FAILING test for the behavior you want (it fails — the code doesn't exist yet)
2. GREEN → write the MINIMUM code to make the test PASS (just enough, don't over-build)
3. REFACTOR → improve/clean up the code (and tests) while keeping tests GREEN
→ Repeat this short cycle for each small piece of behavior.
