# What Technical Debt Is And How It’s Measured

Feb 20, 2019 · 7 min read

# Team Decides: Let’s Move On People, We’ll Revisit This Later

We could be building some really cool new features right now.

We’ll come back to this later when we have the time.

Software Entropy increases due to the tendency of software to become difficult and expensive to maintain as it gets modified over time.

It doesn’t get easier over time to maintain software. Maintenance tends to cost the same at best, or gets more difficult and costlier, especially as the codebase expands.

Technical Debt [deliberate] is the cost incurred when poor design and/or implementation decisions are taken for the sake of moving fast in the short-term instead of a better approach that would take longer but preserves the efficiency, maintainability, and sanity of the codebase.

# Numbers Please — How Do We Measure Technical Debt?

Technical Debt Ratio = (Remediation Cost / Development Cost) x 100%

Prefer smaller TDR values at all times

RC α Cyclomatic Complexity
RC = k(Cyclomatic Complexity)
k is a constant
0.27 hours/line x 100 lines = 27 hours.
Development Cost: DC [hours]
Lines Of Code: LOC [lines]
Cost Per Line: CPL [hours]
Remediation Cost: RC [hours]
Technical Debt Ratio: TDR
TDR = ( RC / DC ) x 100%
DC = CPL x LOC
RC = 365.8 hours
LOC = 26,398 lines
CPL = 0.27 hours/line
Recall that DC = CPL x LOC
=> DC = 0.27 hours/line x 26,398 lines
DC = 7,125.83 hours
Therefore:
TDR = ( RC / DC ) x 100%
TDR = ( 365.8 hours / 7,125.83 hours ) x 100%
TDR = 5.1%

Technical Debt Ratio for this example codebase is 5.1%

Written by

Written by