【发布时间】:2014-12-24 15:31:33
【问题描述】:
我正在尝试将 PIT Mutation 测试与 maven 一起用于 apache 常见数学测试。
<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>
我将此添加到我的 pom.xml 和 mvn org.pitest:pitest-maven:mutationCoverage。我可以运行它,但索引文件显示 Line Coverage 和 Mutation Coverage 为 0%。我想我没有正确给出参数。此外,我需要改变 apache-common-math 的一项测试,例如LU分解。
【问题讨论】:
-
0.29 已经很老了——修复了一些错误。使用 1.1.0。你在输出中有任何错误吗?您可以与 Gist 或 Pastebin 共享输出。
-
pastebin.com/3pMyViti。我尝试过更突然结束的 1.1.0 版本。这是版本 1.1.0 pastebin.com/wdXmig1h 的错误。
-
org.*范围很广 - PIT 的类也匹配 (org.pitest)。正如我在回答中建议的那样,您可以省略这两个参数进行基本分析或将其定义为org.apache.commons.math3.*。 -
“变异一个测试”是什么意思?如果您的意思是您只想为特定类创建突变,请将 targetClasses 设置为 org.apache.commons.math3.linear.LUDecomposition 并将 targetTests 设置为 org.apache.commons。
标签: java maven maven-plugin mutation-testing pitest