skip to main content
Corticon Studio: Rule Modeling Guide : Logical analysis and optimization : Testing rule scenarios in the Ruletest Expected panel
 

Try Corticon Now

Testing rule scenarios in the Ruletest Expected panel

Using Ruletests you can submit request data as input to Rulesheets or Ruleflows to see how the rules are evaluated and the resulting output. You can make Ruletests even more powerful by specifying the results you expected, and then seeing how it reconciles with the output. Running the test against a specified Rulesheet or Ruleflow automatically compares the actual Output data to your Expected data, and color codes the differences for easy review and analysis.
You can establish the expected data either by copying the output column or creating its data directly from the Vocabulary.
To create expected data from test output:
1. Create or import a request into a Ruletest, and run the test against an appropriate Rulesheet or Ruleflow.
2. Choose the menu command Ruletest > Testsheet > Data > Output > Copy to Expected, or click button in the Corticon Studio toolbar.
To create expected data directly from the Vocabulary:
1. Drag and drop nodes from the Rule Vocabulary window to create a tree structure in the Expected panel that is identical to the input tree.
2. Enter expected values for the Input attributes as well as the attributes that will be added in the Output panel.
When expected values are Strings, they might have leading or trailing blanks (often called whitespace) that can cause imprecise matching to the output from rules. While the default behavior of trimming whitespace is typically preferred, you can set a Studio property that does not perform trimming, and thus reduce these validation mismatches. The default behavior is apparent when copying output to the Expected column, as that action strips whitespaces, and often reveals such mismatches immediately.
To retain leading and trailing whitespaces when output is added to the Expected column, add the line:
com.corticon.tester.trimstringvalues=false
to Studio's brms.properties file (located at [CORTICON_WORK_DIR]\Studio), and then restart Studio.
* Navigating in Ruletest Expected comparison results
* Reviewing test results when using the Expected panel
* Techniques that refine rule testing