我已阅读以下链接中的文档
但是,我仍然不清楚如何使用EvoSuite。
当我编写java -jar evosuite.jar -help
命令时,出现以下错误
找不到主类:org.evosuite.Evosuite。程序将会退出。
我很感激任何帮助。
我已经使用 Evosuite 一年多了,它对我来说很好用。尝试重新下载。这是一个小例子,说明它如何Plant
在包中名为的类上工作,并使用选项PlantTest
将依赖项放在类路径中。-projectCP
java -jar evosuite.jar -class PlantTest.Plant -projectCP ./PlantMutant.jar
* EvoSuite
* Going to generate test cases for class: PlantTest.Plant
* Starting client
* Connecting to master process on port 12405
* Analyzing classpath:
- ./PlantMutant.jar
* Finished analyzing classpath
* Generating tests for class PlantTest.Plant
* Test criterion:
- Branch coverage
* Setting up search algorithm for whole suite generation
[Progress:> 0%] [Cov:> 0%]* Total number of test goals: 29
* Using seed 1430263541223
* Starting evolution
[Progress:> 3%] [Cov:===================================100%]
* Search finished after 2s and 2 generations, 5815 statements, best individual has fitness:
- Branch 0.0
* Minimizing test suite
* Coverage of criterion BRANCH: 100%
* Generated 11 tests with total length 24
* Resulting test suite's coverage: 100%
* GA-Budget:
- RMIStoppingCondition
- ShutdownTestWriter : 0 / 0
- ZeroFitness : 0 / 0 Finished!
- MaxTime : 3 / 60
* Time spent executing tests: 2256ms
* Generating assertions
* Resulting test suite's mutation score: 72%
* Compiling and checking tests
* Writing JUnit test case 'PlantEvoSuiteTest' to evosuite-tests
* Done!
* Computation finished
希望能帮助到你。