Managing technical debt
Technical debt is the extra cost every future change pays for a past shortcut. Prioritize it by the interest it charges — slower delivery, incidents, failed changes — not by ugliness.
Analogy: A credit card: borrowing to ship this week can be smart, but pay only the minimum and the interest eventually eats the whole budget.
How it works
- Fowler's debt quadrant: a prudent, deliberate shortcut is a legitimate tool; a reckless, deliberate one is not.
- Measure interest with DORA metrics and incidents where the debt lives; code that never changes charges none.
- Prioritize by interest × change frequency, and pay it down inside feature work in that area.
- Reserve a fixed slice of every cycle, often 10–20%, so debt needs no new business case each sprint.
- AI debt: prompt sprawl, missing evals, unpinned model versions, and glue code that dwarfs the model.
Check yourself
Answer to mark it learned; your answers aren't scored.
Planning is next week and you can fund one debt paydown this quarter. Which item has the strongest case?
Go deeper
Full explanation
Technical debt is the gap between the system you have and one that would make today's changes cheap. The principal is the work to close it; the interest is the extra effort, risk and incidents every change pays until you do.
Fowler's debt quadrant sorts causes on two axes: reckless vs prudent × deliberate vs inadvertent. Prudent-deliberate (ship now, refactor after launch) is a legitimate tool; reckless-deliberate (no time for design) is not. Prudent-inadvertent is normal: you learn the right design by building the first one.
Manage it like a portfolio:
- Measure the interest with DORA metrics — change lead time, change fail rate, failed deployment recovery time (the former MTTR) — plus incident counts, in the areas the debt touches. Ugly code that never changes charges no interest.
- Prioritize by interest × how often you touch it, and pay down inside feature work in that area.
- Reserve capacity: a standing share of every cycle, so debt doesn't need a new business case each sprint.
AI-specific debt (Hidden Technical Debt in ML Systems): prompt sprawl (copies in code, no owner, no version), missing evals so nobody dares change a prompt, unpinned model versions and vendor deprecations that silently change behavior, and glue code and pipelines that dwarf the model itself.
Code Debt register entry priced by interest
# Tech-debt register: the interest, not the ugliness, sets priority
id: DEBT-042
title: "Prompts hard-coded in 14 services, no versioning, no evals"
quadrant: prudent-inadvertent # reckless|prudent x deliberate|inadvertent
area: support-assistant
interest: # what it costs us now, measured
lead_time_prompt_change: "3 days (14 PRs)"
change_failure_rate: "1 in 4 prompt changes rolled back"
incidents_last_quarter: 2
touch_frequency: weekly
model_pinning: "floating alias; vendor deprecation announced"
principal: # cost to fix
estimate: "3 engineer-weeks"
plan: "prompt registry + 200-case eval suite in CI + pinned versions"
risk_if_ignored: "forced blind migration of 14 prompts at deprecation"
owner: ai-platform
decision: schedule # schedule | fix-when-touched | accept
review: next quarterly planningReal example
A team's assistant has prompts copied into 14 services, no eval suite, and calls a floating model alias. Nobody refactors because it works. Then the vendor announces a deprecation with 90 days' notice: every prompt must be re-tested by hand, and a silent alias update had already broken a JSON parser twice that quarter. The Staff engineer frames it as interest: prompt changes take 3 days and 1 in 4 is rolled back. Leadership funds 3 weeks for a prompt registry, a 200-case eval suite in CI and pinned versions; the forced migration then takes 2 days.
Trade-offs +3 · −3
+ You gain
- Turns the code is bad into a cost leadership can weigh against features.
- Reserved capacity stops debt competing with every feature in every planning cycle.
- Interest-based priority focuses effort where change actually happens.
− You pay
- Interest is hard to attribute precisely; metrics are signals, not proof.
- A standing reserve can turn into a slush fund for pet refactors.
- Big-bang rewrites sold as paydown often create new debt.
Use it when
When delivery in an area slows, incidents cluster around the same components, or AI changes (prompts, models) feel too risky to ship without manual testing.
Avoid it when
Ugly but stable code that is rarely touched, or systems scheduled for retirement. Throwaway prototypes too — as long as they really get thrown away.
Numbers to know 3
- DORA's four keys: deployment frequency, change lead time, change fail rate, failed deployment recovery time (DORA's current name for time to restore / MTTR); a fifth, deployment rework rate, was added later.
- Rule of thumb: interest ≈ extra time per change × changes per month in that area.
- Rule of thumb: reserve a fixed slice of every cycle (often 10–20%) for debt and maintenance.
Common pitfalls 4
- Prioritizing by ugliness or by who complains loudest instead of measured interest.
- Asking for a debt sprint every quarter instead of a standing reserve and pay-as-you-go.
- Rewriting from scratch: the old system's undocumented behavior comes back as new bugs.
- Treating prompts and model versions as config, not code: no owner, no tests, no pinning.
Interview questions 3
Answer out loud first, then reveal.
How do you get leadership to fund technical debt work?Show answer
I never ask for refactoring time; I show the interest. For example: prompt changes take three days, one in four is rolled back, and the same component caused two incidents last quarter. Then I give the principal — three engineer-weeks — and what we get back: faster changes and a safe path through the next model migration. I tie it to something leadership already wants, like a launch that depends on that area. For the steady trickle of debt, I negotiate a standing capacity reserve so it doesn't need a business case every sprint.
What's different about technical debt in AI systems?Show answer
Behavior can change without a code change. A floating model alias or a vendor deprecation shifts outputs silently, so I pin versions and plan migrations as projects. Prompts sprawl across services with no owner, so I move them into a versioned registry. The biggest debt is missing evals: without a regression suite nobody can change a prompt or model safely, and everything freezes. And the Hidden Technical Debt in ML Systems point still holds — the glue code, pipelines and config around the model are most of the system, and most of the debt.
Tell me about technical debt you chose not to pay.Show answer
We had a legacy feature pipeline everyone hated: old framework, no tests, painful to read. A team proposed rewriting it. I checked the interest: it changed twice a year and hadn't caused an incident in over a year, while the service next to it paged us weekly. I argued we leave the pipeline alone, add a characterization test around its output, and spend the effort on the noisy service. The trade-off was living with code nobody liked; the payoff was fixing what actually hurt.