Skip to content

Put a Real Number on Your Technical Debt, Then Decide

Technical debt behaves like a loan. Here is how to price the principal and the interest in real money, and when paying the interest is the smart call.

· · 7 min read
A desk with a ledger, a calculator and a pen, the tools you would use to price a loan

Why won't anyone tell you what your debt costs?

Every engineering team carries technical debt. Almost none of them can put a number on it. That gap is the whole problem, and it's fixable with arithmetic a mortgage broker would find insulting. Debt you can't price is debt you can't argue about, and debt you can't argue about always loses to the next feature on the roadmap.

Where did the debt metaphor actually come from?

Ward Cunningham coined it in a 1992 experience report, and later explained it on camera in his own words. Here's the part almost everyone gets backwards. Cunningham was not describing sloppy code. He was describing the opposite: shipping your current, honest understanding of a problem so you could learn from real use, then paying that debt back by refactoring as your understanding improved. The debt was the gap between what you knew when you shipped and what you'd know soon after.

Somewhere along the way the metaphor got hijacked to mean "code we knew was bad and shipped anyway". Martin Fowler untangles this in his TechnicalDebt bliki entry, splitting deliberate debt from inadvertent debt and prudent from reckless. Reckless-deliberate debt ("we don't have time for design") isn't really debt. It's just a mess you took out no loan to justify. Real debt is a deliberate trade: ship now, pay later, and know roughly what later costs. If you never worked out the "roughly what later costs" part, you didn't take a loan. You took a bet.

What are principal and interest in technical debt?

Two numbers matter, and teams almost always track zero of them.

Principal is the one-time cost to fix the shortcut properly. Rip out the copy-pasted auth check, put it behind one function, update the callers. Say that's 16 hours of work. That's your principal.

Interest is the recurring cost you pay for as long as the shortcut lives. Every new endpoint has to remember the copy-paste. Every change touches four files instead of one. Every new hire trips over it once. That's the tax, and unlike the principal, it never stops until you pay the principal down.

Here's a worked example, because vague debt stays invisible. Say a data-access shortcut costs a five-person team 2 hours per sprint in workarounds: re-reading the confusing bit, patching the same edge case in two places, explaining it in review. Two-week sprints, so 26 sprints a year. That's 52 hours a year, every year, at maybe 120 dollars a fully loaded engineer-hour: roughly 6,240 dollars annually, and it grows as the team grows. The principal to fix it was 16 hours, about 1,920 dollars. Would you pay a bank 6,240 dollars a year to avoid a one-time 1,920 payment? Nobody would say yes to that out loud. Teams say yes to it by accident every single sprint, because the interest never shows up on an invoice.

And it compounds. Every new feature built on top of the shortcut widens the surface the interest is charged against. That's the difference between debt that sits still and debt that grows while you sleep.

Debt nobody prices isn't debt you're managing. It's a tax you pay every sprint and never see on any invoice.

SHARE Post on X Bluesky

So how do you actually put a number on it?

Two paths: a tool that estimates it for you, and a formula you can run on a napkin.

If you already run SonarQube, it does the estimating. Its technical debt ratio is remediation cost divided by the cost to rewrite the code from scratch, expressed as a percentage, and it reports the debt itself in developer-days (a SQALE-based model, documented in the SonarSource docs). A ratio under 5 percent earns an A rating; the number climbs as remediation cost grows against the size of the codebase. The value isn't the letter grade. It's the trend. I care far less about today's 7 percent than whether next month's is 8, because a rising ratio means you're borrowing faster than you're repaying, no matter how green the pipeline looks.

No tool? The DIY formula is honest enough and takes ten minutes:

  • Principal = hours to fix the shortcut properly, times your fully loaded hourly cost.
  • Interest = (hours lost per sprint to the shortcut) times (sprints per year) times hourly cost.
  • Payback period = principal divided by annual interest.

If the payback period is under a year, you're bleeding money by not fixing it. If it's five years, the interest is cheap and you probably have better places to spend. That single ratio does more prioritization work than most backlog-grooming rituals I've sat through, and it fits in a spreadsheet cell. For the fuller version of ranking many debts against each other, I've written up the prioritization frameworks I actually use separately.

When is paying the interest the smart move?

Not all debt should be paid down. This is where the loan metaphor earns its keep, because a good CFO doesn't pay off every loan early either.

Pay the interest, keep the debt, when the code is short-lived. A migration script you'll delete in a month. A feature flag guarding an experiment that's probably getting killed. A spike written to answer one question. Refactoring code that's about to be deleted is the purest waste there is. Why pay down principal on a house you're demolishing next week?

Pay the interest when the product direction is genuinely uncertain. If you don't yet know whether this whole subsystem survives the next quarter, over-engineering it now is buying insurance on a car you might not keep.

But pay down the principal, and fast, when three things line up: the code sits on a hot path, it gets touched most sprints, and the interest is compounding. Code that every new feature builds on is the worst place to carry debt, because you're paying interest on a balance that grows with each release. That's the case where "we'll fix it later" quietly becomes "we rewrite the whole thing in eighteen months at ten times the cost". The teams that end up there usually got there by suppressing the warnings instead of reading them.

Why is debt nobody wrote down the real danger?

The worst debt isn't the debt you chose. It's the debt nobody priced, so nobody argues for fixing it, so it accrues interest in silence forever. It never appears in a sprint plan because it has no line item. You feel it only as a vague sense that everything takes longer than it should.

The fix is boringly literal: make it a line item. When you take a shortcut on purpose, write a one-line ticket that records the principal (hours to fix) and the interest (hours per sprint it costs), even if both numbers are rough guesses. A wrong estimate you can revise beats no estimate you can't discuss. This is the same discipline that makes a good set of CI gates worth the trouble: a cost that's measured gets managed, and a cost that's invisible gets paid forever.

So here's the question worth taking into your next planning meeting. Which of your loans are you paying interest on right now, and do you know a single one of the numbers? If the answer is no, you're not deciding anything. You're just paying.

Frequently Asked Questions

How do you calculate technical debt in money?
Principal is hours to fix the shortcut properly times your loaded hourly cost. Interest is hours lost per sprint times sprints per year times hourly cost. Payback period is principal divided by annual interest. Under a year means you're losing money by not fixing it.
What is the technical debt ratio in SonarQube?
It's remediation cost divided by the cost to rewrite the code from scratch, shown as a percentage, with the debt itself reported in developer-days. A ratio under 5 percent earns an A rating. The trend matters more than the grade.
When should you leave technical debt unpaid?
Keep paying interest when the code is short-lived, like a migration script or an experiment's feature flag, or when product direction is uncertain. Pay down principal when the code sits on a hot path, gets touched most sprints, and the interest is compounding.
What did Ward Cunningham mean by technical debt?
In his 1992 experience report, Cunningham meant shipping your current honest understanding so you could learn from real use, then refactoring as it improved. He wasn't describing sloppy code. The debt was the gap between what you knew when you shipped and what you learned soon after.