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

(Robert C. Martin Series)

4.14  ·  Rating details ·  4,147 ratings  ·  238 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 Pearson
More Details... Edit Details

Friend Reviews

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

Community Reviews

Showing 1-30
Average rating 4.14  · 
Rating details
 ·  4,147 ratings  ·  238 reviews

More filters
Sort order
Start your review of Working Effectively with Legacy Code
Erika RS
Dec 24, 2012 rated it really liked it
Shelves: owned, software, 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
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
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
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.
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
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
Michael Koltsov
Dec 14, 2020 rated it liked it
The world of software moves with such a pace that this book written in 2004 looks like a relict from the distant past. However, it's still capable enough to teach the old dog new tricks.

These days most of the software is written with a great help from IDEs that have become much more than just text editors. Every IDE gives you hints on how to optimize your code, most have static analysis tools built-in and most code can be verified even before it gets compiled/interpreted.

Although, most IDE have
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
Oct 04, 2018 rated it really liked it
Shelves: coding, programming
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.
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
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
Jul 19, 2020 rated it it was amazing
Fantastic book. A must-read book since most of the software we'll end up working with would be Legacy Code.

Legacy code is successful software, software that survived. But Legacy code it's, often, bad code. Bad code, the author argues, and I agree, it's code without tests. It's bad because it hinders the evolution of software to adapt to new requirements while still delivering its current value.

Techniques presented in this book such as Characterisation Tests, Effect Sketches and Feature Sketches
Isidro López
Despite the years elapsed since it was written, and the high expectations... it didn't disappoint me at all :-)

I already knew some techniques thanks to Sandro Mancuso screencasts. I got lots of useful reminders, new learnings and reflections and some new techniques.

It's also nice to see techniques for different languages/paradigms. This book is a great complement to the Refactoring one, I can only highly recommend it! :-)
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
Harish R
Mar 10, 2019 rated it it was amazing
This book definitely improves your programming skills. The talk about unit testing and it's benefits is good. More often than not we work in projects or on software that's old. Not every development is Greenfield. In such cases we wonder how to implement our newly learnt unit test skills. That's where this book sits and tells you exactly what to do. Don't read this book as a fresher. Gain some experience, fight some legacy code, invent some techniques of your own. Then come here and you would ap ...more
Martin Nachev
Nov 13, 2018 rated it liked it
Recommends it for: Beginners only
Shelves: programming

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)
Emad Elsaid
Feb 23, 2018 rated it really liked it
it's a good book, examples are mostly statically typed languages which is not so helpful in the case you're a ruby developer.
but it's good for setting the mentality and perspective for you no matter what language you're using.
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
João Paiva
Jun 12, 2020 rated it it was ok
Shelves: not-home
Found the book quite outdated. I live the definition that legacy code is code without tests, and the book includes several interesting techniques (even some I'd never used). Having said that, the book is mostly about adding unit tests to code single threaded programs written in statically typed languages. Further, IDEs today can automated most of the techniques described in the book. In conclusion, I mostly I missed techniques around handling dynamically typed languages and thread-safety issues. ...more
Nov 10, 2019 rated it really liked it
Yes, some of the sections were outdated, but still this book offers a really good glimpse on how to handle work with legacy code. Basically it is just a set of ways helping to cover codebase with tests (breaking dependencies, extracting methods and so on). Really enjoyed it, can give you a feeling that you are not alone if you are working with some legacy code.
Jan 06, 2021 rated it it was amazing
100% recommend this book for devs working on Java-like projects.This book goes deep in lots of different strategies to put complex classes into what the author calls a test harness.Some of the techniques presented can be replaced with mocks, and some examples in C++ are irrelevant for me atm. However the experience shared by the author is invaluable.It has also interesting ways to approach & understand complex software.
Rodion Krivoshein
Nov 07, 2017 rated it it was amazing
Read it if you want to succeed in programming.
Dmytro Chasovskyi
Jan 22, 2021 rated it it was amazing
Shelves: technical
Great book! With a list of practical suggestions. Sometimes during reading, I had to stop and jump to my code as some improvement ideas came from the book.
Yehia Abo el-nga
May 16, 2019 rated it it was amazing
This author has a very hands-on writing style. If he is explaining a problem, he is far from high level abstractions. He dives deep into details of the problem with detailed examples; And shows a very thorough thought process. The idea I liked the most was effect graphs. I could solidly say that I learned something after reading this book.
Max Wolffe
Aug 05, 2019 rated it really liked it
Shelves: favorite-cs
This book was originally written in 2004 and published in 2005. Given that, it is a remarkably relevant text, with some real gems to help one approach refactoring a large “legacy” code base.

I particularly appreciated the definition of legacy code - as code which is not under test - the rest of the book gives one a toolset for putting that code under test, after which any refactoring is trivial.

That said - there are a few aspects which will not be for everyone.

1. It is dated - refactoring and t
Mar 21, 2019 rated it it was amazing
A fantastic reference book. Dozens upon dozens of specific, concrete solutions to specific real-world problems that software engineers tend to run into when dealing with legacy code. Highly recommended.
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. ...more
Trevor Bramble
Jan 24, 2013 rated it liked it
Great stuff, but because it's all in Java, the tactical material is very difficult to use or even connect with for non-Java programmers. And of course, this is almost completely a book about tactical code changes under the larger strategy of bringing a system under test.

(If the book were "Working Effectively with Legacy Java Code" it would deserve a higher rating from me because it would have been my fault for picking up a Java book.)
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.
« previous 1 3 4 5 6 7 8 next »
There are no discussion topics on this book yet. Be the first to start one »

Readers also enjoyed

  • Refactoring: Improving the Design of Existing Code
  • Clean Code: A Handbook of Agile Software Craftsmanship
  • Domain-Driven Design: Tackling Complexity in the Heart of Software
  • Design Patterns: Elements of Reusable Object-Oriented Software
  • The Clean Coder: A Code of Conduct for Professional Programmers
  • Head First Design Patterns
  • Test-Driven Development: By Example
  • The Pragmatic Programmer: From Journeyman to Master
  • Clean Architecture
  • Code Complete
  • Release It!: Design and Deploy Production-Ready Software (Pragmatic Programmers)
  • Introduction to Algorithms
  • Effective Java
  • Building Microservices: Designing Fine-Grained Systems
  • Patterns of Enterprise Application Architecture
  • Growing Object-Oriented Software, Guided by Tests
  • The Mythical Man-Month: Essays on Software Engineering
  • Designing Data-Intensive Applications
See similar books…

Goodreads is hiring!

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

Other books in the series

Robert C. Martin Series (1 - 10 of 15 books)
  • Fit for Developing Software: Framework for Integrated Tests
  • Agile Java: Crafting Code with Test-Driven Development
  • Managing Agile Projects
  • Agile Estimating and Planning
  • UML for Java Programmers
  • Agile Principles, Patterns, and Practices in C#
  • Clean Code: A Handbook of Agile Software Craftsmanship
  • The Clean Coder: A Code of Conduct for Professional Programmers
  • Java Application Architecture: Modularity Patterns with Examples Using OSGi (Software Patterns Series)
  • The Software Craftsman: Professionalism, Pragmatism, Pride

News & Interviews

  Mary Roach is a science author who specializes in the bizarre and offbeat. With a body of work ranging from deep-dives on the history of...
39 likes · 5 comments
“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.” 24 likes
“Programming is the art of doing one thing at a time” 17 likes
More quotes…