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.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay