I&#39;d look into writing decision tables reflecting the rules. If you represent<br>them in spreadsheets according to Drools, you could generate the rules<br>from that. But the point is that it&#39;s much easier to extract the values for<br>
your test case data from a spreadsheet than from investigating rules in<br>their internal form or in the XML dump format.<br><br>-W<br><br><br><br><div class="gmail_quote">On 2 March 2011 10:38, Dmitri Pissarenko <span dir="ltr">&lt;<a href="mailto:dmitri.pissarenko@gmail.com" target="_blank">dmitri.pissarenko@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello!<br>
<br>
I am testing a rather complex system, which behaves according to some<br>
business rules (written as semi-formal text).<br>
<br>
The goal is to create test cases, which cover as many states of the<br>
system as possible. I want to automate this task in the following way:<br>
<br>
1) Formalize the business rules in Drools<br>
<br>
2) Then use some mechanism to create a list of all possible situations<br>
(which need to be tested)<br>
<br>
For example, I have following business rule package with two rules<br>
(this is only an example, real business rules are much more complex):<br>
<br>
global List outErrorCodes;<br>
global Boolean condition1;<br>
global Boolean condition2;<br>
global Boolean condition3;<br>
<br>
rule &quot;01&quot;<br>
    when<br>
        eval( condition3 == false);<br>
    then<br>
        outErrorCodes.add(&quot;ERROR_CODE1&quot;);<br>
end<br>
<br>
rule &quot;02&quot;<br>
    when<br>
        eval((condition1 == true) &amp;&amp; (condition2 == true));<br>
    then<br>
        outErrorCodes.add(&quot;ERROR_CODE2&quot;);<br>
end<br>
<br>
condition1, condition2 and condition3 are inputs. outErrorCode is the output.<br>
<br>
That is, condition1, condition2 and condition3 describe a certain<br>
situation, and outErrorCode describes the expected behaviour of the<br>
system in that particular situation.<br>
<br>
I want to create a mechanism, which automatically creates a list of<br>
all possible tuples (condition1, condition2, condition3,<br>
outErrorCodes), based on the logic in the rules. Each tuple represents<br>
a state of the system.<br>
<br>
These tuples will then be used as a basis for creating actual test cases.<br>
<br>
Is it possible with Drools? If so - how?<br>
<br>
Many thanks in advance<br>
<br>
Dmitri<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>