Member-only story
The importance of unit testing in software development
In my daily work as (freelance) software engineer I’ve been working for many different companies, varying from small companies to large enterprise companies. One thing they all have in common is that they have lots of software, and in turn, even more code to maintain.
I love greenfield projects because it allows to create great software from scratch. However, most clients also require maintenance on their existing software. The larger the codebase, the more challenging it can be to develop new features, fix bugs, do extensive refactoring etc. — without breaking existing functionality.
When starting at a new client, one of the first things I ask is: ‘Where can I find the unit tests?’ Surprisingly enough, I frequently get the answer that ‘we don’t do unit testing here’. Of course, I want to know why not.
Some of the reasons not to do unit testing that I’ve heard often are:
- Time and budget constraints: writing unit tests takes time and effort, and some companies may prioritize completing the project on time and within budget over investing in writing tests. This may be particularly true for smaller companies or startups that need to move quickly to remain competitive.
- Lack of understanding or expertise: some developers may not be familiar with unit testing or may lack the necessary skills to write effective tests. In such cases, the company may choose to skip writing unit tests altogether.