How to Deal with Tech Debt in a Fast-Growing Engineering Organization?
Tags: productivity, leadership, management, learning
Published: 2023-08-31 13:21:33

“If it works, don’t touch it” is the unwritten mantra in the dev world. If only, one could understand its long-term implications.

At large enterprises, [54%](https://assets.website-files.com/5f922f81cc30586744dc7122/60e306c6db6224328eaf47a3_Tech%20debt%20report.pdf) of engineers spend a significant amount of their time dealing with technical debt, aka code debt or tech debt. Yet, most of the engineering projects are infected with it, and none can truly claim to have zero technical debt. Though there could be huge cost implications of technical debt, not all engineering teams proactively address it. It’s because the damage it incurs is not always tangible or quantifiable. 

But the consequences can be very severe. For instance, in a survey, [51%](https://www.stepsize.com/report) of engineers said they considered changing jobs because of technical debt. So, many engineering teams, and inexperienced managers commit the grave mistake of letting the tech debt pile up over the course of software development lifecycle stages. In our insight on the [cost implications of tech debt](https://docs.google.com/document/d/1Q-IH-R6fKDSM8BQo_OHMnPLSaVL9Wg6qssERcqy3NRc/edit#), we have briefly explained why fast-growing engineering companies must prioritize reducing their tech debt. 

Read this insight to find out how to effectively deal with accruing tech debt.

## **1. Don The Evangelist Hat & Spread The Word**
 
‘We follow best engineering practices, and our tech debt is trivial in nature. So, we can focus on more important things than wasting our engineering resources on something with no business significance.’ 

That’s a very irresponsible and dumbfounded mindset to be in. Tech debt is inevitable, you may even call it ‘integral’ to software projects. Like a stealthy termite, it slowly gnaws away at the foundation of your engineering company, quietly wreaking havoc on your potential growth and organizational stability. 

Just as a termite infestation remains unnoticed until the damage becomes apparent, the insidious nature of technical debt creeps into your codebase, eroding its quality and impeding progress

For example, 52% voted technical debt as the biggest factor hampering developer productivity. So, first & foremost, you along with all the stakeholders need to recognize and acknowledge the existence of tech debt. Understand its impact on organizational growth in the long run. Ensure that the developers, the project manager, [the tech lead, the engineering managers](https://www.hatica.io/blog/tech-lead-vs-engineering-manager/?utm_source=dev.to&utm_medium=referral&utm_campaign=tech+debt), and the CXOs are all on the same page. This helps in cultivating a culture that prioritizes continuous maintenance and reduces technical debt.

## **2. Define Tech Debt**
 
Tech debt can sprout and spread like wild bushes, entangling your code base, and obscuring [developer productivity](https://www.hatica.io/blog/developer-productivity/), and innovation. It can be incredibly frustrating and demoralizing to deal with. Amateur developers tend to take shortcuts that can have long-term consequences. The quick fixes, patches, and band-aid code solutions can introduce complexities in the code that take a lifetime to decipher and work around. It not just stifles creativity & innovation, but is a massive roadblock to productivity.

Developer habits and coding practices aren’t the only sources of technical debt. It could also be evolving nature of the business, where requirements change. Developers cannot always anticipate the future state of a function, and they tend to implement solutions as per the present understanding of the business problem. 

For instance, consider a hypothetical eCommerce platform. The platform is growing well and decides to expand its business to a neighboring country. Now, developers need to accommodate this business decision and do so swiftly. Based on their understanding of the problem, they chose to introduce an extra function with hard-coded tax calculations and extend support for accepting the currency of the new market. This function gets invoked in the main cart payments function to calculate the total invoice value. 

Later, when the country plans to extend to other countries. The development team will be left with no option but to rework & modularize the tax calculation functionality, and introduce an abstraction layer for teams in the new market to independently manage the taxes and other relevant compliances without the need for any intervention from the core development team. 

For brevity, we are not getting into the details of how these business decisions would introduce complexities in the Shipment, Catalog, Product Pricing, and other eCommerce software modules. But you would agree that the development decisions that were made with the short-time-view of the business understanding, would require a lot of rework and extra effort in the long run.

There are multiple other [types of technical debt](https://kellanem.com/notes/towards-an-understanding-of-technical-debt). But the point we are trying to make here is that you must define & understand the nature of the technical debt accruing in your organization. So that you can go back to the root cause and fix it rather than wasting your engineering capabilities on firefighting and playing the catch-up game. In general, the source of tech debt could be emanating from:

- Poor quality code with high duplication and violation of coding **conventions** that leaves loopholes in the code.

- Inadequate, non-scalable, non-modular **architecture** attracts a lot of shortcuts to meet the market demand, and as a result, bugs are introduced in the software.

- Inefficient or insufficient **testing** and code coverage, which results in undetected bugs being pushed to delivery/deployment.

- Improper, incomplete, or outdated **documentation** can hinder the effective maintenance of a code repository. In fact, it can frustrate, and lower the morale of developers

- Software **dependencies** i.e., poorly maintained or installed software/hardware components that can introduce security risks and limit application scalability.

- Ill **processes** like frequent delivery at the cost of defects.

In a nutshell, proactively deal with tech debt by anticipating the nature of tech debt you could be introducing in your digital infrastructure. Continuously filter out bad processes & practices, improve components with low-quality code, and upgrade infrastructure for modularity & abstraction without trading off performance.

## **3. Quantify Tech Debt**

If you do not want to discourage your developers from even looking at code, use code metrics like Cyclomatic complexity, code coverage, SQUALE rating, static code analysis violations, code size, code smells, bugs count, etcetera to assess the severity of tech debt, and actively work to reduce it:

- Studies have shown that functions with high [Cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity#cite_note-schroeder99-14), and code duplication also tend to have more defects, which ultimately introduces unwanted tech debt.

- If your tests are flakey, and the **code coverage** is below par, high chances are that areas of the code that are not adequately tested may have undetected bugs that put your system at risk, exposes it vulnerable, and contributes to technical debt.

- [SQALE rating](https://en.wikipedia.org/wiki/SQALE) (Software Quality Assessment based on Lifecycle Expectations) is a metric to evaluate the quality of your source code. It helps you evaluate the accruing tech debt by assigning a numerical score based on factors like maintainability, testability, reliability, security, portability, reliability, reusability, and efficiency. Tools like SonarCube successfully implemented the SQALE methodology to help you evaluate your tech debt.

- **Code Smells** are the indicators of poor design implementations which are prevalent in the form of long methods & classes, duplicated code, poor naming conventions, inefficient use of control structures, and excessive coupling. These are not bugs, but because of the complexity it introduces, the blocks of software that exhibit code smell characteristics are painfully hard to maintain, modify, or upgrade. And thus, contributes to the technical debt.

- Engineering managers must monitor [engineering KPIs](https://www.hatica.io/blog/engineering-kpis/?utm_source=dev.to&utm_medium=referral&utm_campaign=tech+debt) like Release frequency, MTTR, Cycle Time, etcetera to anticipate if technical debt is at play and hampering your SDLC process. Infrequent, or irregular **release velocity, high MTTR, and high Cycle time** could be the signals of technical debt hindering you from shipping new features to the market. Looking holistically at engineering KPIs and code quality metrics gives you a deeper insight into the actual impact of tech debt. 

## **4. Measure The Cost of Ignoring Technical Debt**

With accruing debt, the risk of system failures, crashes, and security vulnerabilities increases. It not just breaks the UX, but harms your brand as well. Besides, developers do not want to spend time on re-writing or fixing the mistakes of someone else. They find it highly demotivating to be wasting time playing code police.
The frustration is not just for developers, but also for engineering managers and other stakeholders. Because the more the system grows without addressing the tech debt, the tougher it becomes for a new developer to jump in and start contributing. Managers have a tough time onboarding & retaining developers for working on a highly convoluted code base.
So, assess what you’re losing in terms of the wasted developer, engineering manager’s time, the cost you pay for operational maintenance of legacy systems, or obsolete hardware devices, the opportunity costs, etcetera. 

Metaphorically speaking, calculate the interest and any direct or indirect liabilities in terms of lost opportunities, developer productivity loss owing to debt frustration & demotivation, loss of brand value, and customer churn. 

Read our insight on the [cost implications of tech debt](https://docs.google.com/document/d/1Q-IH-R6fKDSM8BQo_OHMnPLSaVL9Wg6qssERcqy3NRc/edit#) to dive deeper into how tech debt impacts every facet of your business.

## **5. Strategize & Prioritize**

Tech debt is the lingering pain, or call it a strain, that drains your teams of enthusiasm, productivity, and performance. It needs to be actively dealt with. 

- Once you have identified the source or cause of tech debt, assessed the possible fixes, and estimated the investment needed, communicate the same to the entire team and explain the type, severity, cause, and associated cost implications of the code debt.

- Win the buy-in from the stakeholders to actively dedicate time and resources to reduce technical debt.

- Put efforts toward maintenance, refactoring, bug fixes, and code-quality improvement in all your sprints.

## **6. Continuously Reduce Your Tech Debt**

How you deal with tech debt, will be highly driven by the nature of the debt, its severity, and the resources you have, among multiple other factors. But on a high level, continuously improving the engineering processes and practices in your organization, and building a security-first culture with high ownership could be beneficial in dealing with the tech debt.

### **Agile & DevOps Tonic**
 
Adopt agile methodologies, test-driven development approaches, and DevOps practices to better respond to changing market conditions.
Focus on writing extensive test cases for maximum code coverage. Continuous-testing-led CI/CD pipelines are effective at yielding high-quality software. Remember, testing is not a silver bullet that you use once and you’re done. It is not done and forgotten, but rather a continuous improvement process. So, you would need to keep improving your test cases iteratively for the best outcomes.

### **Refactoring is your X-factor**

Refactor your legacy code to modernize it and structure your messy spaghetti code to make it more readable and maintainable. Refactoring, in-line comments, and structuring code blocks are quite effective at reducing tech debt.

Use the aforementioned metrics to quantify & prioritize your tech debt. Using engineering analytics and code quality assessment tools, you can analyze your git repositories for metrics like code ownership, code cohesion, code coupling, and code churn to pin-point files that are the major contributors to tech debt. 

For example, as [Microsoft](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/bird2011dtm.pdf) reported, a higher level of code ownership for a software component, or components with fewer contributors will have fewer failures compared to a lower level of code ownership or more contributors to a repository file.

Similarly, as found in research, files with high code churn i.e., active files in your git repository (2%-8%) which are actively being modified daily, or a couple of times every week for a few months are [reported](https://dl.acm.org/doi/10.1145/2591062.2591176) to introduce the majority of bugs in your code (65%-95%).
Your engineering analytics tool can help you identify high-churn files, and you can consciously work on them to refactor the code for modularisation, and extensively document the dependencies or functionality for future modifications for preventing technical debt.

### **Excellence is the way forward**

As a rule of thumb, upskill your developers and solutions architects to write high-quality software while adhering to best programming practices and conventions. Inculcate a culture of regular and thorough code reviews, extensive documentation, and continuous debt mitigation to patch the loopholes, and build for resilience. The better the quality of your code, the lower the tech debt.

## **Say Goodbye to Tech Debt with Hatica**

As an engineering VP, manager, or lead, you must shoulder the responsibility to keep your organization debt free (metaphorically, free from technical debt). And ensure the well-being of your developers. After all, no one gives their best when they are frustrated and demoralized. 

So, strive to gain visibility into your engineering practices, processes, and operations. Track the metrics & generate reports that reflect your engineering health, the tech debt you might be accruing, and how it hits the bottom line. Make effective use of these metrics, look at them holistically to connect the dots, and identify the specific files, software components, or teams who might be unintentionally contributing to the tech debt, and deterring everyone from unleashing their best potential. 

Tools like [Hatica](https://www.hatica.io/?utm_source=dev.to&utm_medium=referral&utm_campaign=tech+debt), give you clear visibility into your engineering health and help you resolve tech debt problems. Hatica integrates directly with your engineering stack to pull data around 130+ engineering metrics to enable you to assess your engineering health and tackle the tech debt issues. Here’s a quick sneak into different platforms from where Hatica dynamically pulls data and helps you visualize them via interactive dashboards:

- Git platforms (GitHub, GitLab, etc)

- CI/CD pipeline tools (CircleCI, Jenkins, etc)

- [Incident management tools](https://www.hatica.io/blog/incident-management-tools/?utm_source=dev.to&utm_medium=referral&utm_campaign=tech+debt) (PagerDuty, OpsGenie)

- Project management tools (Jira, Asana, etc)

- And other apps that your engineering team uses

[Explore Hatica](https://www.hatica.io/?utm_source=dev.to&utm_medium=referral&utm_campaign=tech+debt) to evaluate how it can help you tackle technical debt, improve your engineering health, and enhance your developer experience & productivity.

To conclude, the vicious impact of technical debt can spread beyond your core engineering department, and may badly impact your regular business operations. It can even hit your supply chain hard. 

Today, IT is the enabler and differentiator. It can help you beat the competition and win customers through innovation and awfully good customer experiences. But if you let something as cancerous as technical debt hold its foot, it becomes unmanageable. And ultimately, detrimental to your organizational growth.

Don’t let your debt pile up, else you may go bankrupt paying it back.

Go debt-free with [Hatica](https://www.hatica.io/?utm_source=dev.to&utm_medium=referral&utm_campaign=tech+debt).