When you are packing in a hurry to move house, you sometimes toss things into boxes any which way and resolve to sort them out later. It gets the job done quickly for now, but in the new home you have to dig through several boxes just to find one item, and the longer you put off unpacking properly, the more effort it takes. Exactly the same thing happens in software development, and the term for it is technical debt.
Put simply, technical debt is the extra cost you end up paying later to fix and refine your work when you choose an easy shortcut over a better design for the sake of speed today. It is a metaphor first used by the American programmer Ward Cunningham in a 1992 conference presentation, and today it has become a common expression not only among developers but also among executives and product planners.
This article explains, in easy-to-understand terms, what technical debt means and how the term came about, how debt builds up, the different kinds of debt, and how to manage and pay it down.
How Technical Debt Works and How to Manage It
What Is Technical Debt?


Cunningham introduced the metaphor at OOPSLA, a conference on object-oriented programming, in 1992, while presenting his experience developing a piece of financial software. He said that shipping first-time code is like going into debt. A little debt speeds up development, but it has to be paid back promptly by rewriting the code.
The metaphor spread widely because even non-developers can grasp it immediately. Just as debt accrues interest, leaving sloppy code as it is means that each new feature added on top of it takes a little more time and effort. Cunningham warned that if unpaid debt piles up, an entire organization can grind to a halt under the weight of the interest.
Here, the principal is the sloppy code itself that has not yet been fixed, and the interest is the extra time and effort that code costs every time. Paying off the principal means properly cleaning up the code, and as long as any principal remains, interest keeps accruing for as long as development continues.
How Does Debt Build Up, and How Does Interest Accrue?

Technical debt builds up in many ways. Typical examples include skipping tests to meet a release date, copying and pasting similar code instead of reworking it, and not leaving any documentation. Some debt arises even when no one has done anything wrong, as when a design that was right at first stops fitting as the service grows.
Interest accrues in forms that are hard to see. Changing even one small feature causes errors in unexpected places, and newly arrived developers spend weeks trying to understand the tangled code. The time the same task takes also grows a little every year, but because the day-to-day change is small, no one easily notices it.
What makes the interest so frightening is that it compounds. When you build new code on top of sloppy code, the new code has no choice but to be forced into that flimsy structure. In the end, one shortcut gives rise to many detours, and the scope of what needs fixing grows several times larger than at the start.
When the interest grows larger than the principal, you reach a point where you spend more time holding off existing problems than building new features.
Not All Debt Is Bad: Types of Technical Debt

In 2009, the British software developer Martin Fowler proposed the ‘technical debt quadrant,’ which divides technical debt by two criteria. One is whether the debt was taken on knowingly or unknowingly; the other is whether it was prudent or reckless.
(1) Prudent, deliberate debt
This is debt taken on with full awareness of the consequences, as in ‘Shipping comes first right now, so let's do it this way and fix it later.’ It can be a strategic choice that lets a business seize a critical window.
(2) Reckless, deliberate debt
This is when people cut corners even though they know better, saying ‘We don't have time for design.’ It is the most dangerous form.
(3) Inadvertent debt
This is debt that arises from a lack of experience, or that you only recognize after finishing the work, realizing ‘This is how we should have done it.’ It is also debt that is hard to avoid in the course of learning.
Note that even deliberate debt quickly turns into reckless debt if there is no plan to pay it back. Code that was meant to be ‘fixed later’ staying untouched for years is extremely common in software development.
In this way, technical debt is not something to be avoided at all costs but something to be managed, like a bank loan, by weighing when to take it on, how much, and how to repay it.
How to Manage and Pay Down Technical Debt

The most common way to pay down debt is refactoring. Refactoring means reshaping the structure of code so that it is easier to read and change, while leaving what the program does unchanged. Because nothing changes on the surface and the results are hard to see, it is crucial above all that developers and executives share an understanding of what the debt costs.
(1) Record the debt
Writing down the parts to fix later on a to-do list keeps them from being forgotten and lets you see at a glance how much has built up.
(2) Pay it down steadily, a little at a time
Setting aside part of development time and cleaning up a little every time keeps the interest from snowballing.
(3) Build a safety net with tests
Having automated tests in place lets you check right away whether anything else broke when you change the code, which makes paying down the debt less burdensome.
(4) Rebuild when the debt is too large
If debt has piled up so much that fixing it would cost more than building anew, gradually replacing the old system with a new one is another option. But because the cost and risk are high, the decision must be made carefully.
Technical debt uses the familiar language of debt to describe the reality of software development, where a balance between speed and quality must always be struck. Forgetting that you have taken on debt is a bigger problem than taking it on in the first place, and well-managed debt can actually become a springboard for rapid growth.
Remembering that the time you save today comes back as interest tomorrow: that is the first step toward healthy software.