Legacy Code

Domain: Refactoring

🎯 Motivation

Legacy code is code without tests, often old and feared. Understanding strategies to work with it safely is crucial because most real-world development happens in existing codebases.

📋 Concrete Example

A 15-year-old billing module with no tests and one developer who understands it is legacy code. You add “characterization tests” capturing current behavior before changing anything.

🔗 Analogy

An old house with wiring no one fully understands is legacy. You do not demolish it blindly; you map the circuits first, then renovate room by room with care.