Menu

My Vue Library Had 99% Line Coverage. Mutation Testing Found Two Bugs Anyway.
📰

My Vue Library Had 99% Line Coverage. Mutation Testing Found Two Bugs Anyway.

DEV Community: vue·Navid jaberi·21 days ago
#F5e3xXi6
#devtovue#devto#dev#zz1234#tests
Reading 0:00
15s threshold

On October 2nd, vue-smart-loading-kit had 1,369 unit tests and 99% line coverage. That afternoon I added Stryker for mutation testing. About an hour and a half later I released 0.3.1 with fixes for two bugs my tests had missed.

What mutation testing checks

Coverage tells you which lines ran during your tests. It can't tell you whether a test would fail if one of those lines were wrong.

Stryker checks that part. It makes one small change to your source at a time, like flipping a condition, changing a default or removing a call, and runs your tests against each changed version. Each version is called a mutant. If a test fails, the mutant is killed. If all your tests still pass, it survived, and you've found code that no test really checks.

The config

I run mutation testing against the unit tests only.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.