All terms

Glossary

Legacy code

Code without tests that earns money. The definition by Michael Feathers is useful because it names the real problem: missing safety, not age.

Age alone does not make code legacy. A ten year old system with good test coverage can be changed safely. A two year old one without tests cannot.

The marker is therefore fear of change. It is rational as long as nobody can show that a change breaks nothing.

How you notice it

  • There are no automated tests for the areas that earn money.
  • Changes get batched because every deployment carries risk.
  • The person who knows the code is either gone or indispensable.

Frequently asked

Where do I start with legacy code?

With a seam, not with cleaning up. Find a place where behaviour can be checked from the outside and write a test that pins down today behaviour. From there every further change can be secured without understanding the whole system.

Read moreTechnical debt as business risk