And continuous tech debt is immediately bad and it is posing all of these risks on our product. Now, maintenance tech debt only becomes bad when you need to introduce changes in the area where you have it, which makes sense. Because if something is working, you don't care about how bad the design of it is as long as it's working and you don't need to introduce any new requirements there. For instance, we're in the microservices world, right? So, it can be a simple microservice, poorly designed, made 10 years ago, that sits there and just works and has worked ever since because there were no further requirements to implement and we did not need to care about the tech debt that sits in there.
What that all means is that the main questions about tech debt to ask are actually, how do we tell which tech debt needs fixing, at least right now and also how do we tell when the tech debt that needs fixing is getting out of hand so that our backlog of the tech debt that actually needs fixing short term is getting too big to fix short term? And the answer to that is in the tech debt metrics or tech debt related metrics, which I like to divide in three main buckets, namely heuristic metrics, second tier metrics, and the bucket that only contains one, tech debt interest, and you will see why it's so special. Spoiler alert, it is special. So let's start one by one.
Heuristic tech debt metrics. When we hear the word heuristic, it's usually about something automated, right? And these metrics are no exception, they are automated, they are usually provided by the tooling that already exists. And most of this tooling is measuring things like cyclomatic code complexity, code duplication, code smells, another thing that was first popularized by the guy named Ken Beck in 1990, and then hugely promoted in the book Refactoring, which many of you may know about, written by Martin Fowler in 1990... published in 1999 actually, sorry. Then there would be something like Maintainability Index, which can have a different name, but be generally the aggregation of the above metrics, and something else potentially. Then there would be TAGDAT Ratio, which is this ratio of TAGDAT Remediation Costs divided by Development Cost. Unfortunately, despite having cost here and this metric allegedly being about direct business impact in money and so on, this cost is too synthetic and too inaccurate, therefore, because usually it's determined by the number of lines of code you have in your codebase, multiplied by some synthetic quotient, which is the cost of developing a line of code, which you can imagine can vary depending on the line and it's rarely a good metric to show the actual effort. Then there would be two more metrics, something like statically or heuristically detectable security issues and also heuristically detectable potentially missed edge cases, which are especially important in loosely typed languages where we don't have compilers to detect those cases. And finally, these metrics are also dividable in those two buckets that we talked about previously, maintenance tech debt and continuous tech debt. It's just that continuous tech debt here is not something that takes us by surprise but rather something that we can detect already while analyzing the code and potentially fix, which is generally a good idea.
Now, we mentioned tools, right? So these are the tools that I just put there off the top of my head. The biggest ones probably, so SonarQube step size and then Code Climate Quality, I believe it's called. And there are other tools, CLI tools, tools with the UI and what have you. So let's talk about the pros and cons of heuristic tech debt metrics. Among the pros, there will be the ease to get the numbers or the full code base at once. Basically once you choose the tool and you set it up, you'll get these numbers with all the, you know, necessary split across modules, folders and so on, in minutes, right? Then there will be ease to segment metrics. So get the split by module or what have you that I mentioned previously. And this would be useful to detect potential hot spots. So where the metrics are showing more tag debts than in other places, which would be some spots that you potentially want to take a closer look at. Now, there will be cons, obviously. First would be that it's hard to convert these metrics into the amount of the actual work that the tag debts behind them requires, because, I don't know, take cyclomatic complexity, you know that in this class, it's like 15, or in this method, it is 15. What does it give you in terms of the effort to fix it? Practically nothing. So you will still need to look into it and estimate, interpret it somehow.
Comments