Skip to content

With mutastic

A property passing says the rule held for the inputs drawn. Whether those properties would catch a bug is another question, and mutastic answers it: it makes small changes to your code, mutants, and runs your tests against each. proptastic is made to work with it, so a property’s verdict on a mutant is the same every run, and says which input caught it.

A property that catches a mutant on only some inputs would catch it one run and miss it the next. So mutastic gives every property the same seed for every mutant, 0x0 unless you give one, and turns off what would carry from one mutant’s run to the next: saved counterexamples, events, the corpus and colour. Two runs of the same code draw the same inputs, and you set nothing.

A caught mutant’s card names the input that caught it, read from the property’s failure, as its counterexample line says it. In a run of every mutant, shrinking is off, as the first failing input is enough; run one mutant alone and the property shrinks, and the card names the smallest.

mutastic can record which corpus entries catch which mutants: with PROPTASTIC_MUTANT naming the mutant and PROPTASTIC_CORPUS_MATRIX a file, a run appends whether each entry caught it. proptastic corpus --prune reads that record and keeps the fewest entries that still catch every mutant any entry caught: Keeping the corpus.

mutastic’s property tests page says the same from its side.

Privacy