我目前正在尝试 PITest,到目前为止它工作正常。但是,它非常慢,到目前为止唯一的解决方案是使用增量分析,这可能会解决缓慢的问题。我试图按照文档中的描述进行设置。这是我的配置:
<build>
<plugins>
<plugin>
<executions>
<execution>
<id>pitest-mutation-coverage</id>
<goals>
<goal>mutationCoverage</goal>
</goals>
</execution>
</executions>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.4.6</version>
<configuration>
<threads>8</threads>
<timestampedReports>false</timestampedReports>
<historyInputFile>${project.basedir}/pitest.history</historyInputFile>
<historyOutputFile>${project.basedir}/pitest.history</historyOutputFile>
<avoidCallsTo>
<avoidCallsTo>java.util.logging</avoidCallsTo>
<avoidCallsTo>org.slf4j</avoidCallsTo>
</avoidCallsTo>
<mutators>
<mutator>DEFAULTS</mutator>
</mutators>
</configuration>
</plugin>
</plugins>
但是,在实践中,我没有看到 PITest 将 historyInput 和 historyOutput 考虑在内,而是在我看到的日志中
[INFO] Will read and write history at /var/folders/x1/qp5hhks571q0drb7kd7vjn0c0000gn/T/my.module.groupId.artifactId.version_pitest_history.bin
我尝试了很多不同的设置,但它们似乎都不起作用。有什么我想念的吗?
更新
最后,事实证明插件定义来自 parent-pom,并且在继承的 child-pom 中覆盖它是部分可能的。