What is "refactoring"

The heart of the method is a series of small transformations preserving behavior. Each transformation (called "Refactoring") does little, but a sequence of transformations can produce a significant restructuring. Since each refactoring is small, it is less likely to go wrong. The system is also kept fully operational after every minor refactoring, reducing the chances that a system could get seriously broken during restructuring.

Extracted from the Refactoring Home Page.

Maintaining the system in a consistent and correct state is ensured by unit test after each change.

Books