Buy new:
-40% $39.20$39.20
FREE delivery Tuesday, August 27
Ships from: Goodvibes Books Sold by: Goodvibes Books
Save with Used - Good
$29.85$29.85
Ships from: Amazon Sold by: NovelIdeaBookStore
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the author
OK
Working Effectively with Legacy Code 1st Edition
Purchase options and add-ons
This book provides programmers with the ability to cost effectively handlecommon legacy code problems without having to go through the hugelyexpensive task of rewriting all existing code. It describes a series of practicalstrategies that developers can employ to bring their existing softwareapplications under control. The author provides useful guidance about how touse these strategies when refactoring or making functional changes to codebases. One of the book's key points is that it teaches developers to write teststhat can be used to make sure they are not unintentionally changing theapplication as they optimize it. Examples are provided in Java, C++, and Csharp,and the book assumes that the reader has some knowledge of UMLnotation. Strategies using UML and code in C++ and Java primarily whilelanguage independent advice will be delivered in side bars and appendices forlanguage specific users.
- ISBN-100131177052
- ISBN-13978-0131177055
- Edition1st
- Publication dateSeptember 22, 2004
- LanguageEnglish
- Dimensions7 x 1.2 x 9.25 inches
- Print length464 pages
Frequently bought together

More items to explore
From the brand
From the Publisher
Must-Read for Every Programmer and Developer
This classic, endorsed by Robert "Uncle Bob" Martin (author of Clean Code), is on many must-read lists for programmers and developers including lists featured on Guru99, DZone, Built In, Dev Community (dev.to), and more.
"The book is important, as almost every developer at some point in career, has to work with a legacy system and it still represents the most challenging problems for many companies. The book goes deep into understanding the general process of a software change like adding features, fixing bugs, optimizing performances, etc."
—Milan Milanovic, DZone, November 2021
Editorial Reviews
From the Back Cover
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, Michael Feathers offers start-to-finish strategies for working more effectively with large, untested legacy code bases. This book draws on material Michael created for his renowned Object Mentor seminars: techniques Michael has used in mentoring to help hundreds of developers, technical managers, and testers bring their legacy systems under control.
The topics covered include
- Understanding the mechanics of software change: adding features, fixing bugs, improving design, optimizing performance
- Getting legacy code into a test harness
- Writing tests that protect you against introducing new problems
- Techniques that can be used with any language or platform―with examples in Java, C++, C, and C#
- Accurately identifying where code changes need to be made
- Coping with legacy systems that aren't object-oriented
- Handling applications that don't seem to have any structure
This book also includes a catalog of twenty-four dependency-breaking techniques that help you work with program elements in isolation and make safer changes.
© Copyright Pearson Education. All rights reserved.
About the Author
MICHAEL C. FEATHERS works for Object Mentor, Inc., one of the world's top providers of mentoring, skill development, knowledge transfer, and leadership services in software development. He currently provides worldwide training and mentoring in Test-Driven Development (TDD), Refactoring, OO Design, Java, C#, C++, and Extreme Programming (XP). Michael is the original author of CppUnit, a C++ port of the JUnit testing framework, and FitCpp, a C++ port of the FIT integrated-testing framework. A member of ACM and IEEE, he has chaired CodeFest at three OOPSLA conferences.
© Copyright Pearson Education. All rights reserved.
Product details
- Publisher : Pearson; 1st edition (September 22, 2004)
- Language : English
- Paperback : 464 pages
- ISBN-10 : 0131177052
- ISBN-13 : 978-0131177055
- Item Weight : 1.65 pounds
- Dimensions : 7 x 1.2 x 9.25 inches
- Best Sellers Rank: #34,445 in Books (See Top 100 in Books)
- #3 in Software Design & Engineering
- #7 in Software Testing
- #23 in Software Development (Books)
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read author blogs and more
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonCustomers say
Customers find the book's technical accuracy to be practical and timeless. They also appreciate the tests and say it's a great book for making code better incrementally. Opinions are mixed on readability, with some finding it clear and easy to read, while others find it hard to read and overly technical. Readers also disagree on the code, with others finding it well designed and awesome, while still others say the way ideas are organized is crazy.
AI-generated from the text of customer reviews
Customers find the book offers a practical approach to making code base better incrementally. They say it provides excellent examples and easily described techniques for dependency breaking. Readers also mention that it provides a map to slowly add tests. They appreciate the author's modeling of mindset, choices, and techniques. Overall, they say the book helps them work with legacy code and instill a type of culture.
"...your perceptions about testing on their head, Feathers also provides good advice on how to create loosely coupled code, how to identify and..." Read more
"...Why is that useful? First, it is an effective way of documenting what a system actually does, particularly if --- as with most legacy code --- there..." Read more
"Refactorings in last chapter are heart of book. Much timeless advice here. The primary concept is that code without automated tests is legacy code...." Read more
"This was one of those famous, timeless books (like Code Complete) that I had heard many people talk about, and I finally read it...." Read more
Customers have mixed opinions about the readability of the book. Some find it clear and easy to read, while others find it hard to read and dull. They also say the book is not expert-level material and is overly technical.
"...Feathers' style is easy to read. As you would expect there is lots of example code here, and it is folded naturally into the explanatory text...." Read more
"...It is quite readable and accessible, and doesn't overwhelm. I found a lot of valuable techniques in here that I have not found anywhere else...." Read more
"...The book, for all its wisdom within, is not particularly engaging to read and the examples are just. plain. awful...." Read more
"...Some of it seems really simple, but the way Feathers articulates it is pretty amazing...." Read more
Customers have mixed opinions about the code in the book. Some find it well designed and awesome, while others say the way ideas are organized is crazy.
"...of the techniques in this book immediately and found that coding was higher quality and more enjoyable...." Read more
"...But, the way ideas are organized is completely crazy.For..." Read more
"One of the best books about design, testing, pragmatism, and overall programming. I wish I had come across it sooner...." Read more
"Really shows you how to get from nasty code to well designed and awesome code...." Read more
Reviews with images
-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Is your code a tangled mess? Are you tired of seeing telescoping methods and methods that are 100s of lines long? Want to clean up code you didn't write and get it under test but everyone's too afraid of breaking things? Does it take you forever to write unit tests? Is it painstaking and laborious? Do you write mainly integration tests because unit testing is too hard? Do you wonder how people can write lots of unit tests, let alone unit test every method? Do you want to kick your object oriented coding skills up a notch? Then this book is for you. It can teach you how to overcome all of those obstacles and so much more.
For me the first roughly 100 pages of the book were a revelation. If you don't understand how to do TDD the problem probably isn't testing, it's probably the code you're trying to test or your perceptions about what it is that you are actually supposed to be testing. Michael Feathers does a great job identifying the mistakes and traps that so many developers experience when trying write and test good code and provides recipes for overcoming them. He adds clarity to what a unit test is and what it's supposed to do and in the process takes a deep dive into what good object oriented code looks like through the eyes of TDD. The book can completely change your perception about what is and is not possible.
In addition to turning your perceptions about testing on their head, Feathers also provides good advice on how to create loosely coupled code, how to identify and eliminate dependencies in existing code as well as strategies for reorganizing poorly structured code into better objects. This book has clearly changed the way I code and the way I think about testing for the better. It's not just about testing it's also about turning procedural code into object oriented code and bringing your object oriented thinking to the next level.
I can't say enough great things about this book. It's dearer to me than any other book in my programming collection including books about object oriented code from Bloch, Beck, Fowler and others. It wasn't until I read Working Effectively with Legacy Code that things really came together for me in the object oriented world. I got the concepts individually but failed to recognize how it all comes together. What's so great about encapsulation / getters and setter? Why is it so important to have classes and methods that do just one thing? What's so important about breaking dependencies between classes? How small is a small method? How can I ever hope to achieve open/closed? How is TDD even possible? Your mileage may vary, but if you're like me this book will change your life for the better.
This is not a theoretical work. For example, Feathers does not present a grand ontology of legacy systems. Not is this book heavy on methodology. Instead Feathers describes techniques --- lots of techniques, roughly 50 --- for working with legacy code.
The techniques are organized by the problems they address. For example, one chapter is entitled "My Application Is All API Calls" and then presents two techniques for working with existing code that is full of calls to APIs.
Feathers comes from the XP school, and he adopts that school's premise that you can safely change code if (and only if) there are sufficient tests in place to tell you when your new change has introduced a bug. Many of the techniques in this book are about different ways of putting legacy code into test harnesses, and doing that safely without introducing bugs along the way.
He also introduces new concepts, or at least concepts I had never seen before. For example, a "characterization test" is a test that characterizes the actual behavior of the code, not what the code is supposed to do, but what it actually does. Why is that useful? First, it is an effective way of documenting what a system actually does, particularly if --- as with most legacy code --- there is no other documentation. And it can tell you when you have changed that existing behavior.
Feathers' style is easy to read. As you would expect there is lots of example code here, and it is folded naturally into the explanatory text. My only gripe with the book is with the examples: they are largely in Java, C++, or C. I would have liked some examples in older legacy-only languages, like COBOL.
But overall, this book is simply supurb, a tour de force of an important topic that has received little coverage before.















