“Michael Feathers defines legacy code as “Code without tests”. Based on that definition, do you work on legacy code? Probably almost every programmer gets confronted with parts of code not covered by Unit Tests. Do you want better techniques to work with code that doesn’t have tests?
If you take up the challenge of reading and applying this book, you’ll learn several specific techniques that you can employ to take this code, make the absolute minimum number of modifications to get the code testable. Then you’ll feel safer applying your usual refactoring techniques or doing the changes you need to make.
Example titles in this book are “This class is Too Big and I don't want it to get any bigger”, or “I need to change a monster method and I can't write tests for it”. Who hasn't encountered these problems? In these and other chapters, Michael practices several dependency breaking techniques.
Other chapters show how to write tests that help you understand the current behavior. Other chapters include handy techniques for understanding code, such as Telling a Story, Effect Sketching, Scratch Refactoring and Telling a Story.
I use this book when I inherit a set of code that just doesn’t have any tests, and I have to make changes to it. If you find yourself staring at blocks uncomprehensible code, you should do the same.”
Pascal M wrote this review Friday, February 6 2009.
(
reply |
permalink )