Refactoring

Home - Introduction into XP


An important element of implementing tasks is to have the source code in an optimum state upon finishing the task. That means that everything that is not absolutely necessary for running the already finished acceptance tests and unit tests has to be removed from the system.

The source code will be transformed in such a way that it will not change functionally, but so that the source code gains in quality towards different regards. For example, the number of classes, the number of methods and the number or attributes is reduced as much as possible. You can find an excellent discussion and explanations about doing this in Martin Fowlers book on refactoring.

In the meantime the first IDEs (Integrated Development Environment) are available, which also provide refactoring functionality, such as IntelliJ for Java.

An example for a refactoring, which also leads to a design change (as do all of the refactorings!), can be found in the explanations of simple design.

A Different Kind Of Refactoring

With XP refactoring in general is applied to source code. There are however other things, that can be refactored. Some of them are mentioned in the tips section below.

Another interesting target for refactoring are organisations such as R&D departments, as is shown in the feature article "Organizational Refactoring".

Tips

  • Refactor immediately before integration.
  • Refactor whenever you have added a test case.
  • Unit tests also need refactoring once in a while.
  • Larger refactorings should be planned as explicit tasks. The team, but also the customer knows by then, that this is a significant effort.

A Different Kind Of Refactoring
Tips
Home
Search
Keywords
Links
About
Deutsche Version
© Copyright 2001-2002 by Manfred Lange, All rights reserved. Terms of use.
Last change: 1/14/2002