Goodreads helps you keep track of books you want to read.
Start by marking “Working Effectively with Legacy Code” as Want to Read:
Working Effectively with Legacy Code
Enlarge cover
Rate this book
Clear rating
Open Preview

Working Effectively with Legacy Code

by
4.15 of 5 stars 4.15  ·  rating details  ·  1,559 ratings  ·  87 reviews
Get more out of your legacy systems, more performance, functionality, reliability, and manageability.Is your code easy to change? Can you get nearly instantaneous feedback when you do change it? Do you understand it? If the answer to any of these questions is no, you have legacy code, and it is draining time and money away from your development efforts.

In this book, Michae
...more
Paperback, 456 pages
Published September 1st 2004 by Prentice Hall
more details... edit details

Friend Reviews

To see what your friends thought of this book, please sign up.

Reader Q&A

To ask other readers questions about Working Effectively with Legacy Code, please sign up.

Be the first to ask a question about Working Effectively with Legacy Code

The Pragmatic Programmer by Andrew HuntThe C Programming Language by Brian W. KernighanDesign Patterns by Erich GammaStructure and Interpretation of Computer Programs by Harold AbelsonCode Complete by Steve McConnell
Essential Programming Books
12th out of 116 books — 288 voters
The Pragmatic Programmer by Andrew HuntClean Code by Robert C. MartinCode Complete by Steve McConnellRefactoring by Martin FowlerWorking Effectively with Legacy Code by Michael C. Feathers
Software Craftsmanship
5th out of 20 books — 69 voters


More lists with this book...

Community Reviews

(showing 1-30 of 3,000)
filter  |  sort: default (?)  |  rating details
Erika RS
We wise programmers know that code should be written to minimize dependencies, inject those that are necessary, use interfaces, be tested from the start, etc. etc., and we always write our new code like that (right?), but our good habits and wisdom don’t matter when working with legacy code. You don’t have the option of going back in time and smacking some sense into the original author (who may have been your younger, more foolish self).

Given that we have to deal with legacy code, how can it be
...more
Marshall
This book should be considered a required companion book to Martin Fowler's Refactoring. Refactoring is about slowly and progressively turning ugly code into well-designed code. I'd read Refactoring, and tried its techniques, but I just couldn't figure out how to make it work for my purposes. I knew refactoring was based on having a robust suite of regression tests. Let's face it, most ugly code lacks such a suite of tests. If you want to refactor something and you don't have a test, you need to ...more
Avdi
This is without question one of the essential books on my software development bookshelf. The dirty secret of software is that 80% or more if it is hacking your way through thick tangles of legacy code. This book is your survival guide in that jungle.
Ash Moran
I've heard this called "genius" and it is. Legacy code is defined as untested code. Changing it involves various strategies to safely and incrementally get tests in place. The "seam" model of thinking, where you identify points you can influence behaviour without changing the code, is extremely powerful. Feathers gives several types of seam, and many techniques for exploiting them.

The main value of Working Effectively with Legacy Code is low risk ways to deal with untested code. There's a large
...more
Mark
This was the most helpful testing book I've ever read. Most books assume that you'll be starting with a greenfield project and can stay on the straight-and-narrow path of TDD all the way to glory: as most devs know, you're usually coming to a project that sorta-kinda-works-in-production and usually has inadequate or no automated testing. This is terrifying: you know change needs to happen, but you have no certainty about how to make it.

Feathers lays out a taxonomy of strategies for grappling wit
...more
Mahmood Hanif
For me, the 'big idea' of this book was the view that legacy code is any code without sufficient unit tests. That makes complete sense to me and is a great way to look at software development. So, the idea gets 5 stars ... The book overall is a bit 'meh'. It's not really something to read from cover to cover although there are valuable insights scattered throughout the book. I think it's a good book to have in your library and reference when you run into a situation that needs these techniques. ...more
Matt Diephouse
The tl;dr is that (1) tests make it easier to change and improve code, and (2) it can make sense to “worsen” the code as an intermediate step so you can test and improve the code.

Noting that “Testing in isolation is an important part of the definition of a unit test”, Feathers gives a long list of ways to break dependencies for testing:

- Using macros to redefine methods during compilation
- Substituting in a different behavior for a dependency at link time
- Passing in objects instead of creating
...more
Rudolf O.
this book is a must-have for all software developers. in our industry it is far more likely that you'll inherit code that you will need to add new features too while also fixing any bugs that are found.

without this book you'll throw up your hands in frustration and dive into bug fixing before adding any new features. this is a death sentence for any consulting contract.

with this book you'll be able to make progress and once you get over the initial hump, you'll find yourself enjoying the challen
...more
Adam Parkin
WEWLC is a foray into examining some of the different challenges in working with large legacy codebases. Overall the book is quite good, easy to read, but I found it rather repetitive. By in large it's a discussion of the evils of code dependencies with some discussion of techniques to approach removing those dependencies.

It consists of some "themes" in the first few chapters, and the remainder of the book is a collection of patterns to pull out when presented with a particular problem ("extract
...more
Wangyiran
the book only tell me one thing:how to address the dependencies program,it contains many code,let you understand clearly to how to write decouple code,how to add test on the legacy code,it help me shape the code thought,real good book!
Irwan
This book contains lots and lots of technique to work with problems with legacy code. I learn that legacy does not have to be old, it can be a badly written and untested code base.

Testability is accepted as a sign of a good design. For that matter, this book presents also some techniques to makes your class or method testable, legacy (old) or not.

Some of the situations and problems presented in this book gave me "aha!" moments. I have seen those problems, I have done some of those techniques (
...more
Miêu Tặc
Every developer should read this book regardless you are working with legacy code. Because if you are, strategies in the book can save your life :). Otherwise, you can ease the life of others when writing your code since one day it becomes legacy to them.

But don't spend much time on techniques because they are outdated nowadays. For instance: you can easily test legacy code with mocking framework, even private methods without setting your hair on fire for refactoring.

There is one thing I don't t
...more
Jean Tessier
Lots of very practical advice on how to take already existing code and bring it under test. The author offers many techniques for minimal code transformations that allow you to write tests against the code. Once the tests are in place, you are in a better position to launch larger refactorings. While the transformations work better on objet-oriented code, many apply just as well to procedural code.

The introduction to test-driven development is very nice. The example feels genuine, not just a con
...more
Luboš
I do not know whether the book is attractive any more. Many technique such "extract methods" are done by IDE, does not need step-by-step manual. Difficult to read on kindle. Almost a half of code is in C, in which I am not fluent.

I guess I expected some silver bullet for legacy code, and, of course, did not get it.

====Quotes====
I felt soon became tempered by the realization that software systems almost always degrade into a mess. What starts as a clean crystalline design in the minds of the prog
...more
Steven Grimm
I've found this book helpful in framing my thinking about testing a large code base.

It bears some similarity to "Design Patterns," both in its structure and in that for an experienced developer it's light on the "I never knew I could do that," and heavy on the, "I've made that kind of change before but until now hadn't thought of it as a distinct concept that could be reasoned about in isolation."

So for me, the value was less in teaching me new techniques and more in giving me a better way to or
...more
Tom Panning
I've read this twice now. The first time was while working on a large embedded C++ project, and the second time was while working on a large Grails & JavaScript web app. There are very few books that have a heavy amount of code snippets and can be relevant to both projects, but this is one of them. Reading this book, it is obvious that the author has worked with teams to get a variety of real systems into test harnesses.
Some of his advice is fairly obvious, and you might see it in general un
...more
David Workman
This is a must read for any person involved in development on a legacy system.

The book is quite a dense collection of interwoven refactoring patterns and techniques for improving the quality of legacy code. As the author quite clearly states at the start that he considers legacy code to be 'code without tests', most of these are actually techniques for getting untested code into automated test harnesses to allow future development to proceed with that safety net in place.

Some of the techniques a
...more
Nephi
I have already put much of this books recommendations into practice. The tools provided within have enabled me to overcome some of the most challenging hurdles presented at work. I greatly appreciate the structure of the book as I was able to use it well before I finished reading it (I am not sure it was intended to be read cover to cover).

The tactics appear to be rather universal. The examples are in C, C++, C#, and Java with a little Ruby, but I have applied them to legacy ActionScript 3 code
...more
Pascal Mestdach
Michael Feathers defines legacy code as “Code without tests”. Based on that definition, do you work on legacy code? Probably almost every programmer gets confronted with parts of code not covered by Unit Tests. Do you want better techniques to work with code that doesn’t have tests?

If you take up the challenge of reading and applying this book, you’ll learn several specific techniques that you can employ to take this code, make the absolute minimum number of modifications to get the code testabl
...more
Karol Stosiek
This review has been hidden because it contains spoilers. To view it, click here.
gargamelscat
Anyone working with a legacy code base (no or few unit tests) has found themselves hamstrung by the thought of making changes: priority one is not breaking stuff. However necessary, this defensive protective mindset is frustrating and creatively stifling.
Well this book is salvation. The key takeaway - making the code look temporarily worse is OK as it will eventually converge on good with repeated passes - is so important because in most shops there is never enough time to spend getting it right
...more
Scott Maclellan
Apr 11, 2015 Scott Maclellan rated it 5 of 5 stars
Recommends it for: Any Software Developer
If you maintain old code bases that don't have the tests they need then you need to read this book.

This was my second time reading the book after several more years as a software developer. Even now I feel like I learned many new things and reinforced good practices. What surprised me this time through were the many design elements and general programming recommendations, like the Single Responsibility Principle, sprinkled throughout the text.

It has been over ten years since the book first came
...more
Steve
This book is a must read for any developer. It does not even tell you how to deal with legacy code, it also tell you how to avoid such things in the first place.

The book itself reads a little dry and I am sure I will not remember all the names of the different techniques described in it. But I think this is normal due to the dry stuff which the book is about. The author uses mainly Java or C/C++ examples, even as C# developer they are simple to understand.

When reading the book I got a moment wh
...more
Todd
This is the book that got me back to thinking seriously about improving the way I write software. I read it because I saw the title at a point in time when I was working with a lot of legacy code and feeling the pain. For me, this was the book that had me constantly nodding along and feeling like the author must have actually been someone on my project team in disguise. Maybe it doesn't read the same if you're not in the trench trying to dig out when you read it. (But, secretly, I think we're al ...more
Seth Gholson
Fantastic book! I feel like I can conquer the world with the tools Michael outlines. He does a great job to improve my understanding of both what my code should look like and how to (gradually) get it there. It's been an enlightening read for me.
Nicklas
Overall, very practical and to the point with many examples and scenarios one may/will encountered as a programmer. That said, very focused on compiled languages and discussing issues that are perhaps not as relevant for someone programming in dynamic languages (read: Ruby, Python, JS etc.).

If you worked at least a few years on legacy systems you probably already figured out most of them, but nevertheless you can find some useful techniques in it. If you're a beginner I still recommend it becaus
...more
Stefan
I just re-read this great Michael's book after few years of working solely on a quite legacy code base.
I must admit that I still won't be able to list most of techniques applied here, all related to getting legacy code under unit tests.
However, most of refactoring techniques are more obvious to me today that after the first read.

Hence the conclusion that Michael's 'Working Effectively with Legacy Code' isn't for a junior / novice coder, but for someone who already hit enough walls to feel the pa
...more
Matt
Developers with any significant amount of experience in working with legacy systems will often mention Feathers' book. It is the playbook for introducing tests into a legacy system.
Alasdair Craig
Fairly good, nothing ground-breaking in it, but worth reading. If refactoring is important to you, then you'll find this book very familiar.
« previous 1 3 4 5 6 7 8 9 99 100 next »
There are no discussion topics on this book yet. Be the first to start one »
  • Refactoring to Patterns
  • Refactoring: Improving the Design of Existing Code
  • Test Driven Development: By Example
  • Growing Object-Oriented Software, Guided by Tests
  • Agile Software Development, Principles, Patterns, and Practices
  • Domain-Driven Design: Tackling Complexity in the Heart of Software
  • Xunit Test Patterns: Refactoring Test Code
  • Release It!: Design and Deploy Production-Ready Software (Pragmatic Programmers)
  • Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation
  • The Art of Unit Testing: With Examples in .NET
  • Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions
  • The Passionate Programmer
  • Seven Languages in Seven Weeks
  • The Productive Programmer
  • Practices of an Agile Developer: Working in the Real World
  • Software Estimation: Demystifying the Black Art
  • Agile Estimating and Planning
  • Pragmatic Thinking and Learning: Refactor Your Wetware

Goodreads is hiring!

If you like books and love to build cool products, we may be looking for you.
Learn more »
Brutal Refactoring: More Working Effectively with Legacy Code Beautiful Code: Leading Programmers Explain How They Think Working Effectively with Unit Tests Clean Code: A Handbook of Agile Software Craftsmanship

Share This Book

“Code without tests is bad code. It doesn't matter how well written it is; it doesn't matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don't know if our code is getting better or worse.” 12 likes
“Programming is the art of doing one thing at a time” 8 likes
More quotes…