Book Profile
Working Effectively with Legacy Code
Michael C. Feathers · 2004
A battle-tested field guide for software developers who must safely change, test, and improve code they didn't write and can barely understand.
Get the book →Working Effectively with Legacy Code by Michael C. Feathers is the definitive handbook for every developer who has inherited a codebase that is tangled, untested, and terrifying to change. Feathers redefines legacy code as simply 'code without tests,' then delivers a comprehensive, language-agnostic toolkit for breaking the vicious cycle: you need tests to change code safely, but you have to change code to get tests in place. Through dozens of real-world scenarios organized as FAQs—'I can't get this class into a test harness,' 'I need to change a monster method,' 'my application has no structure'—he teaches developers how to identify seams (places where behavior can be altered without editing that place), break dependencies just enough to get code under test, write characterization tests that pin down existing behavior, and then refactor with confidence. The book covers Java, C++, C, and C# with concrete dependency-breaking techniques such as Extract Interface, Parameterize Constructor, Subclass and Override Method, and more than two dozen others, all designed to be performed safely without a full test suite already in place. Whether you are facing a 10,000-line monster method, a singleton-riddled codebase, or a system that takes forever to build, this book gives you the courage, the concepts, and the concrete steps to move forward.
What it argues
A causal model describing how structural properties of a codebase and developer practices drive dependency breakability, testability, and behavioral safety during software change in legacy systems.