Skip to content
← All insights
Technical debt7 min read

How to tackle technical debt without rewriting everything

You probably don’t need a rewrite. You do need a better reason than “the code is messy.”

Say what the debt is costing you

“This code needs cleaning up” rarely wins an argument for time. “Releases take two days because nobody trusts these tests” might. Tie the debt to slow delivery, incidents, difficult onboarding or a product change you cannot safely make.

Make room for one safe change

Put tests around the behaviour you need to keep, then create a boundary where the new work can sit. Improve the part of the system touched by a real delivery goal instead of opening a cleanup project with no end.

  • Measure the friction that keeps coming back
  • Protect the behaviour that matters
  • Reduce coupling at the point of change
  • Ship steps small enough for production
Characterise today’s behaviour before refactoringjava
@Test
void keepsLegacyRoundingBehaviour() {
  var price = calculator.total(new BigDecimal("12.345"));

  assertEquals(new BigDecimal("12.35"), price);
}