Skip to content
Technology transformation expertise firm · ARDIANE Group Innovate, secure, succeed

Engineering

Measuring and reducing technical debt without relying on a single figure

In brief

Measuring and reducing technical debt means cross-referencing three families of metrics (code analysis, obsolescence of the estate, delivery), each of which rests on conventions and leaves part of the debt out of scope. Management Square explains how to read these figures and how to decide on repayment: reduce where the code changes, contain elsewhere, leave alone what will be retired.

Page contents

A management team preparing its budget may hear its teams invoke technical debt at every delay, without finding it recorded in any of its dashboards. It then asks whether this debt can be measured, and by how much to reduce it during the year.

No single figure answers that. Measuring and reducing technical debt goes through three families of metrics: those calculated by code analysis, those recorded by the inventory of the estate (out-of-support components, lagging versions) and those of delivery (lead time, failures, capacity absorbed by fixes). Each family rests on conventions and ignores part of the debt. Reduction is then decided area by area, by comparing these measurements with what the roadmap is going to change. This breakdown is a methodological proposal.

Measuring technical debt on the code, on the estate and on delivery

The table matches each metric with what it leaves out of scope.

Metric What it measures What it does not tell you
Remediation effort estimated by static analysis The time deemed necessary to fix the defects detected by the tool’s rules What these defects cost the team, or architectural defects
Debt ratio This effort relative to a development cost derived from the size of the code A result comparable from one tool or configuration to another
Out-of-support components and version lag The obsolescence of the foundation and dependencies The state of the code written by the team
Lead time for a change to reach production The time a change takes to reach production The share of this time due to the code, and the share due to approvals or queues
Change failure rate The share of deployments followed by immediate intervention The cause of the failure
Share of capacity spent on fixes and unplanned work An approximation of the interest paid Where in the code it is paid

The first two rows estimate a principal, the work required to fix. The last three approach the interest, what the state of the software costs at each delivery. The third concerns another risk, that of a component for which security patches are no longer published.

None of these measurements sees knowledge debt, that of a module that only one person still knows how to modify. It is identified through interviews and feeds into the inventory described in our technical debt entry.

A debt ratio rests on stacked conventions

Static analysis does not measure an observed cost: it adds up remediation efforts assigned in advance to each rule. The documentation of a tool such as SonarQube thus defines debt as the sum of the remediation costs of maintainability issues, each cost being taken from the effort assigned to the rule that flagged the issue. The debt ratio divides this sum by a development cost: the number of lines of code multiplied by a cost per line, set by default at 30 minutes and adjustable.

Three conventions are therefore stacked: the rules activated, the effort assigned to each one, the cost of a line. Activating a stricter rule set raises the debt without a single line having changed. A ratio is then read over time, with constant configuration, for a given application. It does not serve to rank applications written in different languages or analysed with other rules against each other. Converted into euros by a daily rate, it receives a fourth convention.

The CISQ consortium presents on its website the Automated Technical Debt measure, published as a standard by the OMG: it estimates the effort needed to fix the weaknesses identified by its code quality standards. The consortium specifies that this remediation cost constitutes the principal of the debt, and that the inefficiencies caused by these weaknesses represent the interest.

The same measure, calculated on new or modified code only, indicates something else: whether the team is continuing to borrow. When a repayment is under way, this figure is looked at before the stock.

Reading the figures where the code changes

Our entry recommends comparing code quality with the frequency of its changes. The version control history gives, for each module, the number of changes over a period. Static analysis gives its complexity or remediation effort. Modules that are both degraded and frequently modified are those where the interest is paid.

The roadmap corrects this ranking, drawn from the past: a quiet module targeted by upcoming changes joins the list, a busy module due to be retired leaves it.

Delivery metrics call for the same precaution, as their definitions are also conventions. The guide to delivery metrics published on dora.dev by the DORA research programme (unrelated to the European regulation with the same acronym) counts the lead time of a change from its commit to version control to its deployment in production. A lead time counted from the business request also includes the wait before development. The same guide defines the change failure rate as the share of deployments that require immediate intervention: it is up to the team to write down what it counts as such.

That leaves attribution. A long lead time may be due to manual approvals as much as to the state of the code. To link a delivery figure to debt, one method consists of asking the team, on a sample of recent changes, how much time it attributes to the state of the code, and where. The estimate is self-reported, but it pinpoints where the cost lies.

Reducing technical debt where it costs, containing it elsewhere

The means of repayment (as changes are made, through reserved capacity, through a targeted workstream) are set out in our entry. The decision concerns choosing an outcome for each area. Each one is presented with the observed interest, the estimated principal and the risk of the correction, the changes the roadmap plans and, where applicable, an announced end of support.

  • Immediate repayment suits an area that is frequently modified and that the roadmap will call on again. If no test protects it, the first investment is the test safety net; our page software quality and testing describes how to organise it.
  • Opportunistic repayment suits a degraded but rarely touched area: the correction waits for the next change that will affect it.
  • Containment suits what will not be fixed any time soon: a stable interface isolates the area, and a check on new code prevents the debt from growing.
  • The status quo suits an application whose retirement is dated, as long as its components receive security patches until then.

When the debt lies in the architecture (a coupling that prevents a module from being modified on its own, a foundation without support), none of these outcomes is enough. The decision becomes the choice of a strategy for reworking the entire application, the subject of our application modernisation offering. If the coupling runs across several applications, it is dealt with at the level of information system architecture.

A repayment is checked in the same way it was justified: the metric that motivated it is read again afterwards on the area, with no value promised in advance.

Management then receives an order of magnitude for the principal, with the conventions that produce it; the areas where the interest is paid, with measurements to support it; the repayments proposed for the year, each with its effort and the change it makes possible. This list, reread from one budget year to the next, makes it possible to say whether the debt is receding.

FAQ

Frequently asked questions

Another question? Ask us

Can technical debt be costed in euros?

An order of magnitude can be given. Static analysis tools estimate a remediation effort, expressed in time, based on an effort assigned in advance to each rule. Multiplying it by a daily rate produces an amount that depends on these conventions and covers only the defects the tool is able to detect. This amount is presented with its assumptions and serves to track a trend.

What is the technical debt ratio?

It is the ratio between the estimated effort to fix the defects detected in the code and a development cost derived from the size of that code. SonarQube's documentation, for example, divides the debt by the number of lines of code multiplied by a cost per line, set by default at 30 minutes and adjustable. Two tools, or two configurations of the same tool, therefore give two ratios for the same code.

How often should technical debt be measured?

Each family has its own rhythm. Code analysis can be rerun at each change, in the integration pipeline. Delivery metrics are recorded continuously and read over a period long enough to smooth out fluctuations. The inventory of out-of-support components is reviewed at fixed intervals and at each end-of-support announcement. Comparison only makes sense with constant configuration and definitions.

Should a fixed share of capacity be reserved for technical debt?

No proportion applies to all teams. A reserved share makes the effort visible and negotiated with the product owner. It can also be consumed without priority if it is not backed by a list of ranked areas. The share is therefore set after the decision, on the basis of the repayments chosen, and revised along with them.

When does reducing technical debt become a modernisation project?

When the debt lies in the architecture or the foundation: a coupling that prevents a module from being modified on its own, a technology that is no longer maintained, knowledge that has left the organisation. Repayment as changes are made does not reach these defects. The question becomes that of the strategy for reworking the entire application, with a budget and project management.

A project to bring to completion?

A first conversation is enough to understand your challenge, identify the right people and tell you frankly what we can bring.