How much does technical debt cost?
The cost of technical debt is mostly developer time. A peer-reviewed study found developers lose 23% of their working time to it, so a team of four costing $480,000 a year would lose about $110,000 of it.
Across 39 production codebases, fixing an issue in low-quality code took on average 124% more development time, and low-quality code had 15 times more defects.
What the studies say
- Developers lose on average 23% of their working time to technical debt, from a longitudinal study of 43 developers plus 16 interviews (Besker, Martini and Bosch, 2019).
- Developers estimated they spend 13.5 hours of a 41.1-hour week on technical debt and 3.8 hours on bad code, in a survey of more than 1,000 developers (Stripe and Harris Poll, 2018).
- Stripe put the developer time lost to bad code alone at nearly $85 billion a year worldwide.
- In 39 codebases measured with the CodeScene tool, issues in low-quality code took 124% longer to resolve, and low-quality code had 15 times more defects (Tornhill and Borg, 2022).
Read these numbers with care
The first two figures are what developers report, not time measured with a clock, and a developer asked about bad code is not a neutral witness. The third is Stripe’s own calculation from that survey, which is from 2018. The last one is measured, but on 39 codebases using one tool. All four point the same way: a big share of the week goes to debt. I trust the direction more than the decimals, and the share in your team can be quite different.
A worked example of the cost of technical debt
These are assumptions to show the method. I have not met your team, so change them to your own numbers.
- Assumption: a team of 4 developers.
- Assumption: each costs $10,000 a month with tax and benefits, so $480,000 a year for the team.
- Share lost to debt: 23%, the figure from the peer-reviewed study.
- Cost: $480,000 × 23% = $110,400 a year, or about $9,200 a month.
- With Stripe’s survey figure instead (13.5 of 41.1 hours, about a third), it comes to about $158,000 a year.
- Assumption: a cleanup that removes half of that waste gives back about $55,000 a year with the 23% figure.
The costs that do not show up as hours
- Security: hard-coded keys and libraries with known holes cost nothing until the day they cost a lot.
- Cloud bills: on one project, a logs table of more than 24 GB and EC2 instances nobody used were adding to the AWS bill.
- Lock-in: an MVP that stays on no-code tools for too long makes every later change a migration.
- Deals: a due diligence reviewer will find the debt and price it into the offer.
How to measure yours
- Ask the team which parts of the code they avoid, and how much longer a ticket takes there. They will answer faster than you expect.
- Track bugs that come back after a fix, and where they come from.
- Count the dependencies that are several major versions behind or no longer get security fixes.
- Have someone outside the team read the code and rank the debt by cost to fix.
When paying it down is not worth it
If the debt sits in code nobody changes, its interest is close to zero. If the product will be replaced within a year, fix only the security issues. Spend on the debt the team runs into every week, and let the rest sit there.
What a review costs
My 14-day Trial costs $995, one time, for one codebase. You get a ranked list of the debt in the first 5 business days, each item with where it is, what to change and a rough effort. Then I fix what can be fixed in the 14 days. In the example above, the price is less than half a week of the debt’s cost.