Skip to Content
Working Effectively with Legacy Code
book

Working Effectively with Legacy Code

by Michael Feathers
September 2004
Intermediate to advanced
464 pages
10h
English
Pearson
Content preview from Working Effectively with Legacy Code

Chapter 12: I Need to Make Many Changes in One Area. Do I Have to Break Dependencies for All the Classes Involved?

In some cases, it’s easy to start writing tests for a class. But in legacy code, it’s often difficult. Dependencies can be hard to break. When you’ve made a commitment to get classes into test harnesses to make work easier, one of the most infuriating things that you can encounter is a closely scattered change. You need to add a new feature to a system, and you find that you have to modify three or four closely related classes. Each of them would take a couple of hours to get under test. Sure, you know that the code will be better for it at the end, but do you really have to break all of those dependencies individually? Maybe not. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Clean Code: A Handbook of Agile Software Craftsmanship

Clean Code: A Handbook of Agile Software Craftsmanship

Robert C. Martin

Publisher Resources

ISBN: 0131177052Publisher Support