This .md shows the main steps to compute OP to evaluate a mutation reduction strategy in "Mutant reduction evaluation: what is there and what is missing?"
- For a project (e.g. the project in
project/project.rar/
), please modify the "pom.xml" to make sure the PIT plugin is used correctly. - For example, if you have installed PIT-HOM at local, you can implement high-order mutation testing according to the following configuration:
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-parent</artifactId>
<version>1.4.8-HOM</version>
</plugin>
- After modifing the "pom.xml", you can run mutation testing to obtain the report. For example, by command line, you can use:
mvn org.pitest:pitest-maven:mutationCoverage -DoutputFormats=XML -DfullMutationMatrix=true
- Some example reports are in
PITreports
.
By resolving the pit report, the kill relationship between all mutants and all test cases can be obtained.
Use the strategy you want to evaluate to select mutants.
- You should resolve the PIT report by your script to obtain the wanted information in Setp 2 & 3.
- An example information CSV is attached in
coverage
. In a CSV, for a mutant, we record the line number, label(kill or not), mutator, kill tests(sometimes too long to record), path and the coverage information(by cobertura).
The script OP.py in code
provides the functions to compute OP and EROP. To use it, you should obtain the matrix and the selected mutants' index first. In the script, we use the random mutant selection as the example.