We propose a pragmatic test-driven approach to the problem of inheriting unstable legacy code, based on real-life high-stakes projects. We will cover automated and manual testing with limited resources, but also strategies to build a culture of reliability, accountability and pride within a development team.
While it would be nice to rewrite everything from a clean slate, or to have an unlimited budget to test everything from the ground up, this only happens in fairy tales. In real life, you’ll have to invest your testing effort where it counts the most. And that requires craftsmanship, creativity and respect for the code (even when it stinks). Because while legacy code is practically unavoidable, it has worth and it can be managed with the right tools and attitude.