How-to guide

How to build a decision table for a business rule

How do you test a rule with several interacting conditions?

Write the conditions and observable actions in a decision table. Give each feasible combination an expected action, mark impossible combinations with a reason, then derive a test from each distinct rule the team needs to protect.

Make conflicting answers visible

Decision tables suit questions such as eligibility or routing, where the result depends on several facts at once.

  1. List the conditions and allowed values. Ask the rule owner whether any condition takes priority.
  2. Fill in the expected action for each feasible combination. If one condition makes another irrelevant, record why the rows can be combined.
  3. Choose concrete data for each retained rule. Mark every unanswered combination as a decision for the owner before treating it as testable.

Worked example

Who can collect an order today?

A shop offers collection today if the item is in stock and the desk is open. In stock plus open offers collection. In stock plus closed offers the next opening. Out of stock offers a stock alert regardless of desk hours. This gives three distinct outcomes across four input combinations and explains why one pair can share a rule.

Try it on your pull request

Choose a change in your repository and tell Cue April what should happen. Review the proposed checks before they run.

Try Cue April on your repository