Starší kód (často netestovaný, těžko měnitelný kód) je náročný na testování — může mít zapletené závislosti a žádné testy. Bezpečné přidávání testů zahrnuje techniky jako charakterizační testy, seams pro přerušení závislostí a postupné zlepšování, což umožňuje bezpečnější změny.
Výzva staršího kódu
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.
