PUT Mutation test on apache commons math shows line coverage and mutation coverage as 0%

I am trying to use maven PUT Mutation testing for general apache 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 can run it, but the index files show line coverage and mutation coverage as 0%. I think I am not giving the parameters correctly. Also, I need to mutate one apache-common-math test. LUDecomposition.

+3


source to share


1 answer


Before running the mutation test analysis, run mvn test

to compile the main and test classes (and by the way, make sure all tests pass, which may affect the PIT results).

After mvn clean

or in a recently cloned repository, the PIT does not have any classes to mutate and you might get the mentioned message.



By default, the Maven PIT plugin accepts groupId as the base package, so it is quite normal for commons-math to omit the config section. Also update the PIT version to 1.1.0 (or newest when available) to avoid hitting already fixed bugs.

+3


source







All Articles