All articles

Technical debt explained in weeks and euros

When a change that once took days starts taking weeks, it is worth understanding what is making the work harder. Technical debt is one possible explanation.

It gives developers and business leaders a way to discuss that extra effort, what it costs and when it makes sense to address it.

What it is, in practice

The term covers unresolved problems in the code and decisions that made sense earlier but no longer meet the needs of the business.

It gets left for later because fixing it doesn’t usually add anything anyone can see. There’s no new feature. From the outside it looks like wasted time.

Where it does show is in everything that comes afterwards. When code is tidy, with clear names and tests, the team understands it quickly and can change it with confidence.

With a lot of debt, every new feature risks breaking something that used to work. It has to be found and fixed, and what should take days ends up taking weeks.

The comparison with a loan is a useful one. The work needed to improve that code is the principal. From then on, every change that touches that part costs more than it should. That’s the interest.

And the interest is paid every time, until the principal is paid back.

Technical debt as a loan: the work needed to improve the code is the principal, the extra time on every change to that part is the interest, and tidying the code and adding tests is paying back the principal. PRINCIPALWork to improve the code INTERESTExtra time to change that part REPAYMENTTidying the code and adding tests
Until the principal is paid back, every change to that part pays interest.

How to tell if your software carries debt, without reading the code

You don’t need to know how to program to see the symptoms. Start by looking at how delivery has changed over time. Some typical examples:

  • Similar changes take longer each time. For example, adding a field to a form used to take an afternoon and now takes a week.
  • Every release breaks something unrelated. Invoicing gets fixed and the customer list stops working.
  • There are parts nobody wants to touch. “Better not change that, so-and-so built it and only they understand it.”
  • Updates are scary. The program uses old versions of everything because the last time something was updated, half the application had to be fixed.

None of these symptoms proves anything on its own; they can also come from a lack of tests or from an overloaded team. But when several come together, it’s worth getting an outside review of the code.

How to put a figure on it

The interest on the debt can be estimated in time, and time can be turned into euros.

Pick a kind of change that comes up fairly often and compare how much work it takes now with what it took at the start, for the same scope.

Count person-days of actual work, not calendar days, and set aside whatever has another explanation: more scope, fewer people, waiting on third parties. What’s left is an estimate of the interest paid on that change.

An example with round numbers, only to show the calculation: a change that used to take 3 days of work now takes 10. That is seven extra person-days per change. If the team makes a change like that once a month, that’s 84 days a year.

With 8-hour days and a cost of 40 euros per person per hour, that’s 26,880 euros a year in interest, without paying back any of the principal.

Your figures will be different. The calculation is the same: extra working days per change, times changes a year, times hours a day, times the cost of an hour.

With that figure, the conversation stops being “the team needs time to improve the code” and becomes “we’re paying this much a year in interest; what does it cost to pay back the principal?”

Where the idea comes from

The comparison with debt was made by Ward Cunningham, an American programmer, in a 1992 report.

His words were: “Shipping first time code is like going into debt.” And he added: “A little debt speeds development so long as it is paid back promptly with a rewrite.” The name “technical debt” caught on later.

For Cunningham, shipping that first version already means going into debt, and that’s reasonable: immature code can work fine and be acceptable to the customer.

The danger is not paying the debt back, not revising and consolidating the code as it matures, which, as he saw it, is what keeps the code understandable and development moving.

That’s the rewrite he means: redoing the affected part, not throwing the whole program away.

How it gets paid back

The temptation is to stop everything and rewrite the program from scratch. It’s rarely a good idea: it’s expensive, nothing new is delivered for months, and there’s a risk of repeating the same mistakes in new code.

A practical approach is to address it gradually. Allocate time in each delivery cycle to improve the code involved in that work.

Add automated tests before changing anything, so that much of what breaks is caught at once and not discovered by a customer. And start where the most interest is being paid, not where the code is ugliest.

A little debt isn’t a problem; sometimes it is a reasonable trade-off to meet a deadline. The problem is debt that nobody writes down or pays back. That debt comes due, in weeks and in euros.