Skip to content

Technical debt

Technical debt is the accumulated cost of shortcuts, deferred fixes and design compromises in a codebase, borrowed against future velocity; like financial debt, it accrues interest — the interest here is slower development and higher bug rates.

Definition

What it is

Ward Cunningham coined the metaphor in 1992 to explain to business stakeholders why refactoring mattered. Shipping a quick hack is like borrowing money: you get velocity now, but you pay interest (slower future changes) and eventually principal (a rewrite). Interest compounds. Small hacks become architectural constraints.

Not all debt is bad. Reckless debt (no tests, no docs) is bad. Prudent debt (ship without polish, refactor next week) is strategic. The distinction is intent and tracking.

Why it matters

McKinsey and Stripe have measured the cost: developers spend 20-40% of their time on debt-related work in mature codebases. A codebase with 5% debt is tolerable; 30% is a death spiral. Debt is measurable, manageable and reversible with discipline.

Types of debt

Type

Example

Interest

Reckless deliberate

"Ship now, no tests"

High

Reckless inadvertent

"We didn't know"

High

Prudent deliberate

"Ship without polish, refactor next week"

Low, tracked

Prudent inadvertent

"Now we know better"

Low, untracked

The debt lifecycle

graph LR
  S[Shortcut] --> D[Debt recorded]
  D --> I[Interest: slower changes]
  I -->|refactor| P[Principal paid]
  I -->|ignore| C[Crisis: rewrite]
  style D fill:#E8F5E9
  style C fill:#FFEBEE

How to manage it

Debt discipline

  1. Track every deliberate shortcut

    // TODO: refactor - see issue #123. Debt without a ticket is forgotten debt.

  2. Allocate 20% of each sprint

    Dedicate capacity to paying down the worst debt.

  3. Refactor with tests

    Never refactor without tests. Debt + no tests = rewrite.

  4. Boy scout rule

    Leave every file better than you found it. Small continuous improvements.

  5. Measure code churn

    Files modified every sprint are debt hotspots. Prioritize them.

Common failures

Origin

Ward Cunningham (inventor of the wiki) introduced the metaphor in a 1992 OOPSLA experience report, explaining to management why refactoring mattered. The metaphor is now standard in software engineering education. Martin Fowler (2003) popularized the four-quadrant model (reckless/prudent × deliberate/inadvertent).

Shipping first-time code is like going into debt. A little debt speeds development so long as it is paid back promptly with a rewrite. The danger occurs when the debt is not repaid.

— Ward Cunningham, 1992 (paraphrase)
1992 · Cunningham acuña el término
2003 · Fowler 4-quadrant model
2018 · Stripe Developer Coefficient report
2020 · McKinsey Developer Velocity
2024 · 20-40% time on debt (mature teams)

Evidence

FAQ

How do I measure technical debt?

SonarQube, Code Climate, or simple metrics (cyclomatic complexity, lines per file, test coverage). None is perfect.

When to rewrite?

Almost never. Rewrite only if the code cannot be changed incrementally and the cost of staying is higher than the cost of rewriting.

Is debt always bad?

No. Deliberate, tracked, small debt is a strategic tool.

How much time to allocate?

10–20% per sprint. Less if debt is low; more if it's high.

Connections

  • refactor
  • code-smell
  • legacy-code
  • continuous-improvement

Etymology

Origin: metaphor

  • technical (adjective): from Greek technē, "art, craft"
  • debt (noun): from Latin debitum, "thing owed"

Semantic network

Technical desoftware-qrefactorcode-smelllegacy-codcontinuous

● broader ● narrower ● related

Broader

  • software-quality

Related

  • refactor
  • code-smell
  • legacy-code
  • continuous-improvement

Used in the garden

Sources