(From the bookWorkingEffectively with Legacy Code)
To me,legacy codeis simplycode without tests. I’ve gotten some grief for this definition. Whatdo tests have to do with whether code is bad? To me, the answer is straightforward, and it is apoint that I elaborate throughout the book:
Code without tests is bad code. It doesn’t matter how well written it is; it doesn’tmatter how pretty or object-oriented or well-encapsulated it is. With tests, we can change thebehavior of our code quickly and verifiably. Without them, we really don’t know if our code isgetting better or worse.
