简体   繁体   English

使用 Kotlin 进行随机数

[英]Randoop with Kotlin

Is there any way (other than migrating Kotlin code to Java with IntelliJ) to make Randoop work with Kotlin?有什么方法(除了使用 IntelliJ 将 Kotlin 代码迁移到 Java 之外)让 Randoop 与 Kotlin 一起工作? If not is there any other "official" (well-known, tested, widely used) solution for unit test generating in Kotlin projects?如果没有,在 Kotlin 项目中生成单元测试是否还有其他“官方”(众所周知的、经过测试的、广泛使用的)解决方案?

Randoop's input is .class or .jar files. Randoop 的输入是.class.jar文件。 Randoop generates Java JUnit test cases. Randoop 生成 Java JUnit 测试用例。 If you are willing to have Java tests for your Kotlin code, then it should be possible to use Randoop.如果您愿意对 Kotlin 代码进行 Java 测试,那么应该可以使用 Randoop。

If you want Randoop to generate Kotlin code, you would need to change the way that Randoop outputs its internal data structures into test file.如果您希望 Randoop 生成 Kotlin 代码,则需要更改 Randoop 将其内部数据结构输出到测试文件的方式。

The only automated Kotlin test generator that I know of is EvoMaster , which generates system-level tests (not unit tests) for RESTful APIs that provide a schema in OpenAPI/Swagger format.我所知道的唯一自动化 Kotlin 测试生成器是EvoMaster ,它为提供 OpenAPI/Swagger 格式模式的 RESTful API 生成系统级测试(不是单元测试)。 It detects 500 status codes and mismatches from the API schemas.它从 API 模式中检测到 500 个状态代码和不匹配。

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

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