Expand description
§Technical Debt Measurement
Technical debt, a metaphor coined by Ward Cunningham, describes the accumulated cost of past shortcuts — expedient decisions that shipped something sooner but left the codebase harder to change afterward, in the same way financial debt lets you spend now at the cost of interest later. Unmeasured debt loses the prioritization competition against feature work by default, not because it matters less, but because it has no visible advocate; quantifying it in terms decision-makers can weigh — cost to fix versus cost of carrying it — is what lets it compete fairly.
§Formula
Debt carrying cost = (velocity tax + elevated defect cost) × periods
velocity tax = extra cost per period from related work going slower
elevated defect cost = extra expected defect cost per period from carrying the item
periods = number of periods the item is left unfixed§Why it matters
For each debt item, the chapter recommends estimating two figures: the cost to fix it, and the cost of carrying it unfixed — how much slower related work goes, how much additional defect risk it carries, how much it blocks other work. This carrying cost, summed across however many periods the item is left unaddressed, gives decision-makers a real basis for comparison against feature work’s cost and expected value, rather than an abstract, unquantified complaint. Debt also compounds: each new shortcut makes the next change slightly harder.
§Example
The topic doc’s enterprise example: a telecommunications company allocated a fixed 15% of engineering capacity to debt remediation and resolved its top five highest-carrying-cost items within a year, measurably improving change failure rate for billing-related deploys — the return on quantifying and targeting the highest-carrying-cost items first.
use software_engineering::technical_debt::debt_carrying_cost;
// A billing-engine shortcut: slower related work (velocity tax) plus
// elevated defect risk, both recurring per period, carried for a year
// (12 monthly periods) before remediation.
let cost = debt_carrying_cost(2_000.0, 500.0, 12.0);
assert_eq!(cost, 30_000.0);
// Carrying the same item twice as long doubles its carrying cost.
let longer = debt_carrying_cost(2_000.0, 500.0, 24.0);
assert_eq!(longer, cost * 2.0);§Money
debt_carrying_cost takes plain f64 amounts. For currency-checked
accounting, use rusty_money::Money directly rather than through a
wrapper this crate provides — its own add/mul already return
Result, rejecting a currency mismatch (a USD velocity tax against a
EUR defect cost, say) instead of silently summing incompatible amounts,
so this formula needs no adapter to use it that way:
use rusty_money::{Money, iso};
// $2,000/month velocity tax + $500/month elevated defect cost,
// carried for 12 months = $30,000.
let velocity_tax = Money::from_major(2_000, iso::USD);
let defect_cost = Money::from_major(500, iso::USD);
let cost = velocity_tax.add(defect_cost).unwrap().mul(12).unwrap();
assert_eq!(cost, Money::from_major(30_000, iso::USD));
// Mismatched currencies are rejected rather than silently summed.
let eur_defect_cost = Money::from_major(500, iso::EUR);
assert!(velocity_tax.add(eur_defect_cost).is_err());§Pitfalls
- No visible, tracked debt backlog — debt loses the prioritization competition by default and compounds invisibly.
- Vague, unquantified debt claims — rarely compete well against concrete, quantified feature requests in planning.
- Prioritizing debt by age or advocacy volume rather than impact — misdirects limited remediation capacity away from the highest-carrying -cost items.
- No protected capacity for remediation — debt paydown only happens reactively, after a crisis, rather than as routine, deliberate practice.
- Treating all debt as equally worth fixing, instead of accepting some debt as permanent when its cost to fix exceeds its cost to carry.
§Sources
- Chapter 4.5, Technical debt measurement.
- Cunningham, Ward, “The
WyCashPortfolio Management System,” OOPSLA (1992). - Kruchten, Philippe, Robert Nord, and Ipek Ozkaya, Managing Technical Debt: Reducing Friction in Software Development.
Topic doc: software-engineering-metrics/locales/en-001/chapters/04-05-technical-debt-measurement.md
Functions§
- debt_
carrying_ cost - Debt carrying cost: the ongoing cost of leaving a debt item unfixed.