All terms

Glossary

Refactoring

Improving the internal structure of code without changing its externally visible behaviour.

The second half of that sentence is the decisive one. As soon as behaviour changes it is no longer refactoring, it is a change that needs testing and sign-off.

It pays off where work is about to happen. Refactoring on spec spends time on places that may never be touched again.

How you notice it

  • A change that should take a day takes a week.
  • The same logic appears in several places.
  • New people take months to become productive.

Frequently asked

When does refactoring become a rewrite?

The moment behaviour changes. Refactoring keeps the outside identical and only moves the inside, which is why it can happen in small steps between features. Anything that alters output is a change and needs its own testing.

Read moreTwelve weeks of modernization: a realistic plan