In 1992, a programmer named Ward Cunningham was preparing to give a talk about his work on financial software. He needed a way to explain to non-technical colleagues why the team kept needing time to go back and rework old code even when there were no visible bugs.

Why, if everything was working, did older parts of the codebase slow everything down?

He reached for a financial metaphor: technical debt.

Cunningham said that shipping first-time code is like taking on debt. A little debt speeds up development as long as it gets repaid quickly with a rewrite and the danger is when the debt is not repaid. Every minute spent on code that is not quite right counts as interest on that debt.

The metaphor was apt enough to spread beyond its original context and become one of the most widely used concepts in software engineering, and increasingly, in any knowledge work involving accumulated systems and decisions.


What Is Technical Debt?

Technical debt is the implied cost of choosing a faster, simpler or more convenient solution in software development over the architecturally correct one. Like financial debt, it incurs interest. As the suboptimal code remains in place, every future piece of development that touches it takes longer than it would in a clean codebase.

Technical debt is not always a mistake. Cunningham made it clear that the debt metaphor means taking on debt as a deliberate business decision. It is getting something to market faster by taking a shortcut with the intention of repaying it through refactoring.

When the debt is not acknowledged, not tracked and never paid back, the danger is that it builds up unseen until it becomes the main cost of software development.

"With borrowed money you can do something sooner than you might otherwise, but until you pay back that money you'll be paying interest. Shipping first-time code is like going into debt."

(Ward Cunningham)

Remarkably durable as a concept, it captures a real and universal tension in software development between speed now and cost later and has proved durable. Every codebase of any meaningful size comes with some technical debt. The question is not whether debt exists but whether it is being managed intelligently.


Types of Technical Debt

The most useful taxonomy of technical debt comes from a framework developed by software consultant Martin Fowler, who proposed a technical debt quadrant organizing debt along two dimensions: deliberate versus inadvertent, and reckless versus prudent.

Reckless
Prudent
Deliberate
"We don't have time for design"
"We must ship now and deal with consequences later"
Inadvertent
"What's layering?"
"Now we know how we should have done it"

Deliberate-Reckless Debt

This is debt taken on with awareness but without a real plan to address it: dismissing good practice knowingly. "We don't have time to write tests" or "let's just hardcode this for now" with no intention of revisiting.

This is the category most associated with poor engineering culture and short-term thinking that creates long-term costs.

Because it is invisible to management and gets normalized in teams operating under persistent deadline pressure, this kind of debt does particular damage. Once recklessness becomes habitual, developers stop viewing it as a trade-off at all and it becomes how code is written.

Deliberate-Prudent Debt

The original Cunningham scenario was to accept a known shortcut that speeds delivery and have an explicit plan to go back and refactor. Used with genuine intention to follow through, this is a legitimate business tool.

Startups validating a product idea may deliberately build a rough first version knowing it will need to be rebuilt once the idea is proven.

What makes the difference is the plan. Deliberate-prudent debt gets documented, tracked and given a specific window for repayment. The quote "We are hardcoding these values to ship by Thursday and we will make them configurable in the next sprint" is debt with a plan. Debt without that specificity tends to go on indefinitely.

Inadvertent-Prudent Debt

At the time, you did not know that your design was suboptimal. Later experience, new requirements or a better grasp of the domain reveals the limitation. Good software engineers learn as they build and that is normal. The debt is not irresponsible. It is the cost of developing knowledge iteratively.

A common example: a data model designed for a single-tenant application that must later support multiple tenants. The original design was not wrong given the original requirements; it has become limiting as requirements evolved.

Inadvertent-Reckless Debt

This is debt written by developers who did not know better and were not aware of the design principles, patterns or language features that would have given better-structured code.

This category is often the most insidious because it is invisible: neither the author nor the team recognizes that the code is suboptimal until problems compound enough to reveal it.

Debt of this kind often shows up when a team scales fast and brings on junior developers who have had little exposure to software design principles or when senior engineers are stretched too thin to give proper mentorship and code review.


The Real Cost of Technical Debt: What the Numbers Say

It is hard to turn abstract arguments about code quality into business decisions. Research that shows the actual cost of technical debt makes the case more concretely.

A 2020 McKinsey & Company survey of CIOs at large enterprises found they estimated technical debt at 20-40% of the value of their entire technology estate. The same survey found that 10 to 20% of the technology budget meant for new products was diverted to resolving issues related to technical debt.

The Consortium for IT Software Quality (CISQ) has attempted to quantify technical debt at the industry level. Their 2022 report estimated that the cost of poor software quality in the US alone reached $2.41 trillion in 2022, with a significant portion attributable to technical debt.

Research has looked at the relationship between code quality metrics and development speed at a more granular level. Development velocity turns out to be much lower in codebases that are heavily indebted than it is in comparable clean codebases.

Put another way: a team maintaining a severely indebted system can be doing twice as much work for half the output of a team working in a well-maintained codebase.

These numbers help explain why technical debt management has moved from a developer concern to an executive concern at major software organizations. When debt is costing 30 cents of every development dollar, it belongs on the CFO's agenda, not just the CTO's.


How Technical Debt Compounds

The financial debt metaphor also applies to compounding. Code that is poorly structured or weakly tested does not just add a fixed cost, because it tends to get worse over time.

Increasing complexity of future work

Poorly structured code is harder to understand. Each developer who needs to work with it must spend time reconstructing what it does before they can modify it safely. This understanding cost compounds as the team grows, as personnel turn over, and as the code itself changes.

Research on program comprehension suggests that developers reading unfamiliar code take substantial time to understand it well enough to modify it confidently to understand it well enough to modify it confidently.

When a codebase is heavily in debt, the understanding phase takes much longer because the code does not follow any recognizable patterns and has implicit rather than explicit dependencies.

Bug amplification

Suboptimal code is more fragile. Changes made in one place have unintended effects elsewhere because dependencies are implicit rather than designed. Bug rates in heavily indebted codebases are consistently higher, and fixing bugs in those codebases takes longer and is more likely to introduce new bugs.

The "fragile base class" problem is a well-documented instance of this: modifying a base class in an inheritance hierarchy can break subclasses in ways that are invisible until runtime. The more interconnected and less documented the code, the more unpredictable the effects of any change.

Workaround proliferation

Where clean modification is hard for code, developers most often write workarounds instead of fixing the underlying structure. That adds more code, more complexity and more debt and that is a compounding spiral.

A common pattern: a developer needs to extend a class but cannot do so cleanly without risk, so they duplicate the logic instead. Now there are two copies of the same logic. Both eventually need to be changed. Both get out of sync. Both become sources of bugs.

An isolated shortcut that started out has built up a maintenance burden that will last longer than the original developer.

Developer morale and attrition

Studies and industry surveys repeatedly show that developing in a highly indebted codebase drives much of what makes developers dissatisfied. The Stack Overflow Developer Survey time after time points to poor code quality and technical debt as major sources of frustration.

Technical debt came out as one of the top sources that developers cited for frustration in the 2023 survey.

Direct replacement costs as well as knowledge loss make developer turnover costly and that adds to the debt. It takes 1.5 to 2 times the annual salary, when recruiting, onboarding and getting productivity back up are accounted for, to replace a software developer at what the industry estimates as the average cost.

Where knowledge is poorly documented and heavily implicit, the cost goes up even more in a codebase.


Measuring Technical Debt

Debt cannot be managed without being measured. Several approaches exist:

Static code analysis

Automatically scanning codebases, tools such as SonarQube, CodeClimate and Checkmarx spot problems including code smells, duplicate code, functions that have grown too complex to maintain and inadequate test coverage as well as security holes. Developer hours are estimated for how long it will take to fix the issues that get identified.

As a percentage of what it would cost to build the whole application from scratch, the SonarQube technical debt ratio measures debt that way. When the ratio stays below 5%, the codebase is generally seen as manageable. At 10% and above, the codebase becomes problematic and above 20% it points to fundamental structural problems.

Technical Debt RatioAssessmentRecommended Action
0-5%HealthyMaintain current practices
5-10%ModerateMonitor; add debt items to backlog
10-20%HighAllocate dedicated remediation time
20%+CriticalConsider architecture-level intervention

Developer surveys

Developers feel friction, confusion and a slowdown that no static analyzer picks up and quantitative tools fail to capture the subjective experience of working with code. Automated measurement gets complemented by regular developer surveys that ask about friction, confidence in changing code and time lost to workarounds.

Questions to include in a developer debt survey:

  • How confident do you feel making changes in the area of the codebase you work in most?
  • How much of your time do you estimate goes into working around problems in existing code quality?
  • Which parts of the codebase cause you the most slowdown?
  • What would most improve your development velocity?

Lead time and cycle time tracking

When development slows down and the average time from starting a feature to shipping it grows longer, that slowdown most often shows accumulated technical debt. Measuring velocity over time gives an organizational signal even without going deep into technical metrics.

Agile teams can use story points per sprint as a proxy metric to track. Velocity that drops gradually without any change to team size or scope complexity is a strong signal that debt is building up.

DORA (DevOps Research and Assessment) metrics provide a richer picture of codebase health. These include deployment frequency, lead time for changes, change failure rate and time to restore service.

The SQALE method

In business terms, the Software Quality Assessment based on Lifecycle Expectations gives a way to express debt as developer days required to get the codebase up to a set quality standard.

Tools including SonarQube now include SQALE and the result is a normalized metric that allows comparisons across codebases as well as tracking over time.


When to Pay Down Technical Debt

Technical debt management comes down to this basic question. When do you spend on fixing existing code versus keeping up with new features and both approaches have value and both fight for the same developer time.

A useful framework considers three factors:

1. The blast radius. The blast radius measures how much of future development this debt affects. When debt sits in a core data model or a critical service boundary that every feature has to touch, it has a high blast radius. Debt in an isolated module used by one small feature has a low blast radius and high-blast-radius debt calls for investment as a priority.

2. The velocity tax: is this debt actively slowing current development, or is it in parts of the codebase that are rarely touched? Track which files and modules are most frequently the source of bugs or require the most time in code review. This identifies where debt is costing most in practice.

3. The window of opportunity: some debt is cheapest to pay when a team is already in a module for other reasons. The boy scout rule (leave the code cleaner than you found it) applies this principle: whenever you touch existing code, make incremental improvements even when they are not the primary goal of the change.

Allocation strategies

Experienced engineering teams typically use one of several approaches:

The 20% rule. Set aside a fixed amount (most often 20%) of each sprint or each quarter for debt reduction alone and apart from feature work. Doing this gives a predictable, sustainable way to service debt that stops debt building up and keeps features coming out.

Debt sprints: periodic full sprints dedicated entirely to improving code quality, test coverage, and architectural structure. These create momentum and allow larger refactoring that cannot be done incrementally.

Architecture-driven refactoring: when planning a significant new feature or system change, include the cost of addressing the debt that would otherwise impede it. This makes debt reduction a means to an end that the business can directly evaluate.

Communicating technical debt to non-technical stakeholders

One of the persistent challenges of technical debt management is making the case to business stakeholders who do not experience the code directly. The most effective approaches:

Translate to business metrics. "Because of its complexity, this module causes about 3 extra engineering hours per feature and that is more persuasive than "the code quality score is low."

Use historical data: "The last four production incidents were all in this part of the codebase" makes the risk concrete.

Show velocity impact. Sprint-over-sprint velocity charts that decline over time make the slowing effect of debt visible to product and business leaders.

Estimate the ROI of remediation. "Put 2 weeks into this refactoring and it is estimated that 30 minutes per feature in this area will be saved. With our feature delivery rate, that pays back in about 6 months."


Refactoring: Paying Down the Debt

Refactoring is the practice of making the internal structure of existing code better without changing its external behavior. Paying down technical debt mainly happens through refactoring.

Refactoring patterns in Martin Fowler's catalog give a vocabulary for common improvement moves. These are extracting a method from a long function, replacing a conditional with polymorphism, bringing in a design pattern and getting rid of duplicated code by abstraction.

Effective refactoring requires:

Comprehensive test coverage: you cannot safely change code structure if you do not have tests that would catch behavioral regressions. This is why technical debt and insufficient testing compound: the debt makes refactoring risky, and the risk makes teams reluctant to refactor.

Small, incremental steps: large rewrites are high-risk and often fail. Systems that worked imperfectly are replaced by systems that do not work at all. The principle of incremental refactoring, improving the codebase continuously in small steps rather than periodically in large rewrites, is now well-established.

Team alignment. Without team buy-in, refactoring by individuals can create friction and shared standards, agreed-upon patterns and team ownership of code quality decisions make refactoring sustainable.

Common refactoring patterns

Some of the most frequently applied refactoring moves from Fowler's catalog:

RefactoringProblem SolvedExample
Extract MethodFunction is too long or doing too many thingsPull a section of a 200-line function into its own named method
Replace Magic NumberUnexplained numeric or string literalsReplace if status == 3 with if status == STATUS_CANCELLED
Extract ClassClass has too many responsibilitiesMove email-sending logic from UserService into a dedicated EmailService
Replace Conditional with PolymorphismLong if/else chains switching on object typeGive each shape an area() method instead of a giant calculateArea(shape) function
Introduce Parameter ObjectMultiple related parameters passed togetherGroup start_date and end_date into a DateRange object
Remove DuplicationSame logic appears in multiple placesExtract to a shared utility function

The "big rewrite" temptation

One of the most common and costly technical decisions is the big rewrite: starting over from scratch because the existing codebase has become so burdened with debt that incremental improvement seems impossible.

Starting over with a rewrite does make sense from time to time, such as when the old architecture no longer fits current needs at all, when the underlying technology platform has reached end-of-life or when the codebase is. Badly damaged that almost nobody can make sense of it.

Rewrites most often fail or fall short of what was expected. In 2000, Joel Spolsky's influential essay "Things You Should Never Do, Part I" described how Netscape's choice to start rewriting its browser from scratch in 1998 gave ground to Internet Explorer through years of development and helped bring about Netscape's eventual collapse.[1]

The lesson is that "when you throw away code and start from scratch, you are throwing away all the knowledge that has built up in that existing code."

Bad code costs businesses about $85 billion a year in lost productivity as per Stripe's 2018 Developer Coefficient report. Disciplined incremental improvement most often gets back that time more reliably and with less risk instead of a full rewrite at once.


Technical Debt in Practice: Real-World Examples

Amazon's approach to the two-pizza team and service decomposition

Amazon's famous "two-pizza team" rule (teams should be small enough to be fed by two pizzas) was partly a response to accumulated technical debt in large, tightly coupled codebases.

When the system was broken down into small owned services, each team could keep its service's quality up without the coordination overhead that makes large codebases unmanageable.

Amazon's transition to what became AWS was in part a debt-paying exercise: externalizing internal infrastructure forced its teams to clean up interfaces and documentation.

The Healthcare.gov launch failure of 2013

One of the most publicized software failures in US history was the 2013 launch of Healthcare.gov. Technical debt consisting of compressed timelines, insufficient testing and coordination failures among many contractors combined with governance failures were what the post-mortems identified.

Significant debt repayment under pressure drove the rescue operation that followed, refactoring while the whole world watched and political pressure bore down. Recovery took about two months to complete (the site was mostly working by December 2013). It was the work of a small, high-quality team that was given the power to make technical decisions quickly.

Twitter's technical debt and the X transition

Engineers knew internally that Twitter's codebase carried large technical debt built up during the company's rapid growth phase. When Elon Musk bought the platform in 2022 and went on to make major staff cuts, what was left behind was a complex system on which the remaining team had less institutional knowledge to work.

From 2023 through outages and reliability problems that resulted, the instability showed concretely how debt becomes riskiest once the human knowledge needed to get through it is lost.


Technical Debt Beyond Software

Beyond software engineering, the technical debt metaphor has gone on to describe similar dynamics in any complex system that is built incrementally.

Data technical debt. Databases, data pipelines and data models build up their own kind of technical debt through inconsistent schemas, undocumented transformations and dependencies on deprecated data sources. Data debt can cost as much as code debt and most often proves harder to spot.

A poorly designed data model that must be maintained over years, growing more tables and more implicit relationships with each feature addition, is a form of data debt with interest that compounds every time an analyst must understand the schema.

Documentation debt. Systems that work but have their operation undocumented carry real debt. Every developer who touches them bears again and again the cost of figuring out how to operate, modify or debug them.

One of the top sources of developer frustration from the 2020 Stack Overflow developer survey was inadequate documentation. The survey rated it more frustrating even than the debugging process itself.

Organizational technical debt: processes, organizational structures, and team designs optimized for past contexts but maintained after those contexts change.

A team structure designed for a monolithic application may be a form of organizational debt when the architecture has shifted to microservices. Approval processes designed when the team had five developers become bottlenecks at fifty.

Infrastructure debt. Without any discipline, servers, cloud configurations and deployment pipelines have built up as infrastructure debt. Systems that go unpatched, infrastructure set up manually that cannot be reproduced and deployment processes known only to one person carry real security and reliability costs as infrastructure debt.


Prevention: Avoiding Unnecessary Debt

The most cost-effective debt management is avoiding unnecessary debt in the first place.

Code review: peer review of code before it is merged catches quality issues before they become part of the accepted codebase. Review is most valuable for catching structural problems, not just bugs. Well-run code review includes discussion of design choices, not just correction of errors.

Automated testing. Test-driven development that writes tests before writing production code gives more testable designs and makes sure coverage gets built as the code gets built and not tacked on later under time pressure.

When debt does build up, teams that have high test coverage can refactor more safely and quickly and that brings down the cost of paying down debt.

Architectural decision records (ADRs). By documenting the reasoning behind major technical choices, deliberate-prudent debt becomes explicit in architectural decision records. Future developers see that the decision was intentional and they grasp the trade-offs that were considered.

ADRs also stop teams from arguing over old decisions again and make it easier to see when conditions have shifted enough to revisit an earlier choice.

Agreed standards and linting. Automated enforcement of style and quality standards cuts inadvertent-reckless debt by catching common problems before they get committed. Tools like ESLint, Pylint and RuboCop enforce agreed standards without requiring human review time.

Definition of done: explicitly including code quality criteria in the team's definition of what it means for a story to be "done" prevents debt accumulation by making quality a completion criterion rather than an optional add-on.


Conclusion

Technical debt is real, it compounds and it is expensive. Developers who take over codebases heavily in debt know this deep down. They see it in the time spent figuring out code that is incomprehensible and in the bugs created by modifying systems that are fragile. They see it too in the slowdown that makes it feel more and more difficult to deliver features.

Managing it well requires first making it visible by measuring it, tracking it and building shared team understanding of where it is concentrated and what it costs.

Treating it as a legitimate item on the development agenda comes next instead of just feature requests and bug fixes, it calls for ongoing investment in the quality of the systems on which future work depends.

Sustainable teams most often treat codebase quality as an ongoing practice instead of a one-time project. A codebase kept in good shape by regular maintenance is much easier to maintain than one allowed to gather debt until it becomes a crisis. That approach is like how a garden or a financial portfolio fares.

Investment returns are supported by the numbers. Active management of technical debt brings teams faster delivery, fewer bugs, higher developer satisfaction and more reliable systems.

Organizations that ignore it find themselves spending increasing proportions of their IT budget on maintenance rather than innovation, until the debt becomes the primary story of the engineering organization.

Ward Cunningham coined the metaphor more than three decades ago. The best response remains the same. Acknowledge the debt, track it honestly and pay it down deliberately before the interest overwhelms the organization's capacity to build.

Sources and Further Reading

  1. Spolsky, J. (2000). Things You Should Never Do, Part I. Joel on Software.