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:
- State of Mutation Testing at Google
- A coworker sent this to me