JBoss.orgCommunity Documentation
Test Scenarios can be executed one at the time or as a group. The group execution contains all the Scenarios from one module. Test Scenarios are independent, one Scenario can not affect or modify the other.
After running all the Test Scenarios a report is shown. In a valid knowledge base all tests should pass and rule coverage should be 100%. Passing tests are marked with green, red shows failing tests and yellow notifies about missing rule coverage or missing expectations.
Package analysis uses Drools rules to statically analyse knowledge modules. It produces a report that contains information about the quality of the knowledge module.
Package analysis message types:
Notes - Needs attention, may be ignored.
Warnings- Possible problem, usually there is an alternative way.
Errors - Needs correction, logical falacy etc.
Range Validation - Making sure all the ranges for a field are covered. For example: Person's age is greater than 20 restriction exists. Check that the person's age is 20 or less than 20 is missing.
Missing Equality - When there are inequalities, but not equality being catered for. For example: LoanApplication has a field called approved. Approved field is checked to not equal to true ( LoanApplication.approved != true ), but a check where approved is equal to true is missing.
Redundancy - Rules or restrictions inside are rule are redundant. Redundancy in rule: Two rules fire with the same conditions and execute the same actions. Restriction redundancy example: Person has two restrictions for name, both are checking if the name is "Toni".
Subsumption - Rule subsumption: Both rules have the same actions. There exists one set of facts that can satisfy both of the rules and another set of facts that only satisfies the other rule. Restriction subsumption: Person fact has two restrictions, one checks that the age is greater than 20 and another checks that the age is greater than 50. Age greater than 50 restriction is subsumptant and can be removed.
Rule Incoherence - Nothing can meet the rule conditions. Example: Rule author has added two restrictions on one field that are incoherent. Person age is equal to 20 and age is equal to 30. The rule can never be satisfied.
Excessive Use of eval()- Eval should be avoided, eval is slow and doesn't make use of the RETE-network. If the rule consists mainly of eval statements then the user should be warned.
Rule Optimisation - The most strict restrictions should be declared first. Slower restrictions like eval last.
Rule Should Have an Action - If the rule does not have an action it does nothing.
Rules and Patterns That Always Pass - Pattern example: Persons age field has restrictions that check that the age is greater or equal to 20 and a restriction that checks that the age is less than 20. All the ranges for age are checked in one pattern.