Legacy code (பெரும்பாலும் test செய்யப்படாத, மாற்ற கடினமான code) test செய்வது சவாலான விஷயம் — இதில் பிணைந்த dependencies இருக்கலாம் மற்றும் tests இல்லாமல் இருக்கலாம். Tests சுरक்ষிதமாக சேர்ப்பதில் characterization tests, dependencies உடைக்க seams, மற்றும் படிப்படியான மேம்பாடு போன்ற நுட்பங்கள் உள்ளன, இவை சுरक்ষிதமான மாற்றங்களை செய்ய உதவுகின்றன.
Legacy code-ன் சவாலு
Legacy code is often: untested, tightly coupled, hard to understand, risky to change:
→ no tests → changing it is dangerous (you can't tell if you broke something)
→ hard to test → dependencies are tangled (can't isolate units); not designed for testing
→ a chicken-and-egg problem: to change safely you need tests, but it's hard to test.
