Skip to main content
This content is now archived and is no longer updated. Progress is not calculated. Pega Cloud instances are disabled, and badges are no longer awarded.

Unit test a decision table or decision tree

Unit test a decision table or decision tree

Testing a decision table or decision tree on its own before testing it in the context of the entire application is called unit testing. Since decisions are evaluated automatically, they can have a significant impact on case processing. Ensuring that the decision logic is correct helps avoid troubleshooting the process if you get unexpected results. You can unit test decision rules by testing the logic, checking for conflicts in the logic, and checking for completeness.

Test for logic

You can test the logic of a decision rule by entering test values and running the rule to observe the results. If you do not see the expected results, make sure that the properties and comparison operators are correct.

To test for logic, on a decision rule form, select Actions > Run. The system displays a test page for entering test values. On the form, click Run Again after you enter each value as shown in the following example.

Decision table logic 1

After you have entered values for all the conditions and click Run Again, the form returns the corresponding result from the decision table or tree. The following logic test shows that the input values returned the correct result.

Decision Table Logic

Test for conflicts

Checking for conflicts shows you if your decision rule prevents one or more of its rows or branches from ever being used. For example, assume your decision table contains a row that tests for purchase requests that exceed USD300. The next row tests for purchase requests that exceed USD500. The second row may never be evaluated, because the upper row includes that condition.

To test for conflicts, on the decision form, click Show Conflicts. If a conflict exists, a warning is displayed on the row causing the conflict. In the following example, the condition Credit Score >1000 cannot be evaluated because it is a larger value than the 900 condition that is evaluated first.

Decision table 11

Test for completeness

To test for completeness, on the decision form, click Show completeness. The system adds rows to indicate values that will not be evaluated. The results are suggestions. You can add return results to additional rows if you think the decision rule needs a more detailed evaluation of the values.

Decision Table 13

This Topic is available in the following Module:

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice