[rules-users] Code Coverage

Wolfgang Laun wolfgang.laun at gmail.com
Mon Jan 23 10:47:01 EST 2012


It is highly recommended as "best practice" to have RHS code that
doesn't contain any branching instructions. Then, executing means full
coverage.

In case it is necessary to have more complex code I'd not put it into
a RHS anyway (where it isn't really OO any more) but I'd code it in
Java files and just call from the RHS.

For the LHS you can also argue that firing proves coverage; although
it won't be full *expression* logic coverage, due to potentially
skipped subexpressions in disjunctions.

-W


On 23/01/2012, mike <mikemps at gmail.com> wrote:
> Thank you very much Thomas ... yes, what i need is standard code coverage
> ... my company is all over that metric
>
> cheers
> Mike
>
> 2012/1/23 Swindells, Thomas <TSwindells at nds.com>
>
>>  It depends what you are asking for,****
>>
>> If you just want to know what proportion of rules you have written have
>> actually activated then that can be simply achieved by having a
>> AgendaEventListener and using it to ‘tick’ rules off when they have been
>> triggered – the blog entry should have you achieve this.****
>>
>> ** **
>>
>> If you actually want to integrate it with standard java code coverage
>> reports then this is a different question and is likely to be much harder,
>> if not impossible, ****
>>
>> ** **
>>
>> Thomas****
>>
>> ** **
>>
>> *From:* rules-users-bounces at lists.jboss.org [mailto:
>> rules-users-bounces at lists.jboss.org] *On Behalf Of *mike
>> *Sent:* 23 January 2012 14:34
>> *To:* Rules Users List
>>
>> *Subject:* Re: [rules-users] Code Coverage****
>>
>>  ** **
>>
>> Thank you very much ... as far as i know in order to do code coverage i
>> need to instrument the packages i'm interested in covering ... this
>> recommendation doesn't take me in that direction****
>>
>> ** **
>>
>> It is very useful however in showing a way to test rules individually.****
>>
>> ** **
>>
>> Thank you****
>>
>> Mike ****
>>
>> ** **
>>
>> 2012/1/17 Toni Rikkola <toni.rikkola at gmail.com>****
>>
>> You need to write the coverage tests for JUnit yourself. Test Scenarios in
>> Guvnor do this, but you can't use them outside Guvnor. ****
>>
>> ** **
>>
>> Test Scenarios get all the rule names for the rules in one package and
>> then compares that list to the rules that fired.****
>>
>> Edson's blog entry might help you
>> http://blog.athico.com/2011/10/cookbook-how-to-test-rules-using-xunit.html
>> .****
>>
>> ** **
>>
>> Toni****
>>
>> ** **
>>
>> On Jan 16, 2012, at 5:49 PM, mike wrote:****
>>
>> ** **
>>
>>  Hi there,****
>>
>> ** **
>>
>> I was wondering if its possible to measure code coverage on test running
>> against a set of rules.****
>>
>> ** **
>>
>> Thank you****
>>
>> Mike****
>>
>>  ****
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users****
>>
>>  ** **
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users****
>>
>> ** **
>>
>> ------------------------------
>>
>>
>> **************************************************************************************
>> This message is confidential and intended only for the addressee. If you
>> have received this message in error, please immediately notify the
>> postmaster at nds.com and delete it from your system as well as any copies.
>> The content of e-mails as well as traffic data may be monitored by NDS for
>> employment and security purposes. To protect the environment please do not
>> print this e-mail unless necessary.
>>
>> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18
>> 4EX, United Kingdom. A company registered in England and Wales. Registered
>> no. 3080780. VAT no. GB 603 8808 40-00
>>
>> **************************************************************************************
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>




More information about the rules-users mailing list