Is mutation testing useful in practice

code-coveragemutation-testingtestingunit testing

Do you have any examples of real life applications of mutation testing? Does it work better than simple test coverage tools? Or is it useless?

What are the advantages/disadvantages of mutation testing in the real world?

Best Answer

The usefulness of unit tests is no longer discussed. They are essential in conception of a quality application. But, how can we assess their relevance? A code coverage indicator up to 100% doesn’t mean the code is 100% tested. This is just a view of executed code during unit tests execution. Mutation testing will allow you to have more confidence in your tests.

This is a two step process:

  1. Generate mutants.
  2. Check that the mutations are found by the tests.

I wrote a entire article about this process, including some concrete cases.

Related Topic