Prev Next

Decision Table Validation

A Decision table is one of the most common and powerful DMN Expressions used to express decision logic.  However, modeling a Decision table can also be complicated, especially if multiple input clauses are used in combination for many Decision table rules. Enterprise Architect provides a feature to validate Decision tables; this topic explains how to apply this feature.

Access

DMN Expression Window

Simulate > Decision Analysis > DMN > DMN Expression : Validate button

DMN Simulation Window

Simulate > Decision Analysis > DMN > Open DMN Simulation > Configure : Validate button

Entries out of range detection

It is good practice to define 'allowed values' for the input clauses and output clauses of a Decision Table.  The 'allowed values' list is used to perform range checking of the input entry and output entry values for the table rules.

An example of validation being performed on a set of DMN Expressions using Sparx Systems Enterprise Architect.

In this example:

  • The 'Age' input clause defines a range of [20..120].  However, the input entry for rule 1 specifies a range of [18..21]; this is outside the range of allowed values, so rule 1 is reported as invalid.
  • The 'Marital Status' clause defines its allowed values as an enumeration of 'S, M'.  Rule 7 specifies a value of 'D', hence that rule is also reported as invalid.

These issues can be corrected, either by updating the 'allowed values' or by modifying the input entries for the invalid rules, depending on the actual business rules.

Completeness detection — report gaps in the rules

The gaps in rules for a Decision table mean that, given a combination of input values, no rule is matched.  This indicates that some logic or rule might be missing (unless a default output is defined).

When the Decision table contains many rules that specify number ranges, it becomes difficult to detect gaps by eye and quite time-consuming to compose and run exhaustive test cases.

For example,

An example of validation being performed on a set of DMN Expressions using Sparx Systems Enterprise Architect.

The validation reports a gap in the rules. Closer inspection reveals an error in rule 9. The input entry (580..600], should be [580..600].

Rule Overlaps detection for Unique Hit Policy

When rules overlap, for a given combination of input values, multiple rules are matched. This is a violation if the Decision table specifies its Hit Policy as 'Unique'.

When the Decision table contains many rules that specify number ranges, it becomes difficult to detect gaps by eye and quite time-consuming to compose and run exhaustive test cases.

For example:

An example of validation being performed on a set of DMN Expressions using Sparx Systems Enterprise Architect.

The validation reports an overlap in the rules, involving rules 4 & 5.  Closer inspection reveals the overlap exists in the third input 'Credit Score', where '<610' overlaps with '[600..625]'.  You could correct this issue either by changing rule 4 to '<600' or by changing rule 5 to '[610..625]', to reflect the actual business rules.

Learn more