Definition of technical debt
Technical debt is the deferred cost of a technical choice. When a team chooses a quick or imperfect solution rather than the one that would have lasted, it saves time immediately and commits to losing more later. This lost time is the interest: every change requires more effort, every fix risks breaking something else. The principal is the work that would be needed to bring the software back to the desired state.
The metaphor is attributed to Ward Cunningham, in the early 1990s. Its meaning has broadened since. Today the term covers any accumulated gap between a system as it is and what it should be in order to evolve at a reasonable cost, whether that gap was chosen or suffered.
What the concept is for
Its value is to provide a common language between technical teams and those who decide on priorities. A business owner does not see the complexity of a module. They do understand, however, that an unpaid loan costs more and more. The concept makes it possible to ask the right question: not “is the code clean?”, but “how much is this state costing us, and is it worth remedying now?”.
It also reminds us that a debt is not a fault. Borrowing to seize an opportunity is a management decision. What causes problems is debt taken on unknowingly and debt that is not tracked.
The origins of technical debt
- The deliberate compromise. A deadline forces a shortcut. The team knows it and plans to come back to it.
- Lack of knowledge. The chosen design seemed good. Understanding of the need has progressed, and it no longer is.
- Ageing. The code does not change, but its environment evolves: a language, a component or an operating system is no longer maintained by its vendor. The debt grows without anyone having done anything.
- Organisation. The departure of the people who knew the system, teams changing the same code without common rules, or the merging of two information systems produce debt without any technical decision.
The engineer Martin Fowler proposed classifying debt along two axes: deliberate or inadvertent, prudent or reckless. Deliberate and prudent debt can be managed. Inadvertent and reckless debt is discovered on the day a simple change becomes impossible.
The forms of technical debt
| Form | Typical symptoms |
|---|---|
| Code | Duplication, overly long functions, dead code, scattered business rules |
| Architecture | Tight coupling between modules, a database shared by several applications, no stable interfaces |
| Tests | Automated tests missing or unreliable, manual validation at each release |
| Infrastructure and dependencies | Obsolete versions, out-of-support components, manual deployments |
| Documentation and knowledge | Workings known to a single person, design decisions not recorded |
Architecture debt is often the most costly, because it cannot be paid back in small instalments. Test debt is particularly insidious: it makes paying back all the others risky. Machine learning systems add their own forms of debt, linked to data and models, which are addressed by the practices described in our entry on MLOps.
Technical debt, bug and obsolescence: not to be confused
A bug is a visible defect in behaviour. Debt is a defect in structure, invisible to the user. Obsolescence is a particular form of debt, the one that comes from the ageing of components, with a security issue when patches are no longer published.
An old system is not necessarily indebted. An old application, well tested and well understood, can cost less to evolve than a recent application written in a hurry. Finally, technical debt is not the list of everything developers would like to redo. All that counts is what genuinely makes future changes more expensive or more fragile.
How to make the debt visible
Debt that only developers know about will never be arbitrated. Three practices bring it to light.
The inventory. Each item of debt is entered in the same backlog as functional changes, with a description of what it slows down or endangers and an estimate of the effort to fix it.
Cross-referencing with activity. Debt lodged in a module that no one changes costs almost nothing. The same debt in a module changed every week weighs on every release. Cross-referencing code quality with the frequency of changes points to the areas to deal with first.
Metrics that management can read. Lead time between a change request and its production release, share of releases followed by an incident, share of capacity devoted to fixes, number of out-of-support components. The measurements of static analysis tools (complexity, duplication, test coverage) complement this picture without replacing it.
How to reduce technical debt
Four levers combine.
- Stop borrowing unknowingly. Code review, automated tests and quality criteria built into the definition of done limit new debt.
- Pay back as you go. Each change is an opportunity to improve the code it touches. This practice, continuous refactoring, deals with debt where it gets in the way.
- Reserve capacity. An explicit share of each development cycle is devoted to debt, negotiated with the product owner and not taken on the quiet.
- Run targeted initiatives. A major version upgrade or the decoupling of a module requires a project in its own right. Gradual replacement, component by component, is generally less risky than a complete rewrite.
There is a fifth, legitimate choice: not paying back. For an application due to be retired, paying the interest until the end costs less than fixing it.
Example: a calculation rule written three times
In an order management application, the discount calculation was copied into three modules as urgent needs arose: order entry, invoicing and quote generation. No automated test covers it. With every change in commercial policy, three places have to be changed, and one of them is regularly forgotten. Incorrect invoices go out to customers.
The team enters this debt in the backlog, describing its effect: every pricing change is slow and risky. The product owner, who is planning several changes of this type, agrees to deal with it. The team first writes tests that pin down the expected behaviour, then consolidates the calculation in a single place on the occasion of the next change. The repayment was decided because its cost and the cost of inaction had been made comparable.
For dealing with debt across an application portfolio, see our pages devoted to application modernisation and software quality.