DEV Community

Tomasz Ślązok
Tomasz Ślązok

Posted on

Code Coverage at Landingi

Code Coverage is a negative metric, because it shows us problems we have, not how we could improve.
At Landingi, we waited a long time before deciding to enforce the code coverage for each Pull Request. We were concerned that people would focus on KPI by writing tests for setters, getters, or other irrelevant stuff.

Quality does not equal quantity. You should focus on what you test and how to make sure you won’t make yourself harm in the long run. You can write a lot of tests for bad code, as a result, you get situations that it will be very difficult to change anything.

Ultimately, we decided to implement the rule that every PR is covered in at least 80%. Thanks to the @codecov it was very simple. We wanted to improve psychological safety for our developers and increase productivity in long run. After a few days, we got good feedback from our team. I hope it will be better and better.

P.S. We have plans to introduce mutation testing to improve our unit tests suites.

Top comments (0)