Task 2: Ensuring completeness

You learn about verifying decision logic completeness through default rules and automated missing rule generation.

A decision logic must determine a value for its decision node in every possible case. When expressed as rules, ensuring complete coverage is challenging because each rule applies to specific cases only. A complete decision logic requires at least one applicable rule for every scenario.

Two approaches can make an incomplete rule set complete:
  • Defining a default value that is applied when no rules match.
  • Generating missing rules through logical analysis.

Default values

In Decision Designer, default values are specified by using default rules. Default rules have no conditions and are applied when no business rules or decision tables are applicable. Their action sets the value of the decision node to a predefined fallback value.

A decision logic can have only one default rule.

Take the following decision table:

Figure 1. Decision table with a missing case
Decision table with a missing case

The following default rule specifies APS-C as the fallback value:

set decision to APS-C ;

While default rules satisfy the completeness requirement, they have a significant drawback: all uncovered cases receive the same decision value. It prevents differentiation between distinct missing cases.

For example, if you remove the fifth row (portrait photography with low budget) from the previous decision table, it creates two families of missing cases:

  • Beginners in sports or portrait photography with high budgets
  • Photographers in portrait photography with low budgets

If APS-C suits the first case but Micro Four Thirds is needed for the second, a single default value is insufficient. The decision logic requires refinement through missing rules.

Missing rules

Finding missing rules manually is difficult, even for small rule sets. Decision Designer provides automated computation through logical rule analysis.

To conduct the completeness analysis and generate missing rules for a decision node, click Analyze the decision logic Analyze the decision logic icon in the Logic tab.

Note: The completeness analyzer evaluates the entire decision logic (all rules and decision tables). Generated missing rules are not associated with specific decision tables and appear as stand-alone rules.

For the decision table with two missing cases, three missing rules are generated:

Invalid budget range
if
    budget is less than 0
then
    -- This is a generated rule. Choose a meaningful value for the decision variable.
    set decision to APS-C ;

This rule can be ignored as budgets cannot be negative.

Portrait photography with low budget
if
    subject is not sports
    and subject is not landscape
    and budget is less than 500
then
    -- This is a generated rule. Choose a meaningful value for the decision variable.
    set decision to APS-C ;

This rule describes the second case that is listed before. While the generated rule contains a meaningful condition, its action is a placeholder. Decision Designer automatically inserts the default value for the type of the decision node. In this case, it is APS-C. A comment prompts the rule author to replace this placeholder with an appropriate value.

As discussed before, Micro Four Thirds should be used for this missing rule. APS-C can be replaced with Micro Four Thirds. Then, the comment can be removed and the rule can be approved to be added to the decision logic.

High budget nonlandscape cases
if
    subject is not landscape 
    and level is not professional 
    and budget is at least 1500
then
    -- This is a generated rule. Choose a meaningful value for the decision variable.
    set decision to APS-C ;

This rule describes a case that the default rule can cover. Approving it is optional.

There is a benefit to using business rules rather than default rules. Business rules provide explicit conditions, while default rules have implicit conditions, namely that no other rules applied. Explicit conditions improve decision explanations by clearly showing which conditions triggered the rule. For transparent decision-making, prefer approving missing rules even when the default produces the same result.

Exercise 1: Defining a default value

  1. Import the Step4 solution for Decision Modeling practice tutorial sample from the New decision service wizard. For more information about importing samples, see Building decision services.
  2. Open the Step 4 - Exercise 2 decision model.
  3. Create a new decision table named DT with overlaps in the sensor format node.
  4. Populate the table with values from the Decision table with a missing case (Fig. 1) available above.
  5. Go to the Run tab.
  6. Create a test data set with the following values:
    • level: beginner
    • subject: portrait
    • budget: 3000
  7. Click Run. Is a sensor format proposed?
  8. Return to the Logic tab.
  9. Click Create rule artifact Create rule artifact icon and select Default rule.
  10. Enter the following rule:
    set decision to APS-C
  11. Return to the Run tab and run the test data set again. Is the same sensor format returned?
  12. Expand the sensor format section in the run history. Which rule determined the value?

Exercise 2: Generating missing rules

  1. Create a new decision table named DT with two missing cases in the sensor format node.
  2. Populate the table with values from the Decision table with a missing case (Fig. 1) available above, except row 5.
  3. Go to the Run tab.
  4. Create a test data set with the following values:
    • level: professional
    • subject: portrait
    • budget: 400
  5. Click Run and note the proposed sensor format.
  6. Return to the Logic view and click Analyze the decision logicAnalyze the decision logic icon to generate missing rules.
  7. Modify the second missing rule by replacing APS-C with Micro Four Thirds. Then, approve the rule.
  8. Return to the Run tab and run the test data set again. Is the same sensor format returned?
  9. Expand the sensor format section in the run history. Which rule determined the value?

Lessons learned

A decision logic based on an overlap-free rule set with a default value has the following characteristics:

  • Each rule independently makes decisions for all applicable cases.
  • At most, one rule applies in any given case.
  • The default value handles cases where no rules apply.

Missing rules can be generated when a single default value cannot adequately cover all missing cases.

Limitations

Some decision-making problems involve infeasible cases where no decision is possible. In these scenarios, default values can incorrectly provide decisions for invalid cases. Also, generating missing rules may not be meaningful as no valid decision can be determined for infeasible cases.

The next task extends decision logic requirements to accommodate intentional incompleteness.