Every software team knows the feeling. A change that should take an afternoon takes a week. Fixing one bug creates two more. Nobody wants to touch the billing module because “it works, somehow”.
That is technical debt collecting interest.
The term was coined by programmer Ward Cunningham in the early 1990s, and the comparison to financial debt is surprisingly exact. Borrowing isn’t bad in itself. It becomes dangerous when nobody tracks it and the interest quietly eats your budget.
What counts as technical debt?
Technical debt is any shortcut or outdated decision in a codebase that makes future changes slower or riskier. Common forms:
- Code debt: duplicated logic, giant functions, unclear names, no tests
- Architecture debt: components tangled together so one change ripples everywhere
- Dependency debt: frameworks and libraries several major versions behind, or no longer supported
- Infrastructure debt: manual deployments, servers configured by hand, no monitoring
- Documentation debt: knowledge that lives only in one person’s head
- Test debt: no automated tests, so every release depends on manual checking and luck
Not all of it was a mistake. Some debt is deliberate: you ship a simpler version to meet a launch date and plan to improve it later. Some is accidental: the team didn’t know a better approach at the time. And some is simply age: code that was good in 2019 is now on an unsupported framework.
Where the cost hides
Technical debt rarely shows up as a line item. It hides in other numbers.
Slower delivery. Developers spend more time understanding fragile code and working around it than writing new features. Estimates keep growing, and the business starts asking why “simple” requests take so long.
More bugs and outages. Code without tests and with tangled dependencies breaks in surprising places. Each incident costs engineering time, customer trust, and sometimes revenue.
Security exposure. Outdated dependencies are one of the most common sources of known vulnerabilities. An application stuck on an unsupported framework no longer receives security fixes at all.
Onboarding pain. New developers take months instead of weeks to become productive when the codebase is confusing and undocumented.
People leave. Good engineers don’t enjoy fighting the same fragile system every day. Losing them takes their knowledge with them, which makes the debt worse.
Missed opportunities. When the system can’t be changed quickly, the business stops proposing ideas that would need it to change. This cost is invisible, and often the largest.
How to measure something invisible
You can’t fix what you can’t describe. A few practical signals:
- Lead time: how long from starting a change to it running in production? Is it growing?
- Change failure rate: what share of deployments cause an incident or need a rollback?
- Time spent on unplanned work: bugs, hotfixes and firefighting as a percentage of the sprint.
- Hotspots: files that change very often and are large or complex. Version history makes these easy to find, and they’re where debt hurts most.
- Dependency age: how many major versions behind are your key frameworks? Are any out of support?
- Developer survey: ask the team which parts of the system slow them down most. They already know.
Track a few of these over time. A trend is more persuasive than a one-off number.
Explaining it to people who don’t write code
“We need to refactor” sounds like engineers wanting to polish their work. Translate it into business terms:
- “Every feature in the checkout area currently takes about twice as long as it should. Two weeks of cleanup would make the next ten features faster.”
- “We’re on a framework version that stops receiving security patches this year. Staying on it means accepting known vulnerabilities.”
- “We had four incidents last quarter from this module. Each one cost roughly a day of the team’s time and affected customers.”
Connect debt to speed, risk and money. That’s a conversation managers can make decisions about.
A practical plan to pay it down
The worst approach is the “big rewrite”: stopping all feature work for months to rebuild from scratch. Rewrites usually take far longer than planned, and the business loses patience halfway through. A steadier approach works better.
1. Make the debt visible
Keep a simple debt register: a list in your issue tracker of known problems, each with a short note on its impact and a rough effort estimate. If it isn’t written down, it won’t get prioritised.
2. Prioritise by pain, not by ugliness
Some ugly code is rarely touched and costs nothing. Focus on debt in hotspots: areas that change often and break often. Fixing those pays back quickly.
3. Reserve regular capacity
Many teams set aside a fixed share of each sprint, often somewhere around 15 to 20 percent, for debt reduction. Consistency matters more than the exact number. Small, regular payments beat occasional heroic efforts.
4. Follow the scout rule
“Leave the code a little better than you found it.” When working on a feature, tidy the code you’re touching: add a test, rename a confusing variable, extract a function. Over months this adds up.
5. Add tests before you refactor
Tests are the safety net that makes cleanup possible. For legacy code, start with tests that capture current behaviour, even if that behaviour is odd. Then change the code with confidence.
6. Strangle, don’t rewrite
For large legacy systems, use the strangler fig pattern: build new functionality in a new module or service, route traffic to it piece by piece, and retire the old parts gradually. The old system shrinks while the business keeps running.
7. Keep dependencies current
Schedule regular, small upgrades instead of one painful jump every five years. Tools like Dependabot or Renovate can open update pull requests automatically.
8. Stop adding new debt carelessly
Code reviews, a definition of done that includes tests, and automated linters prevent tomorrow’s debt. When you do take a deliberate shortcut, log it in the register with a plan to revisit it.
When debt is the right choice
It’s worth repeating: some debt is smart. A startup validating an idea should ship quickly and accept rough edges. A one-off campaign page doesn’t need perfect architecture. The skill is in choosing debt deliberately, recording it, and paying it off before the interest becomes unbearable.
Final word
Technical debt is a normal part of building software. The danger isn’t having it. It’s ignoring it until delivery slows to a crawl, outages pile up and your best developers update their CVs.
Make it visible, talk about it in business terms, pay it down steadily, and avoid both extremes: the codebase nobody dares to touch, and the rewrite that never ends.
Leave a Comment