A Ruletest simulates a business scenario.



The Ruletest input data is evaluated by the rules.



If the data satisfies all the conditions in a rule, the rule fires and some output containing the results of the rule execution is produced.

You can define different sets of input data to test how the rules behave in different scenarios. You can also use a Ruletest to compare the output of a rule execution with expected results.

A Ruletest stores this information in a Ruletest file, enabling you to save use-cases that are of interest, change rules, and run the test again to see how the modified rules behave when applied to the same use-cases.

The images show an example of a Rulesheet (AircraftRules.ers) with two rules and a Ruletest (TestingAircraftRules.ert) that has been executed.

The Rulesheet contains rules that define a value for Aircraft.maxCargoWeight based on the value of Aircraft.aircraftType received in input data.

The Ruletest tests the Rulesheet. The Ruletest editor has four parts:

  • Test Subject—Specifies which Rulesheet or Ruleflow is being tested (in this case AircraftRules.ers).
  • Input—Where you define input data to be processed by the rules in the Rulesheet. This example has two instances of the Aircraft entity with different values for Aircraft.aircraftType.
  • Output—Where Corticon Studio displays the result of a Ruletest execution. A value for Aircraft.maxCargoWeight has been assigned based on the rules in the AircraftRules.ers Rulesheet.
  • Expected—where you can optionally define your expected result.