有什么方法可以评估Drools规则引擎中drl文件的测试覆盖率? [英] Is there any means by which I could evaluate the test-coverage of drl files in Drools rule engine?

查看:266
本文介绍了有什么方法可以评估Drools规则引擎中drl文件的测试覆盖率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为运行在drl文件(Drools规则引擎)中编写的规则的单元测试得出测试覆盖率。基本上,我想得出规则执行的百分比,该百分比已由围绕它们编写的单元测试实际覆盖。建议将非常有帮助。

I am trying to derive test-coverage for unit-tests running across rules written in drl files(Drools rule engine). Basically I want to derive the percentage of the rule execution which has been actually covered by the unit tests written around them. Suggestions would be really helpful. Thanks in advance.

推荐答案

经典覆盖率通常是通过使用我到这里探针来检测代码,然后执行测试,

Classic coverage is usually obtained by instrumenting the code with "I got here" probes, then executing tests, to see which probes got hit.

插入流口水文件听起来很有趣;您需要一个可以解析Drools文件并插入探针的工具。

Instrumenting drools files sounds intriguing; you need a tool that can parse the Drools files and insert probes. I doubt that you will find this off-the-shelf.

请参见此技术论文,任意语言的分支覆盖范围变得容易,说明了如何执行此操作。本文讨论了使用C / java作为示例,但它可能是Drools规则。

See this technical paper, Branch Coverage for Arbitrary Languages made Easy, for a description of how to do this in general. The paper talks about using C/java as examples, but it could be a Drools rule instead.

这篇关于有什么方法可以评估Drools规则引擎中drl文件的测试覆盖率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆