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

4.12  ·  Rating details ·  3,355 ratings  ·  179 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
Paperback, 464 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.

Community Reviews

Showing 1-30
4.12  · 
Rating details
 ·  3,355 ratings  ·  179 reviews

Sort order
Erika RS
Dec 24, 2012 rated it really liked it
Shelves: software, owned, physical
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
Feb 03, 2009 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.
Jun 27, 2012 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 18, 2010 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
Oct 15, 2018 rated it it was ok  ·  review of another edition
This has become a Legacy Book, unfortunately. The title is also misleading. It doesn't cover technical debt, evolving architecture, replacing a dead library, or other topics you might expect around the subject of long-term legacy projects. Instead, it focuses entirely on making changes safely by small steps, which comes down to adding unit tests.

Having added such tests to a legacy codebase, this is admittedly a tough task, especially to know where to begin, but most of the basics could be cover
Regis Hattori
Dec 02, 2017 rated it liked it
Shelves: programming
I think the entire book can be resumed as:

"Legacy code is a codebase without tests. While working in there, you must introduce tests before. If you cannot introduce test because it is hard and/or you have not enough time, use some techniques (listed in the book) that change the code as little as possible or use other techniques that help you write at least some tests."

I think the majority of techniques are pretty known by developers but we tend not to use them because they sometimes can worsen
Oct 04, 2018 rated it really liked it
Shelves: programming, coding
4.2/5 great techniques on how to effectively work with legacy code.

Most of my highlights and notes were from " Chapter 17: My Application Has No Structure " e.g. telling the story of the system, a technique that I'll surely use.
Vitor Cavalcanti de Albuquerque
This book is a must for anyone who wants to master software design. It teaches you many techniques and principles to help you on the task of refactoring legacy code (with tests). Even if you are writing a software from scratch, you’ll definitely get to a point where your code will become legacy and difficult to test and to deal with. So I’d definitely keep this book by my side. Besides all that, it kind of helps you see legacy and rotting code from a different perspective: it isn’t just a rottin ...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
Dec 19, 2014 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
Sep 06, 2012 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
Martin Nachev
Nov 13, 2018 rated it liked it
Recommends it for: Beginners only

Ironically, in 2018 this has become a Legacy book, with a lot of the techniques explained being outdated. Unless you're an absolute beginner that hasn't read better titles like Clean Code you won't get much out of this book.
Most of this book can be summed up as simply:
1. Do Unit Tests so you can refactor safely
2. Use your common sense (a.k.a. heuristics)
Rodion Krivoshein
Nov 07, 2017 rated it it was amazing
Read it if you want to succeed in programming.
Ulas Tuerkmen
Oct 08, 2018 rated it really liked it
The books on object-oriented programming written or edited by one of the signatories of the Agile manifesto (Robert Martin, Martin Fowler or Kent Beck, to name a few) tend to have some common characteristics. They use Smalltalk or Java as the language for the code samples, pack a lot of wisdom and interesting examples, and unfortunately tend to be long. This book, from the Robert C. Martin series, discusses cases of Java and C++ code bases that are painful to work on, and how to improve them. At ...more
Sergey Teplyakov
Oct 11, 2016 rated it really liked it
This was one of the books that “laid” on my ‘virtual’ to-read shelf for a long time. I’ve heard a lot about this book but never have time to get my own opinion.

So finally I’ve read it and I have good part and not so good part of it.

Good part is that the book is really good. Michael is trying to give reasonable plan for everyone who is working with legacy code (i.e. for all of us): with specific patterns that help to break dependencies, untangle the mess and a testing suite and start working on t
Feb 09, 2017 rated it it was amazing
This was a perfect book, written by a person that's been involved in a lot of legacy projects. I found some useful tips and approaches in it. Sadly most of the patterns are either java or c++ related.
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
Junsong Li
Nov 01, 2015 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.
Mar 30, 2016 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!
Feb 11, 2015 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!
Lakshmi Prashanth
An apt one for my teams doing code maintenance.
Mark Campbell
Oct 22, 2014 rated it it was amazing
great book
Oct 15, 2017 rated it really liked it
Shelves: computer, non-fiction
A solid book about how to handle existing projects that need help being put under testing. I will use a handful of the techniques countless times as they make up the backbone of refactoring code and putting it to test. Not all the methods are as useful unfortunately. Some due to the specific circumstances they should be used in, reliance on the programming language having a compiler, or dependence on language-specific features found in languages like C++. If you are unfamiliar with refactoring a ...more
Jan 09, 2018 rated it it was amazing
Amazing book! Since almost all working code in the world is Legacy Code, working effectively with legacy code is a valuable skill to have as a software engineer/ architect.
Besides getting decades of information of a dedicated expert, this book is also incredibly motivating.
You'll get the tools to make legacy code a little bit better with every single change you make to it.
Instead of just 'making it work' - with every change - you can also make a legacy code base more understandable for colleag
Otavio Valadares
This book is famous and I think when it was written, it made a lot more sense than nowadays. In most parts, the book treats legacy code only as the project that doesn't have tests and spend a lot of time telling you how to make changes in small steps and write tests, unfortunately nowadays many developers deals every day with legacy code that have tests and face other kinds of problems like, libs versions, architecture, technical debts, refactoring and much more (The book talks about some proble ...more
Pavel Shchegolevatykh
It's probably a great book for coding experts, but I'm not the target audience. It felt dated and overly complicated for 2017. I understood no more than 20%, but those things were quite useful. In general I would prefer to get more info in the matter searching through the random Internet blogposts. I didn't not expect this book to be all about writing Unit Tests with overly complicated examples. Forced myself to read up until the end. It got me thinking whether I really should read all the "clas ...more
James Taylor
Aug 13, 2017 rated it liked it
Shelves: own
This book is about refactoring to get your code base under test. Some of the ideas are straightforward enough to understand without reading the examples, but sometimes his choice of examples aren't the best. First of all, he switches languages between C# and C. These are totally different languages and if you only know one of them, it means comparing his various techniques is much harder than it should be. Additionally, it would have been better if he chose one application as an example, rather ...more
Jan 17, 2018 rated it really liked it
Excelente catálogo de técnicas de refactor. Imprescindible para alguien que tenga que pelear con aplicaciones "legacy".
Hay que tener en cuenta que las técnicas de refactor de este libro están enfocadas a conseguir cobertura de tests en una aplicación que no cuenta con ellos, para después seguir añadiendo funcionalidades e incluso corregir bugs.
Me han resultado un poco difíciles de seguir los ejemplos en C y C++ ya que no he leído mucho código en estos lenguajes, aunque en general los ejemplos so
May 07, 2017 rated it it was ok
If you've read Refactoring and Clean Code, you probably don't need to read this one. If you want good code, you need tests so that you can refactor safely. The book deals mostly with getting procedural code into shape using classes, mocks, and dependency injection. Some of the advice is no longer good, such as creating interface classes so you can create fake classes. I didn't get much out of it trying to deal with a hairy python codebase.
Rory Armstrong
Aug 29, 2017 rated it really liked it
A collection of tips and tricks to bring a system into a testable state. They do not guarantee that it will be pretty afterwards however. The code samples are in C++ and Java which are frequent throughout the relavtively short chapters.
I only give it four starts however as it kind of treats unit testing as a panacea without really explaining how to do it requiring you to read up on how to unit test yourself, but the seams and sprout class strategies are vital.
« previous 1 3 4 5 6 7 8 9 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
  • Refactoring: Improving the Design of Existing Code
  • xUnit Test Patterns: Refactoring Test Code
  • Agile Software Development, Principles, Patterns, and Practices
  • Test Driven Development: By Example
  • Domain-Driven Design: Tackling Complexity in the Heart of Software
  • Seven Languages in Seven Weeks
  • Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions
  • Software Estimation: Demystifying the Black Art
  • Implementing Lean Software Development: From Concept to Cash
  • The Art of Unit Testing: With Examples in .NET
  • Practices of an Agile Developer: Working in the Real World
  • The Productive Programmer
  • Beautiful Code: Leading Programmers Explain How They Think
  • Release It!: Design and Deploy Production-Ready Software (Pragmatic Programmers)
  • Design Patterns in Ruby
  • The Passionate Programmer

Goodreads is hiring!

If you like books and love to build cool products, we may be looking for you.
Learn more »
“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.” 19 likes
“Programming is the art of doing one thing at a time” 15 likes
More quotes…