What Technical Debt Is And How It’s Measured

Daniel Okwufulueze
Feb 20, 2019 · 7 min read
Image for post
Image for post
Too busy for efficiency. This image has been modified by me. Source: https://pbs.twimg.com/media/DTvOdk9VMAAwBQ5.png

The Dilemma

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?

Image for post
Image for post
How do we assign numbers to this Technical Debt concept? Source: https://static.wixstatic.com/media/279667_7ef75f79ddad467f964792939632dd79~mv2.jpg
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%

Conclusion

The Andela Way

A pool of thoughts from the brilliant people at Andela

Daniel Okwufulueze

Written by

Husband; Dad; Technology Leader & Mentor; Blockchain Enthusiast & Developer; Agnostic. For pastime, I read, write, swim, play musical instruments, think.

The Andela Way

A pool of thoughts from the brilliant people at Andela

Daniel Okwufulueze

Written by

Husband; Dad; Technology Leader & Mentor; Blockchain Enthusiast & Developer; Agnostic. For pastime, I read, write, swim, play musical instruments, think.

The Andela Way

A pool of thoughts from the brilliant people at Andela

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store