Reputation: 203
I am trying to use PIT Mutation testing with maven for apache common math tests.
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>0.29</version>
<configuration>
<targetClasses>
<param>org.*</param>
</targetClasses>
<targetTests>
<param>org.*</param>
</targetTests>
</configuration>
</plugin>
I added this to my pom.xml and mvn org.pitest:pitest-maven:mutationCoverage
. I am able to run it but index files show Line Coverage and Mutation Coverage as 0%. I think I am not giving the parameters correctly. Moreover I need to mutate one test of apache-common-math For e.g. LUDecomposition.
Upvotes: 4
Views: 1767
Reputation: 4126
Before running of mutation testing analysis run mvn test
to compile main and test classes (and by the way verify that all tests pass which may affect PIT results).
After mvn clean
or on a freshly cloned repository PIT doesn't have any classes to mutate and you can get mentioned message.
By default PIT plugin for Maven takes groupId as a base package, so for commons-math it is ok to completely omit a configuration section. Also update PIT version to 1.1.0 (or newest when available) to not hit already fixed bugs.
Upvotes: 3