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

Appendix: Refactoring

Refactoring is a core technique for improving code. The canonical reference for refactoring is Martin Fowler’s book Refactoring: Improving the Design of Existing Code (Addison-Wesley, 1999). I refer you to that book for more information about the kind of refactoring you can do when you have tests in place in code.

In this chapter, I describe one key refactoring: Extract Method. It should give you a flavor of the mechanics involved in refactoring with tests.

Extract Method

Of all refactorings, Extract Method is perhaps the most useful. The idea behind Extract Method is that we can systematically break up large existing methods into smaller ones. When we do this, we make our code easier to understand. In addition, we can often ...

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