Table of Contents

Refactoring

Marting Fowler Definition: Refactoring is a controlled technique for improving the design of an existing code base. Its essence is applying a series of small behavior-preserving transformations, each of which "too small to be worth doing". However the cumulative effect of each of these transformations is quite significant. By doing them in small steps you reduce the risk of introducing errors.

The main purpose of refactoring is to fight technical debt. It transforms a mess into clean code and simple design. Clean code:

Technical debt

Technical debt is a concept in programming that reflects the extra development work that arises when code that is easy to implement in the short run is used instead of applying the best overall solution.

Causes:

When to refactor

Code smells

Refactoring Techniques