Curated Tech Reading Map

Find your next tech book to read

Book

Working Effectively with Legacy Code

Michael C. Feathers

Buy on Amazon* The link above is an advertisement via Amazon Associates.

Summary

Michael Feathers defines legacy code as code without tests, turning a vague complaint about inherited systems into a specific problem with a specific remedy. The difficulty he takes seriously is circular: you want tests before you change anything, but the code often cannot be tested until it is changed. The opening chapters build the tools for breaking that circle, above all the seam, a place where behavior can be substituted without editing the code there, plus ways to sense what code does and separate it from its dependencies. The bulk of the book is arranged by the question a developer arrives with, each chapter titled as the complaint itself: I cannot get this class into a test harness, I do not know what tests to write, I need to change a monster method and cannot write tests for it. A final chapter collects the dependency-breaking techniques. Examples are in Java, C++, and C#.

Target Readers

  • Developers who have inherited a codebase with no tests and need to change it without a rewrite they will never be given time for
  • Engineers stuck at the point where a class cannot be instantiated in a test at all, who need a technique rather than encouragement
  • Teams who want a shared name for the moves they make when breaking dependencies, so the work can be discussed in review

Tags

#legacy-code#refactoring#testing

Colophon

Publisher
Shoeisha
ISBN
978-4798116839
Published
Jul 2009
List price
¥4,620incl. taxMay differ from the actual selling price on Amazon

Get this book

* The link above is an advertisement via Amazon Associates.

Prerequisites

Next Books