Skip to content
Novandri.

Technical Debt: The Hidden Cost of Shortcuts

Technical debt is a metaphor for future cost, not a synonym for bad code. Read how interest accrues, a payoff worked example, and when taking debt is rational.

Rachmadwipa Novandri6 min read

Technical debt is one of the most used and least examined metaphors in software. It is often invoked to justify a rewrite, which misses the point of a financial analogy: debt can be prudent or reckless, and the question is whether the interest is being paid knowingly. A codebase with "debt" is not automatically in crisis; a team that does not know its interest rate is.

Direct answer: Martin Fowler describes technical debt as "a metaphor, coined by Ward Cunningham, that frames how to think about dealing with this cruft, thinking of it like a financial debt". The central mechanism is interest: "The extra effort that it takes to add new features is the interest paid on the debt." The boundary is that the metaphor has limits — software debt has no maturity date or market price, so the discipline lies in measuring the interest, not in assigning a notional principal.

A four-step flow: take the shortcut, name the interest, pay it knowingly, then choose when to pay.
Conceptual: debt can be prudent or reckless. Remove all technical debt is not a coherent goal.

What counts as debt

Fowler's usage distinguishes deficiencies in internal quality that make future change harder from simple mess. Three categories are useful:

Deliberate and understood. A team ships a known shortcut to meet a deadline, records it, and plans to address it. This is prudent debt — a conscious trade of future effort for present speed.

Inadvertent. The team did not know a better design at the time, or the system's requirements changed. The code was reasonable when written and is now a constraint.

Reckless. The team knowingly created a dangerous condition with no plan to fix it. This is the case the metaphor is meant to condemn, and it is not the same as the first two.

The distinction matters because "remove all technical debt" is not a coherent goal.

A startup that spends a year perfecting internals before learning whether anyone wants the product has avoided debt by choosing a different failure.

Where ML systems concentrate it

Sculley et al.'s paper "Hidden Technical Debt in Machine Learning Systems" is a sharp application of the idea. The authors write that "using the software engineering framework of technical debt, we find it is common to incur massive ongoing maintenance costs in real-world ML systems". Their risk factors include "boundary erosion, entanglement, hidden feedback loops, undeclared consumers, data dependencies, configuration issues, changes in the external world, and a variety of system-level anti-patterns".

Two of these are especially easy to miss:

Undeclared consumers. Another system reads a model's output without the model team knowing. A change that seems local breaks a downstream process — the debt is the invisible dependency, not the code.

Hidden feedback loops. A model's output influences the data it later trains on. A recommendation changes what users click, and the click data trains the next version. The system is now part of its own environment, and a past evaluation no longer describes the present.

This is why "the model is only 5% of the system" is more than a slogan in ML: the surrounding plumbing is where the debt accrues.

A worked example of interest

The following numbers are hypothetical and illustrative.

A team estimates that a new feature would take 3 days in the current codebase and 1 day after a 10-day cleanup. They ship the feature on the old design. Six months later, two more features touch the same area, each taking 3 days instead of 1. A year later, a bug fix takes 2 days instead of half a day because the tangled logic is hard to reason about.

Cumulative extra effort:

  • Features: 2 × 2 days = 4 days.
  • Bug fix: 1.5 days.
  • Total interest paid so far: 5.5 days.

The cleanup still costs 10 days. On these numbers it has not paid back yet, and a rewrite would be unjustified. But the interest is recurring: if four more features touch the area in the next year, another 8 days accrue, and the cleanup becomes roughly break-even.

Three observations follow:

  1. Interest is measured per change, not as a lump sum. The right question is not "how bad is the code?" but "how much extra does each change cost?"
  2. A rewrite has its own costs and risks, including new bugs and a period of reduced delivery. It is an investment, not a reset button.
  3. The decision should be revisited. A cleanup that was unjustified at month six may be justified at month eighteen, because the remaining useful life and the change frequency have changed.

A practical tactic is to record the estimate at the moment the shortcut is taken — "this will cost two extra days on each future change in this area" — so that the interest is visible when the bill arrives.

When debt is the right choice

Three conditions make a shortcut rational:

The information is perishable. If the product may change direction in three months, investing in a durable design for a feature that may be deleted is a poor use of time.

The interest is bounded. A shortcut in a rarely changed module with a small surface area costs little. A shortcut at a boundary used by every team is a different proposition.

There is a repayment plan. The team records the debt, knows what would trigger repayment, and has a place in the backlog where it competes on equal terms with features.

The counterargument — that all debt should be repaid immediately — is a recipe for perpetual refactoring.

A system with zero debt is usually a system that stopped changing.

What the metaphor hides

No objective principal. Unlike a loan, technical debt has no agreed amount. Two engineers can look at the same code and estimate wildly different cleanup costs, which makes the financial language less precise than it sounds.

Some "debt" is just unfamiliarity. Code a team does not understand feels like debt, but it may be correct and well-designed. The distinction matters: rewriting understood code because it is unfamiliar destroys value.

Repayment can be misallocated.

The visible mess is not necessarily the expensive one.

A decision test

  1. Name the specific shortcut and what it makes harder — vague "debt" cannot be managed.
  2. Estimate the interest per change and record the estimate at the time the shortcut is taken.
  3. Count how often the area changes to project the accumulating cost.
  4. Classify the debt as deliberate, inadvertent, or reckless and act accordingly.
  5. Include undeclared consumers in the blast radius of any change.
  6. Compare the cleanup against its own cost and risk, not against an ideal of perfect code.
  7. Revisit the decision when change frequency or remaining lifetime changes.

For the maintenance discipline that keeps debt visible, see Technical Writing; for the ML-specific context, see MLOps.

References & Further Reading

  • Martin Fowler, 2012. Technical Debt — Why postponing work is a debt with interest, and how to decide when to pay it.
  • Ward Cunningham, 1992. The WyCash Portfolio Management System — The original OOPSLA 1992 experience report in which Cunningham introduced the debt metaphor for software development.
  • Ward Cunningham, 1992. Technical Debt — The concept Fowler popularised, and the practical argument for paying it down deliberately.
  • D. Sculley et al., 2015. Hidden Technical Debt in Machine Learning Systems — Why production ML fails for organisational reasons rather than algorithmic ones.