O'Reilly logo

Re-Engineering Legacy Software by Chris Birchall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Refactoring

This chapter covers

  • Methods for maintaining discipline when refactoring
  • Common smells found in legacy code, and refactoring techniques for removing them
  • Using automated tests to support refactoring

In this chapter we’ll look at your most important weapon in the fight against legacy, namely refactoring. I’ll introduce some general tips for effective refactoring, as well as a few specific refactorings that I often use in real-world code. We’ll also look at techniques for writing tests for legacy code, which is vital if you want assurance that your refactoring work hasn’t broken anything.

4.1. Disciplined refactoring

Before we start looking at specific refactoring techniques, I want to talk about the importance of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required