首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何集成EvoSuite测试用例生成工具

如何集成EvoSuite测试用例生成工具
EN

Stack Overflow用户
提问于 2014-12-01 04:08:10
回答 1查看 1.4K关注 0票数 2

我已经阅读了以下链接中的文档

但是,我仍然不清楚如何使用EvoSuite。

当我编写java -jar evosuite.jar -help命令时,我得到以下错误

找不到主类: org.evosuite.Evosuite。程序将退出。

我很感谢你的帮助。

EN

回答 1

Stack Overflow用户

发布于 2015-04-29 07:29:38

我已经使用Evosuite一年多了,它对我来说运行得很好。请尝试再次下载。下面是一个小示例,演示了它如何在PlantTest包中名为Plant的类上工作,并使用-projectCP选项将您的依赖项放在类路径中。

代码语言:javascript
复制
java -jar evosuite.jar -class PlantTest.Plant -projectCP ./PlantMutant.jar
代码语言:javascript
复制
* 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

希望能有所帮助。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27217676

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档