Article generic image

Encountering applications that have 0% test coverage

Feb 22, 2023

From time to time in a career as a software engineer, we all encounter applications that were not written in a perfect manner. Maybe the architecture is weird, or the code is “spaghetti code” or there is something else, like the technologies used are not optimal or deprecated. All that happens from time to time and we manage, ask questions, learn new technologies, improve/refactor the code. But what can we do when on top of that, the application test coverage is 0%? Should we go into despair? Roll on the floor and cry? Or maybe go into rage mode? It seems tempting to do that, but that doesn’t solve our problem of adding new code into that non-tested application and neither the problem of our client who has an expensive and heavy to maintain application.

So what to do?

At SIGIT Agency, we’ve developed an approach to solve this challenge:

  • Educate the client:We help our clients understand the importance of testing and how to write effective tests. If the client already has a development team, we offer to organize workshops on writing tests.
  • Lead by example:We write the first set of tests as an example and encourage other members of the development team to continue writing tests.
  • Implement test coverage requirements: We introduce pull requests with test coverage analysis requirements, meaning that any new code must be covered by tests before it can be merged.

These 3 steps will not need a big, time consuming refactoring, but will instead introduce tests and increase test coverage over time. As functionalities are added the code will be refactored and the tests will be written.
So hopefully after some time, depending on the application size, the code will be easier to maintain and the developers will sleep more peacefully because the tests are there to keep them calm at night. :)
P.S. We are always looking for long term partners to whom we can offer not only programming, but also deep dive in into their business needs so we can deliver optimal software solutions and consultancy about the best practices from the software engineering world!