Hasina Razafintsalama

Hasina RAZAFINTSALAMA

← Back to Blog
Engineering

Technical Debt: How to Measure and Reduce It

Technical debt is inevitable. The problem is when it becomes invisible. Here is how to quantify it, prioritize it, and chip away at it without stopping feature delivery.

2026-04-20·7 min

Technical debt is not always bad,sometimes you take it intentionally to ship faster. The problem is unintentional, invisible debt that silently drags down every sprint. The goal is not zero debt, but managed, visible debt.

How to measure it

  • Static analysis: tools like PHPStan, ESLint, SonarQube give a quantified score. Run them in CI.
  • Test coverage: below 60% is a risk signal. Coverage alone does not equal quality, but zero coverage is always a problem.
  • Cyclomatic complexity: functions with complexity > 10 are hard to test and maintain. Refactor them.
  • Time to onboard: how long does it take a new developer to make their first meaningful PR? High debt = high onboarding time.
  • Bug recurrence rate: the same module breaking repeatedly signals structural issues.

Prioritization: the effort/impact matrix

Not all debt is worth fixing now. Prioritize using two axes: business impact (does this area affect critical paths?) and fix effort (how hard is this to fix?). High-impact, low-effort fixes go first. High-effort, low-impact fixes wait,or get deleted.

The Boy Scout Rule: leave the code cleaner than you found it. You do not need dedicated refactoring sprints,make small improvements part of every ticket. Rename a confusing variable. Extract a duplicated function. Add a missing test.

Making debt visible to stakeholders

Stakeholders do not fund "refactoring",they fund outcomes. Frame debt reduction in terms of delivery speed ("fixing this will cut our release cycle by 30%") and risk reduction ("this module has no tests and accounts for 40% of our incidents"). That is a language that gets budget.

  • Add debt items to your backlog with business impact estimates
  • Track a "debt ratio": number of debt tickets vs feature tickets per sprint
  • Set a policy: 20% of every sprint goes to debt,protect it

Need help with this topic? Technical Audit

Discover this service