boxed / mutmut

Mutation testing system
https://mutmut.readthedocs.io
BSD 3-Clause "New" or "Revised" License
897 stars 108 forks source link

Probabilistic (random) Mutation #278

Open benedikt-mangold opened 1 year ago

benedikt-mangold commented 1 year ago

I would like to have a setting, where each suitable mutation is only applied with a probability of x (e.g. 50%) for one mutation-run.

Then, being able to configure N mutation-runs (e.g. N=100), getting the stats on

This allows to break down the quality statistics on a lower level (e.g. functions, lines of code) to point towards subparts that are tested particularly well / week

boxed commented 1 year ago

That seems like just sometimes running some mutants multiple times unnecessarily and missing some, while taking more time.

benedikt-mangold commented 1 year ago

From a statistical point of view, you can get insights on "how many mutants do you need to affect the results of a test". As an example - test is not failing, two mutants are present in the function. How do you know which one is actually responsible? By (randomly) eliminating one mutant (over the N runs), you can assign importances to mutants, depending on how many tests are affected solely due to a single mutant

boxed commented 1 year ago

two mutants are present in the function

That's never the case. Mutmut always tests exactly one mutant at a time.