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.14  ·  Rating Details  ·  1,937 Ratings  ·  104 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.
The Pragmatic Programmer by Andrew HuntThe C Programming Language by Brian W. KernighanDesign Patterns by Erich GammaClean Code by Robert C. MartinCode Complete by Steve McConnell
Essential Programming Books
13th out of 123 books — 326 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 27 books — 77 voters


More lists with this book...

Community Reviews

(showing 1-30 of 3,000)
filter  |  sort: default (?)  |  Rating Details
Erika RS
Dec 24, 2012 Erika RS rated it really liked it
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
Avdi
Feb 03, 2009 Avdi rated it it was amazing
Shelves: development
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.
Marshall
Jul 09, 2012 Marshall rated it really liked it
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
Ash Moran
Jan 29, 2010 Ash Moran rated it it was amazing
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
Matt Diephouse
Dec 19, 2014 Matt Diephouse rated it liked it
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
Mark
Dec 29, 2012 Mark rated it it was amazing
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
Lehaleha
Mar 30, 2016 Lehaleha rated it it was amazing
Frighteningly a lot from the book is applicable to the shiny new code I write/read. Ideas and techniques are very thoroughly explained and illustrated (which is a bit boring sometimes). Also there are a lot of interesting thoughts, ideas and metaphors - distilled years of author's experience. Good book!
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
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
Jan 30, 2015 Adam Parkin rated it liked it
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
Junsong Li
Apr 26, 2016 Junsong Li rated it really liked it
Shelves: cs
I agree with most of methods discussed in the book.

I think it sometimes makes things worse to add abstract layer on classes and functions in order to have unit test. But without unit test, legacy code will never be improved. Maintaining and evolving in legacy code is a truly hard problem, which I am dealing with everyday.

I also think we probably should just let legacy code die anyway.

This book can be used as a reference book.
Dominic
Feb 28, 2016 Dominic rated it it was amazing
This book is excellent. It doesn't deal with "green field programming" but the case of having to live with existing code. Feathers' simple definition of legacy code is "code which is not under test." This gives you a specific goal to aim for in refactoring--from which, by the way, other good practices such as SOLID will arise. But you are not meant to attempt a refactoring to "perfect" code all at once. Feathers emphasizes making safe, atomic changes bit by bit that slowly improve the code while ...more
Wangyiran
Oct 08, 2015 Wangyiran rated it it was amazing
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
Jan 05, 2015 Irwan rated it really liked it
Shelves: finished, it, 2015
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
Mar 02, 2014 Miêu Tặc rated it liked it
Shelves: technology
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
Hovhannes Gulyan
Feb 21, 2016 Hovhannes Gulyan rated it it was amazing
I find this book useful and simple, a must read for every developer even you don't find yourself working with legacy code on daily bases.

"Working Effectively with Legacy Code" is not only about "old" technologies and inherited projects that you should maintain. It's about refactoring approaches. It's about development principles and technics that are useful for development. It's actually about thinking about testing upfront.

Any code after you wrote it can be considered as legacy code and after a
...more
Mark Campbell
Dec 05, 2014 Mark Campbell rated it it was amazing
great book
Jean Tessier
Aug 06, 2015 Jean Tessier rated it really liked it
Shelves: software
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š
Feb 23, 2014 Luboš rated it it was ok
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
Oct 30, 2010 Steven Grimm rated it really liked it
Shelves: technical
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
Aug 15, 2013 Tom Panning rated it it was amazing
Shelves: quality
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
Jul 14, 2013 Nephi rated it it was amazing
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
Nov 22, 2011 Pascal Mestdach rated it it was amazing
Shelves: craftmanship
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
Radim
Feb 21, 2016 Radim rated it really liked it
Pretty good book. It helps people to be less afraid of legacy code and provides a lot of tips how to deal with it. Primarily it is focused on testing and refactoring. It explains tradeoffs and motivations why to apply its suggestions.

Unfortunately the content is currently outdated. We have much better tools than what we had ten years ago. This includes better testing frameworks, IDEs and various way how to set up context for our applications.
Karol Stosiek
Apr 22, 2012 Karol Stosiek rated it liked it
This review has been hidden because it contains spoilers. To view it, click here.
gargamelscat
Jul 24, 2015 gargamelscat rated it it was amazing
Shelves: compsci, 2011, 2015
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 it was amazing
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
Ronald Dragstra
Feb 09, 2016 Ronald Dragstra rated it really liked it
Excellent book on unit testing, legacy code and dependency driven development. Design by interface, not by implementation. Also handy techniques along the way, and how to put large pieces of legacy code into a test harness.

The book contains a lot of practices and reading material, so be prepared to stick a while to it. It's probably worth reading it twice in that perspective.
Steve
Oct 15, 2012 Steve rated it really liked it
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
« 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
  • Growing Object-Oriented Software, Guided by Tests
  • Test Driven Development: By Example
  • Domain-Driven Design: Tackling Complexity in the Heart of Software
  • Refactoring: Improving the Design of Existing Code
  • Agile Software Development, Principles, Patterns, and Practices
  • Xunit Test Patterns: Refactoring Test Code
  • Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions
  • Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation
  • Release It!: Design and Deploy Production-Ready Software (Pragmatic Programmers)
  • The Art of Unit Testing: With Examples in .NET
  • Software Estimation: Demystifying the Black Art
  • Implementing Lean Software Development: From Concept to Cash
  • The Passionate Programmer
  • The Productive Programmer
  • Seven Languages in Seven Weeks
  • Pragmatic Thinking and Learning: Refactor Your Wetware
  • Practices of an Agile Developer: Working in the Real World

Goodreads is hiring!

If you like books and love to build cool products, we may be looking for you.
Learn more »

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…