26 of 27 people found the following review helpful
practical and helpful advice on testing,
By A Customer
This review is from: Working Effectively with Legacy Code (Robert C. Martin) (Paperback)
This book focuses on how best to treat existing, large and probably poorly designed code, when needing to add features. This is most likely to happen when you have big old code that needs maintaining, but a lot of the advice is directly applicable to open source projects that lack tests and documentation. Therefore this can be considered as a valuable addition to the literature on testing and refactoring.
The advocated approach is rooted in writing unit tests and refactoring. Each chapter is themed around a problem (e.g. "Dependencies on Libraries is Killing Me", "I Don't Understand the Code Well Enough to Change It"), and then a series of techniques are suggested. At the back of the book are a series of refactorings, specifically for dealing with large classes, with some platform specific approaches, such as C++ forbidding the use of virtual functions that resolve to subclasses in constructors.
The code is mainly in Java, with a large number of examples in C++, and a handful in C and C#. You can probably get by with just knowing Java.
To get the most out of this book, I would suggest having read Martin Fowler's Refactoring first. It would also help to be familiar with the JUnit Java testing framework, which is used for the testing examples throughout. If you don't already know JUnit, you can pick up enough knowledge from the many articles on the web, and you certainly don't need to have read a book on Test Driven Development.
A reasonable measure of the quality of a book such as this is if it changes the way you code. It did so for me, and I recommend this as another high quality book in the Robert C. Martin series.