Skip to content

Technical debt: interest, not just principal

Debt is a shortcut you pay interest on every time you change that code; pay first where the interest is highest.

Predict first

Before you read: predict

ExamHall's certificate PDF generator, written in 2021, is one 900-line function nobody enjoys reading. Its tests pass, no ticket has touched it in 18 months, and nothing on the next two quarters' roadmap changes certificates. A new tech lead proposes spending next sprint rewriting it "to pay down tech debt".

Which reply do Fowler's and Cunningham's accounts of the debt metaphor support?

Pick one

The 30-second version

Shipping not-quite-right code is borrowing: you gain time now and pay interest on every later change to it. Interest is the extra cost per change times the changes ahead. Pay down the highest-interest debt first, and pitch it in days per change and a payback date. Fowler sorts debt as prudent or reckless, deliberate or inadvertent.

Debt is a shortcut you pay interest on every time you change that code; pay first where the interest is highest.

How it works

Step 1 of 13

A shortcut is a loan. Shipping first-time, not-quite-right code is going into debt: you gain development speed now. [S2]
In the kitchen
  • the quick plane cut before school → a deliberate, prudent shortcut (steps 1, 11)

Analogy: A family's sticking doors (home maintenance)

A family moves in the week before school starts. The back door has swollen, so they shave it with a quick plane cut, knowing it really needs rehanging. Twenty times a day someone shoulders it open. The loft hatch sticks just as badly, but it is opened twice a year, so nobody touches it. A carpenter's day to rehang the back door is repaid in saved shoves within weeks.

In the house In the code
the quick plane cut before school a deliberate, prudent shortcut (steps 1, 11)
a shoulder shove on every trip through interest, paid per change (step 2)
the loft hatch, opened twice a year rarely touched debt: leave it (step 7)
the carpenter's day the principal (step 3)
saved shoves covering the carpenter's day payback (step 8)

Breaks down when: a door costs the same shove every time, while code built on a shortcut makes later changes dearer as more is built on it (step 5).

In real terms: each debt gets an extra cost per change, the changes planned for it, and the days to pay it off.

Examples, run for real

4.1 ExamHall EXH-3860 → MR !4160: scoring rules in four places

ExamHall's grading worker scores each question type by rules that were copied into four places: the grading worker, the regrade job, the results export and the appeals tool. EXH-3860 is a synthetic pricing of that debt; MR !4160 moves the rules into one table.

EXH-3860 · scoring rules copied into 4 places · a new question type: 1.5 days with the copies, 0.5 day with one rule table
  interest per new type   1.5 − 0.5 = 1.0 day
  roadmap                 3 new types in Q1, 3 in Q2 · interest 3.0 days a quarter
  MR !4160 principal      4 days to move the rules into one table
  paid back               after the 4th new type (Q2) · by the end of Q2: 6.0 days saved, 2.0 net
  timetable importer      ugly, 2 days extra per change, 0 changes planned · interest 0 · left as it is

The interest is the day each new question type costs because four copies must change; the roadmap turns it into days a quarter. Moving the rules into one table costs four days and stops that interest, so it has paid for itself after the fourth new type. Four copies that change together are past the rule of three in pat-over-engineering, so one table is no guess. The timetable importer is just as ugly, but nothing on the roadmap touches it, so its interest is zero and it waits. The pitch to the product manager is those lines: a day per question type, three days a quarter, paid back in Q2. The figures are synthetic; the script replays them and measures no real team.

4.2 Payments ledger: a debt pitched in days

A payments ledger keeps each account code's posting rules as if-branches in its posting service, so every new code is a code change, a review and a deploy. The figures are synthetic.

Ledger account codes · a new account code: 2.5 hours in the posting service, 0.5 hour in a mapping table
  interest per new code   2.5 − 0.5 = 2.0 hours
  plan                    12 new codes a quarter · interest 24 hours a quarter = 3.0 working days (8 h)
  principal               4 days (32 hours) to move the mapping into a table
  paid back               after the 16th new code (Q2) · pitch: 3.0 days a quarter now, 4 days once

The interest is counted in hours, then turned into working days for the pitch: three days a quarter now, four days once, paid back in Q2. The hours per code come from the team's own debt lines.

Try it

Answer first, then check. Nothing is saved.

Question 1 of 8

A payments-ledger team lists four debts, with the extra time each adds to every change in its area, the changes planned there next quarter and the days to pay it down (a working day is 8 hours):

  • the FX rounding helper: 900 lines, 1 hour extra on each change, 1 change planned, 8 days to pay down
  • the refund posting rules: 300 lines, 3 hours extra on each change, 10 changes planned, 5 days to pay down
  • the settlement file parser: 400 lines, 12 hours extra on each change, 1 change planned, 6 days to pay down
  • the hard-coded fee table: 60 lines, half an hour extra on each change, 8 changes planned, 2 days to pay down

The team can pay down one debt next quarter.

Which should it be?

Pick one

Question 2 of 8

Each new payment provider the ledger adds needs its reconciliation rules copied into three services and patched there: 2.5 days of work per provider. Moving the rules into one shared module would take 7 days; after that, adding a provider takes 1 day. Providers are added one at a time.

Counting whole providers, after which new provider has the move paid for itself?

Pick one

Question 3 of 8

Two years ago a payments-ledger team's senior engineers chose to build its settlement engine around single payments, the shape every bank contract then used; the engine was reviewed, tested and readable. This year the first bank sent netted batch files, and every new settlement rule now touches six classes. The engineers now sketch a batch-centred engine and say it is what they would build today.

In Fowler's quadrant, which kind of debt is this?

Pick one

Question 4 of 8

Two years ago a payments-ledger team shipped its first refund flow quickly, planning to tidy it once refunds proved popular. Every quarter since, new refund features were built on top and the tidy-up was put off. The code is split into modules, its tests pass and finance has no complaints, yet only one engineer can now change refunds safely, and a small refund change takes her a week.

Which reading does Cunningham's 1992 report support?

Pick one

Question 5 of 8

ExamHall's product manager asks why the grading team wants four days next sprint for "refactoring the scoring rules", when two new question types are waiting.

Write the one-paragraph pitch, in at most 120 words, as you would say it to her.

Question 6 of 8

An interviewer says: "Tell me about technical debt you took on deliberately, and whether it was the right call." A payments-ledger shortcut you took or saw will do.

Write your answer in at most 150 words.

Question 7 of 8

A payments-ledger team lists four debts, about a week each to pay down. In January, chargebacks move to the card processor's service:

  • the chargeback rules: 2 hours extra on each change, 12 changes last quarter, 0 planned next quarter
  • the payout scheduler: 3 hours extra on each change, 2 changes last quarter, 9 planned next quarter
  • the ledger export: 10 hours extra on each change, 2 changes last quarter, 2 planned next quarter
  • the currency table loader: 2 hours extra on each change, 6 changes last quarter, 12 planned next quarter

Which debt should the team pay down first next quarter?

Pick one

Question 8 of 8

Four lines from a payments-ledger team's notes on its technical debt.

Which line goes against what Fowler or Cunningham says?

Pick one

Go deeper

Pro tip
  1. Keep a debt line beside each slow change. When a change in some area takes longer because of a known shortcut, log the extra hours against that debt; a quarter of those lines is the interest you pitch. When: in the sprint where the slowdown happens. Status: SELF (this lesson's practice target; not run).
Source
  • S1 · Martin Fowler, "Technical Debt Quadrant" (bliki, 14 October 2009, reposted 19 November 2014), the row's first source, https://martinfowler.com/bliki/TechnicalDebtQuadrant.html (fowler-debt-quadrant.txt). The quadrant's figure is an image, so only the page's text is quoted. "The prudent debt to reach a release may not be worth paying down if the interest payments are sufficiently small - such as if it were in a rarely touched part of the code-base." (step 7); "A mess is a reckless debt which results in crippling interest payments or a long period of paying down the principal."; "So the useful distinction isn't between debt or non-debt, but between prudent and reckless debt." (step 10); "The prudent debt example is deliberate because the team knows they are taking on a debt, and thus puts some thought as to whether the payoff for an earlier release is greater than the costs of paying it off." (step 11); "A team may know about good design practices, even be capable of practicing them, but decide to go “quick and dirty” because they think they can't afford the time required to write clean code." (step 11); "I agree with Uncle Bob that this is usually a reckless debt, because people underestimate where the DesignPayoffLine is."; "Reckless debt may not be inadvertent."; "A team ignorant of design practices is taking on its reckless debt without even realizing how much hock it's getting into." (step 12); "Although such a thing sounds odd, I believe that it is - and it's not just common but inevitable for teams that are excellent designers." (step 12); "Even the best teams will have debt to deal with as a project goes on" (step 12); "My view is this kind of debt is inevitable and thus should be expected." (step 12); "A particular benefit of the debt metaphor is that it's very handy for communicating to non-technical people." (step 13).
  • S2 · Ward Cunningham, "The WyCash Portfolio Management System" (OOPSLA '92 experience report, 26 March 1992), the row's second source, http://c2.com/doc/oopsla92.html (cunningham-wycash-1992.txt). "Shipping first time code is like going into debt." (step 1); "Mature sections of the program have been revised or rewritten many times providing the consolidation that is key to understanding and continued incremental development" (step 4); "Every minute spent on not-quite-right code counts as interest on that debt." (step 2); "A little debt speeds development so long as it is paid back promptly with a rewrite." (step 4); "The danger occurs when the debt is not repaid." (step 4); "Although immature code may work fine and be completely acceptable to the customer, excess quantities will make a program unmasterable, leading to extreme specialization of programmers and finally an inflexible product." (step 5); "Entire engineering organizations can be brought to a stand-still under the debt load of an unconsolidated implementation" (step 5).

Checked against the tools and docs as of 2026-10-13.