-
Notifications
You must be signed in to change notification settings - Fork 1
The Pitest Framework
Pitest (formerly known as "PIT") is a widely used open-source mutation testing tool for Java applications. It is highly configurable and provides detailed reports on mutation testing results.
- Easy Integration: Pitest can be easily integrated into the Java project using build tools like Maven or Gradle.
- Mutation Strategies: Pitest supports various mutation strategies, including replacing method calls with no-ops, changing mathematical operations, and more. This is done by bytecode manipulation which makes it one of the fastest mutation testing frameworks.
- Parallel Execution: Pitest can run mutations in parallel, which can significantly speed up the testing process.
- Detailed Reports: Pitest generates comprehensive HTML and XML reports that provide insights into the mutation testing results, including mutation score, killed/surviving mutants, and test case information.
- Mutation Analysis Thresholds: One can configure Pitest to set mutation analysis thresholds, helping to define what level of mutation score is acceptable for the project.
There are several ways to install Pitest, including as a command line tool line or as a plugin. Since it is generally recommended against installing the command line tool and given that our project uses Gradle as its build system, please refer to the installation guide for the Gradle plugin for PIT by Marcin Zajączkowski: https://gradle-pitest-plugin.solidsoft.info/
pitest {
targetClasses = ['our.base.package.*'] //by default "${project.group}.*"
pitestVersion = '1.15.0' //not needed when a default PIT version should be used
threads = 4
outputFormats = ["XML", "HTML"]
timestampedReports = false
//etc.
}
See List of PITest parameters here and here
taskClasspath, mutableCodePaths, sourceDirs, reportDir, verbosity and pitestVersion are automatically set by the plugin. sourceDirs, reportDir, verbosity and pitestVersion can be overridden.