The top 4 challenges banks have with unit testing and how to overcome them

Banks and financial services encounter a lot of challenges when it comes to unit testing, but what are they specifically, and how can banks go about solving them?

The purpose of unit testing is to make sure existing code still behaves as intended when changes are made elsewhere in the codebase. Unit testing is a costly and occasionally overwhelming task, but it’s one of vital importance—especially for institutions that deal with large amounts of personal information and look after everyone’s money.

We’ve compiled a list of the top four challenges banks encounter with unit testing and how they can be overcome:

1) Mammoth codebases 

In at number one, the huge size of many codebases is daunting to work with. This seems pretty basic, but not being able to trace the impacts one code change can have on seemingly unrelated code is a critical issue worsened by scale. Unsurprisingly, large companies like banks use a lot of applications and deal with a lot of code—millions of lines in some cases. Much (if not most) of this code was written without accompanying tests, meaning there are a lot of areas in the code that aren’t well documented. Catching up with writing unit tests for this much code is almost impossible to do manually. 

2) Changing work culture

In the past few decades, there has been a radical shift in career behavior, including among developers and software engineers, with a general trend towards frequently switching workplaces instead of spending long stretches of a career with one company. This movement of labor in the tech field means many software developers and engineers are not staying on as long in the same role—in many cases working only an average of 1.5 to 3 years at one place—as they would have in the past. Different developers have their own styles for writing (or not writing) tests and may be the only expert in the company for any given subject. Without adequate knowledge transfer, high turnover further increases the amount of legacy code the company has to deal with. 

3) Customer expectations

Users have little patience for applications that don’t stay up-to-date, and with rising consumer expectations comes pressure for developers to overlook a final bit of quality in order to get new features on the market faster. As a result, unit testing is shelved for later, which very quickly becomes never. 

4) Technical debt (it’s expensive)

When developers feel pressured to take a shortcut to solve a problem in the short-term and then mean to come back to it later, technical debt is created. Paying off technical debt requires extensive refactoring and finding more stable and efficient solutions to problems, but for organizations with legacy code, refactoring is risky without also writing unit tests. As a result, developers have to spend time writing tests instead of developing new features for the company, and time is money. Capgemini’s 2017-2018 World Quality Report found that testing amounted to 26% of overall software development costs in 2016, and is expected to rise to 32% by 2020.

Non-testing maintenance of legacy code is costly too: research from CAST Research Labs estimates that legacy code maintenance costs an average of $3.61 per line of code. Banks have to work out how much quality code is worth to them. 

So, what is the solution to all of this?

Unit Testing Solutions with Diffblue Cover 

Most of these challenges come back to legacy code, and Diffblue has developed a tool that makes managing legacy code easy. Using AI for Code, Diffblue Cover can automatically generate unit tests for any Java codebase. It’s a great fit for global banks that prioritize both quality and efficiency in their software development, which is why Diffblue has been working with Goldman Sachs to streamline their unit testing creation and legacy code modernization.

Developers can check or refactor the unit tests created by Diffblue Cover as they please, but no longer have to write them from scratch, enhancing the unit testing process and making it more agile. Ultimately, Diffblue Cover increases the speed and quality of legacy code development so banks can focus on the future.