
Refactoring
Martin Fowler
Like Feathers, Fowler treats changing existing code as a disciplined, step-by-step craft. It gives a catalogue of small, behaviour-preserving moves to improve a design without breaking what already works.
Reader-supported: when you buy through links on our site, we may earn an affiliate commission. Learn more
We earn a commission if you buy through these links. Learn more
Find Similar BooksGuide by the Books of the Day editors · Updated · How we write our guides
Feathers gives developers a practical, step-by-step way to get untested code under test so it can be changed without fear, backed by a useful catalog of dependency-breaking techniques.
2 creators reviewed Working Effectively with Legacy Code on YouTube in 2024, with 9.8K views between them. Their opinions are their own; we picked these reviews, we didn't write them.
Working Effectively with Legacy Code is a working manual for developers who have inherited code that is hard to change safely. Feathers defines legacy code pragmatically as code without tests, which shifts the problem away from age or style and toward the missing safety net. The central message is that you rarely can change untested code safely without first finding a way to test it, and most of the book covers how to get there when the code was never designed for testing.
The approach is practical and incremental. It walks through the mechanics of making a change, finding places where behavior can be altered without editing the code at that spot, writing characterization tests that record what the code actually does, and then making edits with confidence. Examples appear in Java, C++, C, and C#, but the reasoning carries over to other languages. Later sections tackle the messy cases: procedural systems, code with no obvious structure, and large classes tangled with global state.
Reading it feels like sitting with an experienced mentor who has seen many failing codebases. It is dense in places and works best as a set of recipes you return to while working, rather than a book to read once. You will likely finish with a different instinct: before touching anything, ask how you would know if you had broken it.
Feathers' definition is about feedback rather than age. If you cannot quickly tell whether a change broke something, the code is legacy in his sense, even if it was written last year. This reframing makes the missing tests the core problem and gives you a concrete target: restore the ability to verify behavior before you attempt larger changes or redesigns.
When specifications are missing or out of date, you write tests that capture current behavior, even when that behavior looks wrong. The point is not to certify correctness but to create a baseline so unintended changes show up. These tests give you a way to explore unfamiliar code safely and to decide later which behaviors deserve to be fixed.
A seam is a place where you can alter what gets executed without modifying the code at that point. Recognizing seams lets you substitute collaborators, stub out slow or external pieces, and isolate a unit for testing. Much of the book's practical value comes from learning to spot seams and to create them when none exist.
The book includes a catalog of twenty-four techniques for loosening the ties between program elements. Each is a small, mechanical step meant to preserve behavior, such as extracting an interface, overriding a call in a subclass, or sprouting new code instead of editing tangled methods. The catalog is most useful as a reference you consult when a specific class refuses to be tested.
Not every legacy system is object-oriented, and some have no visible architecture at all. The later material addresses procedural code, large files of loosely related functions, and applications where it is hard to know where a change belongs. The emphasis is on finding a sensible change point first, then building just enough test coverage around it.
The examples are in Java, C++, C, and C#, and some tactics reflect early-2000s tooling and language styles, so you will need to translate them to your own stack. The book focuses heavily on unit-level isolation and can feel narrow if your problems are mostly about integration, databases, or distributed services. Its definition of legacy code as untested code is useful but contested, and some readers find the dependency-breaking catalog repetitive or dense on a first pass. It says little about organizational politics, estimating, or persuading a team to fund cleanup.
Book details and cover from Google Books.
Ready to read Working Effectively with Legacy Code?
Get your copy on Amazon, or listen to it on Audible. We earn a commission if you buy through these links.

Martin Fowler
Like Feathers, Fowler treats changing existing code as a disciplined, step-by-step craft. It gives a catalogue of small, behaviour-preserving moves to improve a design without breaking what already works.

Steve McConnell
A thorough, practical guide to writing and revising code that is easier to understand and change. Its detailed advice on routines, classes and defensive habits suits readers who want to improve the code they maintain.

John K. Ousterhout
Short and opinionated, it focuses on managing complexity, a theme central to legacy code work. Readers who valued Feathers's attention to what makes code hard to change will find similar reasoning here.

Kent Beck
The classic introduction to writing tests first and letting them guide design. It shows the red-green-refactor rhythm that Feathers relies on when bringing old code under a test harness.