Skip to content
Entrepreneurship

What technical debt costs: 3 measurements that turn it into money

Three measurements turn technical debt into a line in money: active branches in the file that matters, code owned by people who left, and tests that do not test.

Por Victhor Araújo

Founder of Revin. Engineer by training, specialist in software development and digital products.

On site, the invoice only clears after someone measures what went up. Software rarely has that sheet of paper.

On site, the invoice only clears after someone measures what went up. Software rarely has that sheet of paper.

Technical debt shows up on your P&L as three things you already pay for and never see broken out: hours spent studying a system before anyone can safely change it, rework that comes back a few weeks after a release, and a date you promised a customer and missed. To turn that into a number, I run three measurements before I quote anything.

Here they are. In a pricing service I inherited, I counted 1,043 if branches, and only 34 of them had changed in the previous twelve months. Across 2,847 lines of a tax service, 71% of the code had someone who already left the company as its last author, and 62% of the commits never said why the change went in. In a suite with 92% test coverage, I broke the code on purpose and only 41% of the breakages were caught by any test. Three measurements, three different bills, and none of them appears on an invoice.

On a construction site nobody pays for progress, they pay for a measurement

Changing one price starts with reading 1,043 possible paths inside the same file.

Changing one price starts with reading 1,043 possible paths inside the same file.

Before I wrote software for a living I signed off on steel structure. On site, a vendor does not get paid because he says he is ahead of schedule. He gets paid against a measurement: someone walks the site, counts how many tonnes went up, checks how many welds passed inspection, and that sheet of paper becomes the amount on the invoice.

Software went the other way. "The codebase is legacy." "The code is bad." "We need a refactoring cycle." That is progress talk, and your CFO answers it with the only sensible question available: what does it cost me to not do it? With no number in hand, the answer is a shrug, and a shrug loses to every other priority in the company.

Nobody in a board meeting says technical debt, by the way. They say some version of "why does everything take a quarter now". Same bill, different vocabulary.

Measurement 1: 1,043 live rules, 34 reviewed last year

I open the file that holds the most expensive rule in the business, which is almost always pricing, commission, shipping or tax, and I count two things. How many decision branches live in there. How many of them were touched in the last twelve months.

For the pricing service: 1,043 and 34. The other 1,009 still run on every order that comes in. A rule written for a customer who churned in 2021, a condition from a three week promotion, an exception for a tax rate that has since changed. Nobody revoked any of it, because revoking requires someone who knows why it went in.

The bill arrives on the next change. Every edit to that file starts with reading 1,043 possible paths, to find out which old rule today's edit will wake up. That is why changing a price takes three weeks. The engineer is not slow, the engineer is doing risk analysis with a code editor open.

Measurement 2: 71% of the code belongs to people who left

Technical debt only makes the board meeting once it becomes a dated line on a spreadsheet.

Technical debt only makes the board meeting once it becomes a dated line on a spreadsheet.

The second one is the cheapest to run and the most uncomfortable to read. I run git blame on the directory that matters and tabulate by author. Who wrote it well is not the point. Who is still around to explain it is.

In that tax service, 71% of the lines had a last author who no longer worked there, and 62% of the commits said something along the lines of "fix" or "adjust". Calling that old code is generous. The accurate word is orphaned: the missing context was never in the repository, it walked out during an exit interview.

The cost has a name and a calendar. One person becomes the bottleneck for everything that touches that service. Their holiday pushes delivery. Their resignation opens a three month archaeology project. And somewhere in there the sentence that freezes a roadmap for years gets born: better not touch that.

Measurement 3: 92% coverage that becomes 41% once you test the tests

Coverage tells you how many lines your tests visited. It does not tell you whether those tests would complain about something broken. Different questions, and the company pays for the second one while receiving a report about the first.

The way to check is crude and it works. I go into the code and break things on purpose: flip a condition, change a sign, delete a line. Then I run the suite and count how many of those breakages something caught. On that 92% coverage base, 41%. More than half of what ships has no net under it, with a green report sitting next to it.

My favourite rotten shell is a cousin of this one. A health endpoint returning 200, a colourful dashboard beside it, and nothing but empty series inside. Monitoring from the outside, silence from the inside. The bill arrives as a customer incident, a 3 a.m. fix, and the rework your team nicknames last month's thing.

The bill in money, with the arithmetic on the table

Now the part almost nobody does, which is multiplying.

Start with the hour. Salary divided by 2,080 gives you a number that lies, because it ignores benefits, payroll tax, time off and the fact that most of the week never reaches an editor. The multiplier I use is around 2.5x that naive figure, and I would rather you build your own with your finance team than borrow mine.

Then three lines, in the order I add them up:

  • Reading hours, from measurement 1: hours per week the team spends understanding a file before it can change a line of it.
  • Single person hours, from measurement 2: how much of the month's delivery depends on one specific calendar, plus the slip when that calendar fills up.
  • Rework hours, from measurement 3: hours spent fixing what shipped and came back, plus whatever the company credited back to customers.

On the pricing service, two engineers were burning roughly 6 hours a week just deciding where it was safe to make a change. That is 48 hours a month to deliver nothing new, and over a year it dwarfed the quote for rewriting the file. The conversation changes when both numbers sit side by side. With that on the table, the question stops being how long will it take and becomes what does another year of this cost.

"We will clean it up after the round closes"

I have been hearing that sentence since my own first startup, an equipment rental company that closed every sprint on a Friday without the delivery inside it, and died before any cleanup happened. A funding round buys writing speed. It does not buy reading speed: more people enter the same 1,043 path file, and cost per change goes up instead of down.

There is a villain here, and it is not the team. It is the contract. Fixed price with no continuity clause rewards whoever ships fast and walks away, because the maintenance of what they built never lands back on their payroll. It lands on yours, two quarters later, denominated in missed dates.

Where I would not use this

A product still looking for its market, three people, four months of code. Measuring debt there is expensive and probably pointless, since half of it goes in the bin the day a customer finally says what they want. The measurement starts paying off once there is revenue flowing through the system and people hired to keep it running.

And I cannot tell you whether the hourly arithmetic holds in a three person team where everyone touches everything. I have never tested it at that size.

What to ask for on Monday

Ask for the three measurements in writing, dated, with a two day deadline. None of them needs new tooling or a consultant: counting branches, tabulating authors and breaking code on purpose are an afternoon each. What you want back is a number and a date, not an assessment.

When my squad enters a system we did not write, the first two weeks look exactly like that, with no pull request opened. If your answer to "how much of our code belongs to people who left" is currently a guess, you already know which of the three to run first.

Ready to elevate your business

Schedule a meeting
Share
Link de compartilhamento LinkedinLink de compartilhamento XLink de compartilhamento WhatsappLink de compartilhamento Facebook

Newsletter

Every two weeks. The technical decisions we made, and what we learned.