Support & Maintenance

Technical Debt: How to Spot It, Measure It and Pay It Down

Technical debt is not always bad, but unmanaged debt slows every release. How to spot it, measure it, decide what to fix first and refactor safely.

  • DivTech editorial team
  • 7 min read
Fix nowPlan a projectFix in passingLeave and watch
Support & Maintenance · part 4 of 5

Every software team takes shortcuts. Some are smart: shipping a simple version to test demand before building the scalable one. Others are accidental: a design that made sense three years ago and now gets in the way of everything. The term 'technical debt', coined by Ward Cunningham, describes the result. The 'interest' is the extra time every future change costs until the debt is repaid.

Debt is not a failure in itself. Unmanaged debt is. This guide shows how to recognise it, measure it in ways leaders can understand, decide what to pay first and refactor without breaking production. Paying down debt is a large part of preventive work in our support and maintenance service.

Deliberate vs accidental debt

Martin Fowler's well-known technical debt quadrant sorts debt along two lines: was it deliberate or inadvertent, and was it prudent or reckless? 'We will ship this simple version now and refactor after launch' is deliberate and prudent, as long as the refactoring is actually planned. 'We have no time for tests' is deliberate and reckless. 'Now we know how this should have been designed' is inadvertent and prudent; every team that learns ends up with some of it. Inadvertent, reckless debt comes from a team that did not know better practices, and it is the hardest to spot from the inside.

Two things are often confused with debt. A missing feature is not debt; it is scope. A bug is a defect, although debt makes bugs more likely and harder to fix. Keeping these separate stops the debt list from becoming a second product backlog.

Types of technical debt

Debt is not only messy code. It builds up in architecture, dependencies, tests, infrastructure, knowledge and data. Naming the type helps you pick the right fix.

TypeWhat it looks likeTypical symptom
Code debtDuplicated logic, very large classes, unclear namingSmall changes touch many files
Architecture debtTight coupling, modules sharing tables, wrong service boundariesOne part cannot be released without the others
Dependency debtOutdated frameworks, unsupported runtime versionsSecurity patches need a big upgrade first
Test debtLow or flaky automated test coverageLong manual regression before every release
Infrastructure debtManual deployments, servers configured by handReleases take a day; environments behave differently
Knowledge debtUndocumented decisions, one expert per areaOnboarding takes months; holidays are risky
Data debtInconsistent schemas, duplicate or conflicting recordsTwo reports show different totals

Symptoms: how to spot technical debt

  • Estimates for similar features keep growing, release after release.
  • Fixing one bug regularly creates another somewhere else.
  • Releases become less frequent and more stressful, with long code freezes.
  • Developers avoid certain modules, or only one person dares to touch them.
  • New team members take a long time to make their first meaningful change.
  • Incidents cluster around the same few components.
  • A routine upgrade, such as moving off an unsupported Node.js version, turns into a multi-month project.

How to measure technical debt

No single number captures technical debt, and tools that claim to express it in days or dollars should be treated as rough indicators. Combine four kinds of signal instead.

  • Delivery signals: lead time for changes and change failure rate, two of the DORA metrics. Rising lead time on a stable team often means rising debt.
  • Code signals: static analysis for complexity, duplication and code smells (for example SonarQube), test coverage trends, and dependency checks such as Dependabot, Renovate or npm audit for outdated or vulnerable packages.
  • Hotspots: files that are both complex and changed often, found by combining complexity scores with version control history. Debt in code nobody touches costs little; debt in hotspots costs every sprint.
  • Team signals: a short survey every quarter asking which areas slow people down most. Developers usually know exactly where the debt is.

Production data adds a fifth view. Incident counts, slow endpoints and error hotspots from your application monitoring show where debt is already costing users, not only developers.

Keep the results in a simple debt register: each item with its location, type, a description of the pain it causes, a rough fix estimate and an owner. A register turns vague complaints into a list the business can prioritise.

Prioritising: which debt to pay first

decision matrixPrioritising technical debt
Low business pain to High business pain →
Fix now

High pain, low cost. Quick wins such as a missing index, a flaky test or a manual deployment step. Schedule them this sprint.

Plan a project

High pain, high cost. Write a short business case, break it into stages and fund it like a feature.

Fix in passing

Low pain, low cost. Clean up when you are already working in that code.

Leave and watch

Low pain, high cost. Document it, monitor it and revisit if the pain grows.

Low cost to fix to High cost to fix →

Business pain covers slower delivery, incidents, security exposure and onboarding time, not only code quality.

DivTech System

Timing matters as much as ranking. Pay down debt in the parts of the system your roadmap is about to change, because that is where the interest will be charged next. Debt in a module scheduled for retirement can usually be left alone.

Budgeting time: the 20% option and alternatives

Many teams reserve a fixed share of each sprint, often around 20%, for debt and maintenance. Treat that as a convention rather than a rule: it is simple, predictable and keeps debt work from being negotiated away every sprint. Alternatives include a debt tax (each feature in a debt-heavy area includes time to clean it up), periodic hardening sprints (easy to plan, but often postponed) and dedicated projects for large items such as a framework upgrade or splitting a module out.

Refactoring safely

processFive steps to refactor without breaking production
  1. 01Pin current behaviour

    Write characterisation tests that capture what the code does today, including odd cases users rely on.

  2. 02Change in small steps

    Keep each change small enough to review in one sitting and to revert in minutes.

  3. 03Strangle, do not rewrite

    Route functionality piece by piece to the new code (the strangler fig pattern) while the old code keeps running.

  4. 04Release behind flags

    Use feature flags and gradual rollout so a problem affects a few users, not all of them.

  5. 05Watch the numbers

    Compare error rates and latency before and after each release using your monitoring dashboards.

DivTech System

Tests are the safety net that makes all of this possible. If coverage is thin, start there; our guide on manual vs automation testing explains what to automate first, and our software testing and QA team can build the regression suite. For data-layer debt, the approach in legacy database modernization applies the same incremental thinking to schemas and storage.

Making the business case

Leaders rarely fund 'refactoring'. They fund faster delivery, fewer incidents and lower risk. Frame each debt item in those terms: 'this module adds roughly a week to every billing change', 'this unsupported version no longer receives security patches', 'only one person can deploy this service'. Link each item to a roadmap goal and show progress with the same delivery and incident metrics you used to find it. Debt work also fits naturally into the preventive budget described in the four types of software maintenance.

If you need an outside view, DivTech can audit a codebase, build the debt register and agree a paydown plan that fits your roadmap. Get a quote to start the conversation.

Frequently asked questions

Is all technical debt bad?

No. Deliberate, documented shortcuts can be a smart way to learn quickly, for example when validating an MVP. Debt becomes a problem when it is invisible, unplanned and sits in code that changes often.

How do you measure technical debt?

Combine delivery metrics such as lead time and change failure rate, static analysis and dependency checks, hotspot analysis from version control, and regular feedback from developers. Record findings in a debt register with owners and estimates.

Should we rewrite the system from scratch?

Rarely. Full rewrites take longer than expected and must reproduce years of undocumented behaviour. Incremental replacement with the strangler fig pattern usually delivers value sooner with far less risk.

How much time should we spend on technical debt?

Many teams reserve around 20% of each sprint as a convention, but the right share depends on how much debt slows you down today. Review it quarterly using delivery and incident metrics.

  • Technical debt
  • Refactoring
  • Code quality

free consultation

Need help with support & maintenance?

Talk to our Support & Maintenance team. We'll review your situation and suggest a practical next step, free.