派突变测试失败:org.pitest.munttest.engine.gregor.mutators.emptyObjectReturnvalsMutator
在进行突变测试时,有幸存的情况。原因是org.pitest.munttest.engine.gregor.mutators.mutator.emptyobjectreturnvalsmutator
确切的错误消息是:替换为collections.take/javafile for Package/javafile :: method→幸存下来
我添加了很少的测试案例,但仍然失败了,但仍然失败了。
While running mutation test , there are survived cases . The reason is org.pitest.mutationtest.engine.gregor.mutators.EmptyObjectReturnValsMutator
The exact error message is : replaced return value with Collections.emptyList for package/JavaFile::Method → SURVIVED
I added few test cases to pass the emptyList but still failed.Can anyone please help here about this and what's the test case need to be added?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于返回设置的方法,有一个典型的情况。
例子:
私有设置execute(){
}
此集合始终具有值(或)为空集。
对此方法的调用“返回execute()”显示了用Collections替换的返回值的问题。
逻辑更改为“返回可选”(execute()),
这解决了问题。
There is a typical case for a method which returns Set.
Example:
private Set execute() {
}
This set is always with value (or) empty set.
The call to this method 'return execute()' showed the issue of replaced return value with Collections.emptyList for package/JavaFile::Method → SURVIVED.
The logic is changed like 'return Optional.of(execute())'
This solved the issue.