Technical debt: measure where it hurts, fix the busiest code first

Technical debt is the extra effort every change costs because of past shortcuts. Reduce it by measuring where it hurts, such as slow releases, failed deploys and fragile modules, then fixing the worst, most-changed areas inside normal work. AI coding tools can speed up tests and refactors, but they can also add duplicate code, so review everything.

Where the term comes from

Ward Cunningham introduced the debt metaphor in a 1992 experience report: shipping first-time code is like going into debt, a little debt speeds development if it is paid back promptly, and every minute spent on not-quite-right code counts as interest (https://c2.com/doc/oopsla92.html).

Martin Fowler describes the interest as the extra effort it takes to add new features. In his example, a feature that would take four days in clean code takes six because of a confusing module structure (https://martinfowler.com/bliki/TechnicalDebt.html).

Fix the code you change most

Fowler points out that messy but stable code can often be left alone, because you only pay the interest when you work in it. Areas that change often deserve a zero-tolerance attitude, and paying the debt down gradually, as you work in those areas, puts the effort where it matters most (https://martinfowler.com/bliki/TechnicalDebt.html).

Measure it with delivery numbers

Debt shows up as slower, riskier delivery. DORA's software delivery metrics are change lead time, deployment frequency, failed deployment recovery time, change fail rate and deployment rework rate (https://dora.dev/guides/dora-metrics/).

DORA recommends applying them to one application or service at a time and warns against turning them into targets that teams game (https://dora.dev/guides/dora-metrics/). Add your own signals: which modules cause incidents, which files change most, and where estimates keep slipping.

Will AI tools add debt?

They can. DORA's 2024 report found AI adoption raised individual productivity but hurt software delivery stability and throughput, and said fundamentals like small batch sizes and robust testing remain crucial (https://dora.dev/research/2024/dora-report/).

GitClear, a code-analytics vendor, analyzed 211 million changed lines from 2020 to 2024. It reported that changed lines associated with refactoring fell from 25% in 2021 to under 10% in 2024, while copy/pasted lines rose from 8.3% to 12.3% over the same period (https://www.gitclear.com/ai_assistant_code_quality_2025_research). That is a trend across many codebases, not proof about yours, but it is worth checking.

AI can also pay debt down. Google's report on LLM-assisted code migrations describes cleaning up stale experiment flags and moving old tests it calls technical debt to a newer library, with automatic builds, tests and human review on every change (https://arxiv.org/abs/2501.06972).

A practical plan

  1. List the pain. Collect the modules and processes that slow releases or cause incidents.
  2. Rank by change and impact. Fix code that changes often and matters to the business first.
  3. Fix it inside normal work. Budget a share of each sprint for the areas you are already touching.
  4. Use AI with guardrails. Let AI draft tests and repetitive refactors, keep changes small and review every one.
  5. Re-measure. Check the same delivery metrics each month to see whether the work is paying off.

Where we come in

We help teams find the debt that actually slows them down and fix it without stopping feature work. See fractional CTO services, legacy system modernization with AI, signs you need a fractional CTO and the startup CTO roadmap.

FAQ

What is technical debt?

The extra work every change takes because of past shortcuts or code that no longer fits. Ward Cunningham introduced the term in 1992.

How much technical debt is normal?

Some is normal and can be a fair trade for speed. It becomes a problem when it keeps slowing releases or causing failures in code you change often.

How do you measure technical debt?

Track delivery: lead time, deployment frequency, change fail rate and recovery time, plus which modules cause incidents and slow work down.

Will AI coding tools add technical debt?

They can, through duplicate or unreviewed code. Keep changes small, keep tests strong and review AI-written code like any other code.

Should we pause features to pay down debt?

Rarely. Fix debt in the areas you are already changing, as part of normal work, so features keep shipping.

Who is CTO.LA?

CTO.LA is a technology and AI consulting firm in Beverly Hills, California, founded in 2025. Reach us at hello@cto.la.

Sources

Book a call