简体   繁体   English

Randoop 为所有类生成具有相同名称的测试

[英]Randoop generates tests with same name for all of the classes

I want to generate tests for 200 classes (I have put their classes names in --classlist txt) but Randoop generates RegressionTest0.java to RegressionTestN.java and replaces generated files because they have same name.我想为 200 个类生成测试(我已将它们的类名放在 --classlist txt 中),但 Randoop 生成 RegressionTest0.java 到 RegressionTestN.java 并替换生成的文件,因为它们具有相同的名称。 Is it possible for Randoop to generate tests files with same name as class names, I have put in the classlist file? Randoop 是否可以生成与 class 名称同名的测试文件,我已放入类列表文件? For example, I have a KMeans.java class and Randoop generate KMeans0.java to KMeansN.java instead of RegressionTest.java? For example, I have a KMeans.java class and Randoop generate KMeans0.java to KMeansN.java instead of RegressionTest.java? Thanks.谢谢。

Each generated test may call any or all of the classes under test.每个生成的测试都可以调用任何或所有被测类。 For example, if your classlist file contains Class1.java , Class2.java , and Class3.java , then each generated test might call all three classes.例如,如果您的类列表文件包含Class1.javaClass2.javaClass3.java ,则每个类都可能调用三个类。 Randoop does not create a separate set of tests for each class. Randoop 不会为每个 class 创建单独的测试集。

If there is only one class under test (which is definitely against the recommended practice,).如果只有一个 class 在测试中(这绝对违反推荐的做法)。 then you could rename the files and the classes within them after they are generated, But that is not your situation.那么您可以在生成文件和其中的类后重命名它们,但这不是您的情况。 as you described above.正如你上面描述的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM