What Is Technical Debt? How to Measure and Pay It Down (2026)
A working guide to technical debt - what it is, the four types, how tools quantify it in hours and money, and a practical playbook for paying it down in review.
Published:
What is technical debt?
Technical debt is the implied future cost of choosing a quick or easy solution today instead of a better approach that would take more time. The term was coined by Ward Cunningham, one of the authors of the Agile Manifesto, who used the financial metaphor to explain to stakeholders why shipping imperfect code now creates a repayment obligation later. Just like a loan, the shortcut lets you move faster immediately, but you pay interest on it - every future change to that code takes a little longer than it should.
The metaphor is powerful because it reframes a fuzzy engineering concern in terms non-engineers understand. “The code is messy” gets ignored in a planning meeting. “We are paying roughly two extra days per sprint servicing debt in the billing module” gets budget. That translation is exactly what modern tooling makes possible, by turning technical debt from a feeling into a number.
Technical debt is not the same as bad code
A common misconception is that technical debt means sloppy work. It does not. Some of the most damaging debt comes from code that was excellent for the requirements it was written against, and only became debt when the requirements changed. A clean, well-tested module built around an assumption that later proved wrong is now debt - not because anyone was careless, but because the world moved.
This is why blame is the wrong lens. Debt is a normal byproduct of building software under uncertainty. The engineering discipline is not avoiding debt entirely - that is impossible - but making it visible and deciding deliberately when to repay it.
The four types of technical debt
Martin Fowler’s technical debt quadrant is the most useful model because it separates the debt worth taking from the debt worth avoiding. It classifies debt along two axes - deliberate versus inadvertent, and prudent versus reckless.
| Prudent | Reckless | |
|---|---|---|
| Deliberate | ”We must ship now and will deal with the consequences" | "We do not have time for design” |
| Inadvertent | ”Now we know how we should have done it" | "What is layering?” |
- Deliberate and prudent is the healthy kind - a conscious tradeoff to hit a deadline, made with a plan to repay.
- Deliberate and reckless is skipping known-good practice under pressure with no repayment plan.
- Inadvertent and prudent is the debt you only recognize after you have learned more about the problem.
- Inadvertent and reckless comes from not knowing better practice exists.
Beyond intent, debt is also grouped by source - code debt (the code smells and complexity in day-to-day source), architecture debt (structural decisions that constrain the whole system), test debt (missing or brittle coverage), and documentation debt. Code and test debt are the kinds automated tools measure best.
How tools quantify technical debt
The breakthrough of platforms like SonarQube was to attach a concrete remediation cost to each issue. If a rule violation is estimated to take five minutes to fix, and you have 400 of them, you have roughly 33 hours of debt. Sum that across the codebase and you get a total. Two derived numbers make it actionable.
The technical debt ratio is remediation cost divided by the estimated cost of building the code from scratch. A 5 percent ratio means you would spend five cents servicing debt for every dollar the code took to write - generally healthy. A 20 percent ratio is a warning. This ratio, along with the maintainability index, is what quality dashboards trend over time.
SonarQube is the reference implementation here. It reports total remediation effort in hours, a debt ratio, and a maintainability rating from A to E, and its quality gates can block a merge that would push new code past your debt threshold. Because the estimate is derived from its 6,000-plus rules, the number is consistent enough to trend across quarters.
CodeScene adds a dimension SonarQube lacks - change frequency. It combines code health with how often each file is edited to prioritize debt by business impact, so you fix the complex file everyone touches daily rather than the complex file nobody has opened in a year. That behavioral prioritization is the single most useful upgrade to raw debt counting.
Codacy aggregates duplication, complexity, and coverage debt across 49 languages with quality gates, and DeepSource surfaces anti-pattern debt with Autofix so a slice of it can be repaid in one click. For the wider landscape, see our best code quality tools guide.
A playbook for paying down technical debt
Measuring debt is worthless if you never repay it. These practices keep the balance from compounding.
- Gate new debt, do not just measure old debt. Configure a quality gate on new code - block merges that introduce complexity, duplication, or coverage regressions above a limit. Stopping the bleeding matters more than any cleanup sprint.
- Use the campground rule. Ask engineers to leave each file slightly better than they found it whenever they are already editing it. Continuous small repayment beats a dedicated “debt sprint” that gets cut when a deadline appears.
- Prioritize by interest, not by size. The debt worth repaying first is the debt in code that changes often. A messy but stable module charges almost no interest. Tools like CodeScene make this ranking explicit.
- Make it visible to non-engineers. Bring the debt ratio and remediation hours into planning. When leadership can see the number moving, allocating time to repay it becomes a normal budgeting decision instead of a fight.
- Repay debt as part of feature work. The cheapest time to refactor a module is when you are already changing it for a feature. Bundle the refactoring into the same pull request and review it together.
The teams that stay healthy are not the ones with zero debt - they are the ones who gate new debt and repay old debt continuously as a normal part of shipping.
Common mistakes with technical debt
- Treating all debt as urgent. Debt in rarely touched code can be safely ignored. Chasing every issue wastes time you could spend on high-interest debt.
- Never repaying deliberate debt. A shortcut with no follow-up ticket is how prudent debt turns reckless.
- Measuring without gating. A dashboard that only grows demoralizes teams. Pair measurement with a quality gate that prevents new debt.
- Confusing debt with bugs. Debt makes future bugs more likely but is not itself a defect - track and prioritize the two separately, as you would in any solid code review process.
Conclusion
Technical debt is the interest you pay on yesterday’s shortcuts, and like financial debt it is a tool - useful when taken on deliberately and repaid on schedule, dangerous when hidden and left to compound. Make it visible with a platform like SonarQube or CodeScene, gate new debt at the pull request, prioritize repayment by how often the code changes, and fold refactoring into ordinary feature work. Do that and debt stops being a slow-motion crisis and becomes just another line item you manage.
Further reading
- What Are Code Smells?
- Best Code Quality Tools in 2026
- What Is Cyclomatic Complexity?
- Code Review Best Practices
Further Reading
GitarComments are not enough
Gitar applies the fix, validates it in CI, and clears the queue.
See it on your repo Read our independent Gitar reviewFrequently Asked Questions
What is technical debt in simple terms?
Technical debt is the future cost you take on when you choose a fast or easy solution now instead of a better one that would take longer. Like financial debt, it accrues interest - every extra day the shortcut stays in place, the code is a little harder to change, so future work takes longer. The metaphor was coined by Ward Cunningham, who created it to explain shipping decisions to non-technical stakeholders.
What are the types of technical debt?
A common framing is Martin Fowler's technical debt quadrant, which splits debt by whether it was taken on deliberately or inadvertently, and prudently or recklessly. That gives four types - deliberate and prudent (a conscious tradeoff to ship), deliberate and reckless (skipping design under pressure), inadvertent and prudent (learning a better approach after the fact), and inadvertent and reckless (not knowing good practice existed). Debt is also categorized by source - code, architecture, test, and documentation debt.
How is technical debt measured?
Tools estimate technical debt by assigning a remediation cost to each issue - roughly how long it would take to fix - and summing them. SonarQube reports this as a total remediation time and a technical debt ratio, which is remediation cost divided by the cost of rewriting the code from scratch. CodeScene prioritizes debt by combining code health with how often each file changes, so you fix the debt that actually slows you down.
Is technical debt always bad?
No. Deliberate, prudent debt is a legitimate engineering tool - shipping a simpler version to validate an idea and refactoring later can be the right call. Debt only becomes harmful when it is taken on recklessly, never tracked, or never repaid. The problem is rarely the debt itself and almost always the failure to make it visible and pay it down before the interest compounds.
Explore More
Tool Reviews
Free Newsletter
Stay ahead with AI dev tools
Weekly insights on AI code review, static analysis, and developer productivity. No spam, unsubscribe anytime.
Join developers getting weekly AI tool insights.
Related Articles
Is CodeRabbit Free for Open Source? Yes - And for Private Repos Too
CodeRabbit's free tier covers unlimited public and private repositories, not just open source. Here is exactly what the free plan includes, where the rate limits bite, and when to pay.
July 31, 2026
guideIs SonarLint Deprecated? No - Here's What Actually Happened
SonarLint was not deprecated. It was renamed to SonarQube for IDE on October 29, 2024, as part of a company-wide rebrand. Here is what changed, what did not, and what to install.
July 31, 2026
guideIs Semgrep Free for Commercial Use? Yes, With Two Catches
Semgrep Community Edition is LGPL-2.1 and free for commercial use. The paid tier is also free up to 10 contributors. Here is where the line actually falls and what you give up.
July 31, 2026
SonarQube Review
CodeScene Review
Codacy Review
DeepSource Review