Legacy code is valuable code that we’re afraid to change. Surviving legacy code feels more like craft than it does like engineering: we face difficult tradeoffs; we have to make decisions with little (or no!) information; and it forces us to invest time, energy, and money with a forecast of benefits that most people would consider a fantasy. The big strategies are important and easy to understand, but when we start actually doing the work of changing legacy code, we can become distracted by hundreds of little choices. Rather than discuss the big strategies, I’d like to share some microtechniques that help me make those little choices in order to survive working in legacy code.
J. B. (Joe) Rainsberger is one of the "second wave" of TDD practitioners: he learned directly from the pioneers of the field. His book, JUnit Recipes, was the standard for over a decade for Java programmers who wanted to do what we today call developer testing or programmer testing. He has taught thousands of programmers around the world to bring high discipline to their work for well over a decade.
Not "just a programmer", J. B. has taught people how to manage the never-ending onslaught of work, figure out how to adopt new working practices chaos-free, understand and even grow to respect their most annoying co-workers, find the time and energy to improve as though finding loose change in the couch cushions, turn their dreary day job into a Dream Job–even how he enjoyed his first retirement from age 34 to 40! Software, life. Agile, not Agile. He's up for anything.