Working Effectively with Legacy Code product image

Working Effectively with Legacy Code

(5/5)
Review by Joshua Morris on
View on Amazon

Review

Working Effectively with Legacy Code is the book I read when I inherited a codebase that had no tests and couldn't be changed safely. Feathers' techniques—sprouting methods, characterization tests, dependency breaking—gave me a systematic approach to adding tests to untested code. The chapter on dependency breaking showed me how to extract dependencies so I could test code in isolation, and the section on characterization tests helped me understand what legacy code actually does before I tried to change it. The book is practical: every technique includes code examples showing the before and after, and Feathers explains when each technique works and when it doesn't. My only critique is that some examples are Java-focused, but the principles apply to any language. I've used this book to add tests to three different legacy systems, and each time it gave me the confidence to make changes without breaking things. Essential reading for anyone working with code they didn't write.

✓ Pros

  • Systematic approach to adding tests to untested code
  • Practical techniques: sprouting methods, characterization tests, dependency breaking
  • Clear before/after examples showing when each technique works
  • Gives confidence to make changes to legacy code without breaking it

✗ Cons

  • Java-focused examples may not apply to all languages
  • Some techniques require significant refactoring effort
  • Assumes you have time to add tests—may not apply to all situations

Specifications

Pages464
PublisherPrentice Hall
LanguageEnglish
Isbn13978-0131177055
Publication DateOctober 2, 2004