Skip to main content

Mutation Testing

Code coverage is a bad metric for evaluating code quality. We should stop using it. Mutation testing isnโ€™t perfect, but it evaluates test strength, which is a better metric. The main cost of mutation testing is that itโ€™s computationally expensive and its execution time grows exponentially as your codebase grows.

I use Pitest for mutation testing my Java code. Pitest has a Maven goal to target only files that have SCM-pending changes. Very useful for cutting down on execution time.

Articles to read: