



Working Effectively with Legacy Code (Robert C. Martin Series) [Feathers, Michael] on desertcart.com. *FREE* shipping on qualifying offers. Working Effectively with Legacy Code (Robert C. Martin Series) Review: Simply supurb, a tour de force - The vast majority of software texts are about greenfield development: creating a new application from nothing at all. But the vast majority of software work involves existing code: adding features, finding bugs, or refactoring code that someone else wrote. This book is a supurb first step in fixing that imbalance. 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. Review: Practical, Realistic, and focuses on what can be done now - The book is one of the rare books I've read that has an ideal vision for programming and design that also starts with a realistic view of the true day-to-day of a some developers: stumbling through old code written to changing demands and fix bugs, needing assurance that one's changes don't break existing functionality without laborious and time-consuming investigation and ad hoc testing. Michael Feathers does a great job of modelling his mindset, choices, and techniques through short example case studies. Nothing is presented as dogma, and many cases are followed to see the effects of different techniques to solve the same problem. Many of the techniques to get code into a testable form are just best practice or are similar to a Design Pattern, but a key strength of this book is making getting from here to there within reach. Clients and superiors want code that works, and the testing and incremental approach that Michael advocates provides the net for safely and confidently making the transition to less tightly-coupled, more modular, understandable, and verified code from the time-tested battle-worn code many of us call home. Even better, Michael's approach destroys the "design vs just maintenance" dichotomy, as it satisfies that little voice to start making improvements we've been putting off when we get our code in testable form. I hope my department picks this up, and that we all start leaving the code a little better than we found it.



















| Best Sellers Rank | #70,918 in Books ( See Top 100 in Books ) #9 in Software Testing #13 in Software Design & Engineering #58 in Software Development (Books) |
| Customer Reviews | 4.5 4.5 out of 5 stars (721) |
| Dimensions | 7 x 0.95 x 9.2 inches |
| Edition | 1st |
| ISBN-10 | 0131177052 |
| ISBN-13 | 978-0131177055 |
| Item Weight | 1.65 pounds |
| Language | English |
| Part of series | Robert C. Martin Series |
| Print length | 464 pages |
| Publication date | September 22, 2004 |
| Publisher | Pearson |
D**D
Simply supurb, a tour de force
The vast majority of software texts are about greenfield development: creating a new application from nothing at all. But the vast majority of software work involves existing code: adding features, finding bugs, or refactoring code that someone else wrote. This book is a supurb first step in fixing that imbalance. 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.
C**V
Practical, Realistic, and focuses on what can be done now
The book is one of the rare books I've read that has an ideal vision for programming and design that also starts with a realistic view of the true day-to-day of a some developers: stumbling through old code written to changing demands and fix bugs, needing assurance that one's changes don't break existing functionality without laborious and time-consuming investigation and ad hoc testing. Michael Feathers does a great job of modelling his mindset, choices, and techniques through short example case studies. Nothing is presented as dogma, and many cases are followed to see the effects of different techniques to solve the same problem. Many of the techniques to get code into a testable form are just best practice or are similar to a Design Pattern, but a key strength of this book is making getting from here to there within reach. Clients and superiors want code that works, and the testing and incremental approach that Michael advocates provides the net for safely and confidently making the transition to less tightly-coupled, more modular, understandable, and verified code from the time-tested battle-worn code many of us call home. Even better, Michael's approach destroys the "design vs just maintenance" dichotomy, as it satisfies that little voice to start making improvements we've been putting off when we get our code in testable form. I hope my department picks this up, and that we all start leaving the code a little better than we found it.
M**W
It's ok, all should read at least once
My perspective is as a mid-thirties adult male who went straight from college to a job I'm still at 11+ years later, working on a large, sprawling, legacy software suite with almost no unit test coverage. Our software is the culmination of 40+ devs and contractors who came and went over the product's 20+ year lifespan. There was never an architect. There was never much oversight, pretty much pick whatever stack you wanted to build a certain feature as long as the resulting UI was vaguely consistent. Half of our application is served by legacy Java and half is ASP .NET, and most of the time navigating the software you can't tell from the UI which codebases served your page (or what parts of your page). It is hundreds of thousands of lines of tangled legacy code which all sorts of different database access strategies and UI frameworks depending on who wanted to experiment with what at the time they were there making a new feature. Having not known anything other than this one project for my entire career, and not having a college or professional work culture that ever pushed testing on us (until now), it was kind of eerie to read through this book and find seemingly endless examples of the issues and challenges that obstruct my normal work every single day. I feel like I understand better now why some people are adamant about testing, it would have made a huge difference in what it's like to work on this legacy project of ours today, if it had been a priority way back when. It is also evident to me however after reading the book that testing is not like some magic bullet, either, and just sprinkling some tests around doesn't fix problems like the ones I face. The author comes off a bit over-excited about how unit tests could change your life (paraphrasing), and he is right, but you have to put in the actual work. I would describe it like getting hooked by one of those old Bowflex TV commercials and so you get the workout equipment and then realize "wow, I am going to have to do a lot of work to get the results I want", and then this book is at least trying to be your workout guide on what muscle groups you should be exercising and roughly how to do it. Pretty useful but you still have to put it all together yourself into a routine that is right for you/your team/your project, and then actually do the work, continuously. Reading this book and then not applying the advice within will get you about the same results as reading a book about workouts and exercise for a healthy body and then continuing to not exercise and eating fast food for lunch every day. I think in my case after working in real-life examples of whats in this book for over a decade very little of it surprised me in any way, but it was helpful to see these things spelled out with their cause and effect, ideas for solutions, how to at least avoid making the problem worse, etc. I understand now why some people we would hire as new developers to the project would get all sad and disappointed when they asked about tests and we told them we really don't have any. I literally never knew any better and wasn't convinced until I read this book. So I would say that all devs/engineers should read this book at least once, there is value in it for sure. On the downside, prepare yourself for a difficult and dull slog. The book, for all its wisdom within, is not particularly engaging to read and the examples are just. plain. awful. Truthfully even if I had read this book 10+ years ago when I was getting started, I'm not sure the examples would have spoke to me (because they are terrible), which might have made it less convincing. But it was the case that at the time I read this I had been working and playing with live examples for a decade-plus as I said before so all the examples he described were perfectly apparent to me in my own project's code. His examples stink. I think it would help newer developers if there was a digital copy that you could provide some parameters and get examples in only a language that is familiar to you. That and also re-write all the examples to not stink somehow. I don't know, the examples are hyper-realistic in the sense that "yeah, I have definitely seen people write garbage like this all the time," but the things he is trying to demonstrate in these examples don't have to be made more realistic by using awful naming, spacing, lack of comments, etc. Just my personal opinion. It is a difficult book to force yourself to keep reading through, in my opinion, but you definitely should and you will most likely be glad you did.
M**.
Llegó en excelentes condiciones. Y muy rápido también 😁
P**I
Grande libro, devo ancora finire di leggerlo ma è molto utile. Consigliatissimo a tutte le persone che sviluppano, non solo a chi lavora con codice legacy. Lo consiglio soprattutto a chi scrive molto codice affiché non lasci in eredità ad altri altro pessimo codice legacy....
R**R
The book arrived with "Printed in the United States of America" in the front, and "Manufactured by Amazon.com.au in Sydney" at the back. On my copy, the cover is misprinted, and the contents of the book include printing and typesetting issues which are not present in the genuine article, such as page titles being half cut off. This book is not a genuine copy of the book, it is a locally printed book which is of severely less quality than the genuine book.
H**H
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 appreciate the book.
E**L
レガシーコードの定義ですが以下のようになります。 ーーー レガシーコード = テストできない、していない、設計に問題があるようなコード ーーー つまり、どんなに最近に構築されたとしても上記の定義にあてはまるものはレガシーコードです。 本書は、このレガシーコードを どうやって修正、機能追加を行っていくのか どうやって既存の設計を改善していくのか ということが記述されています。 java, c++, c が対象となっています。(javaの扱いが一番多いです) 本書の目次をちょっとみてみると、レガシーコードで悩んでいる方は 興味を持たずにはいられません。以下は目次を一部抜粋しました。 ○My Project is not object oriented. How do I make safe changes? ○I need to change a Monster Method and I can't write test for it. 保守担当以外の方でもレガシーコードに対する解決策を学ぶことで、新規開発の際に自分がレガシーコードを書かかずに済みますので、将来的な勉強にもなります。 実際に、設計が悪いシステムの保守をしています。 しかし。この本のおかげでやる気になり良いシステムにどうしたら変えていけるのか?ということを実践できるようになりました。設計の勉強にもなっています 作者の頑張れという気持ちが伝わってくる大変な良書です。 設計が悪いシステムの保守に悩んでいたら本書を手にとってみてください。 きっとシステムを改善していけるようになるでしょう。
Trustpilot
1 month ago
2 days ago