Mutation testing - Pittest error (No mutations found)

北城余情 提交于 2021-01-28 08:45:37

问题


I am using https://github.com/hcoles/pitest to write mutation tests on our existing Unit Test suite. We are getting an error as below:

12:09:40 PM PIT >> INFO : MINION : 12:09:40 PM PIT >> FINE : Expecting 1 tests classes from parent

12:09:40 PM PIT >> INFO : MINION : 12:09:40 PM PIT >> FINE : Tests classes received

12:09:40 PM PIT >> INFO : MINION : 12:09:40 PM PIT >> INFO : Found  0 tests

12:09:40 PM PIT >> INFO : MINION : 12:09:40 PM PIT >> INFO : Dependency analysis reduced number of potential tests by 0

12:09:40 PM PIT >> INFO : MINION : 12:09:40 PM PIT >> INFO : 0 tests received

12:09:40 PM PIT >> INFO : MINION : 12:09:40 PM PIT >> FINE : Running 0 units

12:09:40 PM PIT >> FINE : Coverage generator Minion exited ok
12:09:40 PM PIT >> INFO : Calculated coverage in 0 seconds.
12:09:40 PM PIT >> FINE : Used memory after coverage calculation 26 mb
12:09:40 PM PIT >> FINE : Free Memory after coverage calculation 219 mb
12:09:40 PM PIT >> INFO : Created  0 mutation test units
Exception in thread "main" org.pitest.help.PitHelpError: No mutations found. This probably means there is an issue with either the supplied classpath or filters.
See http://pitest.org for more details.
    at org.pitest.mutationtest.tooling.MutationCoverage.checkMutationsFound(MutationCoverage.java:287)
    at org.pitest.mutationtest.tooling.MutationCoverage.runReport(MutationCoverage.java:138)
    at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:103)
    at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:45)
    at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:87)
    at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:45)

I ran both using Ant and Command Line, and ended in the same error. The command we are running is:

java -cp ".:classes:lib/*:otherlib/*" org.pitest.mutationtest.commandline.MutationCoverageReport --reportDir "test-result-cli" --targetClasses "tests.unitest.*" --targetTests "tests.unitest.PiExample" --sourceDirs "src" --mutators "ALL" --verbose

Could someone tell what might be doing wrong? We checked the classpath and the source path, and they are correct. I wonder if Pittest makes an assumption on how the test class name should be?

Any help will be greatly appreciated.

来源:https://stackoverflow.com/questions/43742990/mutation-testing-pittest-error-no-mutations-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!