Working Effectively with Legacy Code 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
- List Price: $64.99
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.
Frequently bought together
From the Publisher
|Best agile practices of cleaning code “on the fly” Software Craftsmanship||Endure and succeed amidst swirling uncertainty and nonstop pressure||Direct, no-nonsense answers to key architecture and design questions||There are no shortcuts for Agile’s true benefits: You need to do Agile right.||Deliver robust, effective code and to be proud of all the software you write|
|Title||Clean Code||Clean Coder||Clean Architecture||Clean Agile||Clean Craftsmanship|
|Core Concept||Presents a revolutionary paradigm that will instill within you the values of a software craftsman and make you a better programmer—but only if you work at it.||Robert C. Martin introduces the disciplines, techniques, tools, and practices of true software craftsmanship. This book is packed with practical advice–about everything from estimating and coding to refactoring and testing.||Uncle Bob presents the universal rules of software architecture that will help you dramatically improve developer productivity throughout the life of any software system.||Uncle Bob describes what Agile is in no uncertain terms, stripping away misunderstandings and distractions that have made it harder to use than was originally intended, and how Agile can help you bring true professionalism to software development.||Provides a pragmatic, technical, and prescriptive guide to the foundational disciplines of software craftsmanship and a discussion of the standard and ethics developers and programmers should be following.|
|Endoresement||"It is the best pragmatic application of Lean principles to software I have ever seen in print." —James O. Coplien, Founder of the Pasteur Organizational Patterns project||“Some technical books inspire and teach; some delight and amuse. Rarely does a technical book do all four of these things.”—George Bullock Senior Program Manager Microsoft Corp.||"A good architecture comes from understanding it more as a journey than as a destination, more as an ongoing process of enquiry than as a frozen artifact." -- Kevlin Henney||“What is in the world of Agile development is nothing compared to what could be. This book is Bob’s perspective on what to focus on to get to that ‘what could be.’ And he’s been there, so it’s worth listening.” –Kent Beck||". . . [A] timely and humble reminder of the ever-increasing complexity of our programmatic world and how we owe it to the legacy of humankind--and to ourselves--to practice ethical development.” -- Stacia Heimgartner Viscardi, CST & Agile Mentor|
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.
- Publisher : Pearson; 1st edition (September 22, 2004)
- Language : English
- Paperback : 464 pages
- ISBN-10 : 0131177052
- ISBN-13 : 978-0131177055
- Item Weight : 1.63 pounds
- Dimensions : 7 x 1.2 x 9.25 inches
- Best Sellers Rank: #56,537 in Books (See Top 100 in Books)
- Customer Reviews:
Reviews with images
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
The only flaw in this book is: It doesn't go far enough. I've now been working for 1+yr with a 20+yr old C++ code base (that's still responsible for over $1B revenue a year, runs on over 1500 servers, handles well over 100000 requests/min in total). I read this book in the first couple of weeks and thought "yeah, ok, but things can't possibly be that bad".
Well, now I know better. They're worse.
This book can help you _a lot_ with the technical aspects of working with legacy code - but some things (esp. long-standing company processes) just can't be fixed by mortal man. So you need a good attitude (including a good sense of humor) as well. Working with good colleagues also helps. But definitely read this book and use its lessons in practice.
“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.”
This book goes on to inform you exactly how you can refactor that code, get those tests in place, and move forward knowing you have established some standard of quality and a metric for change. You'll sleep so much better once you get there, but be warned: it won't happen overnight.
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.
Of course, tests are very important and you have to write tests when you implement features, refactor code or even accidentally found some code without tests. I absolutely agree with the author regarding this one.
But there one thing I was thinking all the time while reading this book - why I should do all those things the way it proposed in this book? Why I should create subclass or change the build so some classes will be replaced with test-classes?
As an example, in Java, we have plenty of testing frameworks and they will do such things for us - they allow us to mock classes(even class, we do not even need to create an interface for it), override methods, inject private fields and more. Those frameworks are easy to use and easy to configure for any project. I believe for other languages we have some frameworks too.
To sum up - there are several useful bits of advice in this book, but overall - it's about writing our own xUnit framework.
If you want to know how to refactor code better and improve its readability and maintainability - this book won't help you a lot.
There are two main points in this book:
1. Legacy code is anything without unit tests.
2. Step one of working with legacy code is to write unit tests.
There is more than that, but my point in sharing this is that the author clearly knows the right approach. It is still a good read even if the book is old. However, this is not expert-level material: if you already have experience in this area, this book might teach you a trick or two but you should already know most of what is in here.