PIT Mutant Detection Strategy

186 views
Skip to first unread message

Alex GYORI

unread,
Jan 14, 2014, 7:39:23 PM1/14/14
to pitu...@googlegroups.com
Hi,

I am using PIT to collect mutation scores on a per test basis.
Does pit support the naive detection strategy? I believe in the current setup it uses early-exit fine grained.
Is there a way to make PIT run all tests against a mutant?

Thanks,
Alex

Henry Coles

unread,
Jan 15, 2014, 7:26:56 AM1/15/14
to pitu...@googlegroups.com
On 15 January 2014 00:39, Alex GYORI <alexand...@gmail.com> wrote:

Does pit support the naive detection strategy? I believe in the current setup it uses early-exit fine grained.
Is there a way to make PIT run all tests against a mutant?

It's not built in, but the plugin system introduced in 0.32 manes you can change the behaviour by writing a test prioritiser.

http://pitest.org/quickstart/advanced/

I was planning to write exactly this plugin as an example.

This would not result in all tests being run against each mutant though - execution would still stop on the first failure.

Henry

Alex GYORI

unread,
Jan 15, 2014, 8:41:10 AM1/15/14
to pitu...@googlegroups.com, henry...@googlemail.com
Thanks for the reply. In my understanding, the prioritiser would only change the order in which tests are run but still run only until first failure.

Is there an easy way to obtain the full mutation matrix, i.e., for each test what mutants it kills? This would have to run all selected tests against each mutant and not stop at the first failure?

Thanks,
Alex

henry

unread,
Jan 15, 2014, 4:28:56 PM1/15/14
to pitu...@googlegroups.com, henry...@googlemail.com


On Wednesday, 15 January 2014 13:41:10 UTC, Alex GYORI wrote:
Thanks for the reply. In my understanding, the prioritiser would only change the order in which tests are run but still run only until first failure.


The prioritiser selects which tests will be run and in what order but has no control of whether stopping on first failure.
 
Is there an easy way to obtain the full mutation matrix, i.e., for each test what mutants it kills? This would have to run all selected tests against each mutant and not stop at the first failure?

There isn't an easy way - you'd need to hack the code so that it continued and wrote this information out in some format.

You could probably do something quick and dirty by writing out the result of running each test against a mutant with some hacking to the org.pitest.mutationtest.execute.MutationTestWorker class.

Henry

Luciano Soares

unread,
Oct 9, 2015, 7:46:40 PM10/9/15
to PIT Users, henry...@googlemail.com
Hello All,

Is not yet any way to run all tests against the mutants?

I need a fault matrix, and for that I think tha naive approach would be adequate instead the early exit fine.

Thanks

August Shi

unread,
Oct 11, 2015, 1:41:51 AM10/11/15
to PIT Users, henry...@googlemail.com
If you're looking for something quick and dirty, I have a fork of the repository and modified it to not exit early when performing mutant analysis and report all tests that kill a mutant, found at https://github.com/august782/pitest. I unfortunately have not yet worked out propagating an option from the front-end to control whether or not to run all tests, so right now it's permanently set to do the naive approach.

Luciano Soares

unread,
Oct 14, 2015, 11:30:42 AM10/14/15
to PIT Users, henry...@googlemail.com
Thanks August,

I'll try your approach

Best Regards
Reply all
Reply to author
Forward
0 new messages