Understanding Technical Debt
Originally coined by Ward Cunningham, technical debt is the idea that there will be a cost in terms of more development work down the line for using certain solutions to problems that arise while developing. The whole idea is a metaphor comparing development to taking out financial debt. It is related to refactoring which is the idea of going into existing code making changes to improve the quality or readability. Technical debt can be used to predict the amount of work that refactoring your code will take.
“Shipping first-time code is like going into debt. A little debt speeds development so long as it is paid back promptly with a rewrite.” ~ Ward Cunningham
The idea here is not to avoid accumulating technical debt but instead to understand what it is and how it can be used properly to benefit your development and your business. A quick fix has cost down the line and understanding that can help you make decisions about how to build your apps. Accumulation of technical debt causes poor documentation, inaccurate tests, and a plethora of TODO comments. Knowing what you are getting yourself into when taking on technical debt helps you better plan for paying it off before it gets out of hand.
Types of Technical Debt
12:20 Technical Debt Quadrant
“It’s kinda hard to describe this image, Google technical debt quadrants.”
Think of debt falling into a quadrant with the X axis being Reckless – Prudent and the Y axis being Deliberate – Inadvertent. This comes from Martin Fowler’s blog post on technical debt. Reckless debt would be something with high interest and long term to pay it off but little benefit. Prudent debt would be something that is needed and can be paid off in a timely manner (car payment, medical bills). Inadvertent debt occurs when you are not expecting to take on debt or do so without intending to take on debt. Deliberate debt happens for a reason and the team is aware they are taking on this debt. The 4 quadrants this creates can be termed Naive, Unavoidable, Strategic, and Dunning-Kruger.
Naive Technical Debt occurs when you don’t know the correct way to build or design your code. It comes about from being inadvertently reckless. You’ll see this mostly with more junior developers, though senior developers aren’t immune.
“Like for instance you suddenly have to scale your app because you took on a big client.”
Unavoidable Technical Debt happens when things outside of your control add to your development process. This is the quadrant created by the mix of being inadvertent but prudent. The things causing this type of debt are necessary but not expected nor planned for.
Strategic Technical Debt occurs when there is a known reason to take on the technical debt and it is decided to do so. This is the best category to be in because it is a planned debt with known costs and benefits. These are necessary and expected.
“If you’re in the Dunning-Kruger club you know better than us anyways.”
Dunning-Kruger Technical Debt occurs when you are deliberately reckless believing you don’t have time or need to build your code correctly. It comes about through arrogance, poor management, or external pressures.
Sizes of Technical Debt
“If you owe the bank $100 thousand the bank has you in a bind, if you owe the bank $100 billion you have the bank in a bind.”
21:30 Short Term
Short Term Debt is intended to be taken on for immediate use and paid back in a short time. This may be hard coding in some data on a website to meet a sprint deadline with the intent to repay it in the next sprint. The goal here is the debt is small and easy to repay.
“It’s a way of creating space.”
In the financial sense the proper use of credit cards would be an example of this. You take on a little bit of debt to get through a certain time period then pay it off at the end of the month. Sometimes there are external rewards like cash back or points earn on your credit card.
23:20 Mid Term
Mid Term Debt is taken out for larger things that are to be paid of on a regular schedule. This may be changing out an API where you leave in backward compatibility. Then you go in and change the apps that are calling it one at a time.
A monetary example of this would be your car payment. It’s not a small debt that you take out but you pay it off incrementally.
25:25 Long Term
Long Term Debts are ones that cannot be paid off quickly or easily. This would be like changing frameworks or even languages. You should have very few long term debts.
These would be like your mortgage or student loans. Taken out for a big life event and paid off over a longer period of time.
29:20 Short Term
Short Term Debt comes about from a short term need or a limited time frame to get something out.
“As a journeyman developer, when I write code I’m thinking about how will this code be used in the future.”
Naive debt occurs in the short term when you have junior developers writing code that is not reviewed by a more senior developer. Senior developers can make these mistakes too. Usually it is because they are fixing a problem to the best of their ability not planning for how that will be used in the future.
Unavoidable debt occurs in the short term when a requirement changes or you learn something new but don’t have the ability to adjust the timeline. This will happen if you don’t have accurate acceptance criteria or if they change while developing. This could also occur from not enough time to write proper documentation or run proper tests.
Strategic debt is expected and a plan is made for quickly repaying it once the reason for the need is no longer an issue. The best example of this is coming across something that needs to be changed and creating a story for it to be done at a later time. This can also occur from learning a better way to design your code and planning to implement this new design.
36:05 Mid Term
Mid Term Debt accumulates when major changes are needed in your code.
Naive mid term debt happens due to a lack of understanding or knowledge of good design principles. If you are having to make changes in multiple places just to add a field to a class then you might want to consider refactoring. Again this tends to happen to more junior developers as they are learning how to design and the best ways to build code. Could be avoided with regular code reviews and having senior developers that aren’t jerks that think the junior should flounder to better learn.
“If I ever get the opportunity I’m going to break the Ctrl+C and Ctrl+V on their keyboard.”
In the mid term unavoidable debt comes about because of upgrades in tools and frameworks. This could be adding new services or updates to existing ones that require changes be made in the current code base. It can also happen when the tools you are using are updated with breaking changes.
Strategic debt in the mid term is when you build something a certain way knowing that you will likely have to change it in the future. This could be because of business requirements. It could also be that the tools necessary to build it the correct way aren’t available yet.
43:45 Long Term
Long Term Debt comes from major overhauls in the technology you are using such as changing frameworks or updating to modern languages. You don’t see as much of this in the naive quadrant with the exception of the occasional manager that doesn’t understand what they are asking for in an overhaul.
It becomes unavoidable when you’ve been using an older technology that can’t keep up with the modern world. You may be using an older web technology that doesn’t have the ability to become easily mobile friendly. The technology you built your business around may no longer be supported. In this case larger, long term debt becomes an immediate concern that needs to be addressed.
The only place to effectively deal with long term debt is in the strategic quadrant. This is where you plan to upgrade to a newer system or framework.
Paying It Off
49:25 Short Term
“Use the credit card to buy the fire extinguisher.”
Short Term Debt is the easiest to pay off but also the easiest to avoid. Because it comes from a need for a quick short term benefit with little cost it should be paid off as soon as possible. This could mean creating a story for it in an Agile environment or handling it as soon as the deployment is completed. Build into your development cycle some time to address short term technical debt so it doesn’t accumulate.
51:33 Mid Term
Mid Term Debt takes a bit more effort and planning than short term debt. You may not be able to address this immediately or pay it all back at once. Like with a car or larger medical bills create a payment plan to pay off some of the debt incrementally as you go along. One way to do this is to have a technical debt backlog that you pull from when you have extra time during a sprint. Another option is to designate a certain time-frame or sprint to addressing the accumulated debt.
54:15 Long Term
“Financially you’d be looking at talking to a financial adviser.”
Paying off long term debt takes planning and usually involves architects and management. You’re average developer in the trenches isn’t likely to make the plans on how to address major changes in the company. That said they may be involved in those decisions or be able to suggest or influence them. Like paying off your mortgage or student loans takes a payment plan over several years making major changes takes a long term plan of action.
IoTease: iPhone App
iPhone Home App
For those that upgraded earlier than me you probably already know this but for the rest of us Luddites and Android users when I got my new phone it came with an app called Home. This is Apple’s built in control for your smart home accessories. With the tagline, “One app for all your home accessories” they make it clear this is the intended app for IoT. Each of the accessories is reviewed and approved by Apple to help ensure security. With Apple’s dedication to security and restrictions on what they’ll let into the app store I’m excited to find out more about it and play with this app. I’ll have to find accessories that are compatible with both Apple and Amazon. If there isn’t already a list I’ll start compiling one.
Tricks of the Trade
Beware the secret king. Someone who thinks they are all that and that if everyone just recognized it, they would be in charge. There is an economy to relationships and such people do not recognize it, preferring instead to feel entitled to power. You cannot help such a person, but you can be hurt by them when the power they “deserve” doesn’t come to them and they lash out. Be careful. There is a reason that medical professionals don’t particularly like these people and want to be warned about them before dealing with them.