Technical Debt: What It Is & Isn't
Getting out of technical debt demands you ask the right questions—here are the ones that should inform your repayment plan.
Join the DZone community and get the full member experience.Join For Free
you have to make that release date. you need more time to get the structure of your modules right, but you don’t have it. hitting the release date is more important than cleaning your code, so you defer the cleanup to make the deadline. you agree to take on technical debt which you’ll have to pay back later. speeding up now to hit this release date will make you slower hitting the next one. if you’re not careful, over time, development slows down to a crawl and every feature takes weeks instead of days.
to avoid development deadlock, we need to fully understand technical debt. otherwise, we’ll ruin our software. some questions to ask about technical debt management are:
- what exactly is technical debt (and what isn’t)?
- where does technical debt come from?
- when is it ok to create technical debt?
- how does technical debt hurt development?
- technical debt management: how can i measure technical debt?
- how can i reduce technical debt?
- how can i avoid technical debt?
what exactly is technical debt (and what isn’t)?
according to ward cunningham, technical debt describes deferred, necessary work :
technical debt includes those internal things that you choose not to do now, but which will impede future development if left undone. this includes deferred refactoring.
technical debt doesn’t include deferred functionality, except possibly in edge cases where delivered functionality is “good enough” for the customer, but doesn’t satisfy some standard (e.g., a ui element that isn’t fully compliant with some ui standard).
further describing technical debt, fowler wrote :
you have a piece of functionality that you need to add to your system. you see two ways to do it, one is quick to do but is messy – you are sure that it will make further changes harder in the future. the other results in a cleaner design, but will take longer to put in place.
and uncle bob reminds us that a mess isn’t technical debt:
a mess is not a technical debt. a mess is just a mess. technical debt decisions are made based on real project constraints. they are risky, but they can be beneficial. the decision to make a mess is never rational, is always based on laziness and unprofessionalism, and has no chance of paying off in the future. a mess is always a loss.
if your code is messy, it’s always bad – if you defer necessary work, it might be a smart business decision. unfortunately both, creating a mess and taking on technical debt, lead to similar issues over time.
let’s look at some examples and see what technical debt is , and what it isn’t.
a typical example for incurring technical debt in code is that huge source file every developer fears to touch. everyone on the team knows that it needs to be broken into more manageable pieces, but it would delay upcoming features by at least two weeks. touching this module without refactoring it is adding to the technical debt of your product. every such change will make the eventual refactoring harder and therefore needs to be paid back later – with interest. the interest you’ll have to pay is the added complexity of every change you added. the module grows with every code addition making its refactoring (and even the decision to do so) ever more difficult.
an example for technical debt from the operations side of things is deploying your application in only one availability zone in your datacenter even though you have demanding uptime requirements. setting up a split environment, which covers multiple availability zones is more work. it might be necessary to defer this additional work to be able to deliver critical features to your clients. in this scenario, technical debt does not materialize in added complexity but in higher risk of downtime. to avoid necessary work right now, you introduce single points of failure which will ultimately lower your uptime.
so, what isn’t technical debt?
unnecessary complexity, dirty hacks, and unreadable code are not technical debt. there is no good reason for introducing such a mess in the first place. if developers feel that they don’t have the time to write simple, maintainable code they’re clearly lacking experience and professionalism.
“single brain know-how” is another phenomenon often described as technical debt. but being dependent on a single person to maintain or run a critical part of your application isn’t technical debt – it’s a lethal threat to your business. you could argue that not sharing know-how because that person needs to deliver critical features is technical debt, but i disagree. no single line of code should go live without a second pair of eyes scrutinizing it. things like pair programming or code reviews are good, professional practice and should not be traded for the illusion of higher delivery speed.
by reading this far, you should now have a clear idea what is technical debt – and what isn’t . we’ll cover the other questions in upcoming articles.
Published at DZone with permission of [deleted], DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.