Decision Table Testing
What is Decision Table Testing?
Decision table testing is a black box technique used to test systems with complex business rules, where the outcome depends on combinations of multiple conditions.
How It Works
A decision table lists all possible combinations of input conditions and maps each combination to its expected action or outcome. Each column in the table represents a unique rule, and test cases are derived from each rule.
When to Use Decision Tables
- When the software's behaviour depends on multiple, combined conditions (e.g., discount rules based on customer type and order value).
- When business rules are complex enough that combining conditions informally risks missing test scenarios.
Benefit
Decision tables ensure that all meaningful combinations of conditions are systematically identified and tested, rather than relying on ad-hoc scenario selection.
Building a Decision Table Step by Step
Take a delivery rule from an online shop: "Delivery is free for members, or when the cart total reaches the free-delivery limit. Choosing express delivery always adds an express charge, even for members."
- List the conditions. C1: Is the customer a member? C2: Is the cart total at or above the limit? C3: Is express delivery chosen?
- List the actions. A1: Charge the delivery fee. A2: Add the express charge.
- Work out the number of rules. With three yes/no conditions there are 2 × 2 × 2 = 8 combinations.
- Fill each column by reading the business rule for that combination.
| R1 | R2 | R3 | R4 | R5 | R6 | R7 | R8 | |
|---|---|---|---|---|---|---|---|---|
| C1 Member | Y | Y | Y | Y | N | N | N | N |
| C2 Cart at or above limit | Y | Y | N | N | Y | Y | N | N |
| C3 Express chosen | Y | N | Y | N | Y | N | Y | N |
| A1 Delivery fee | No | No | No | No | No | No | Yes | Yes |
| A2 Express charge | Yes | No | Yes | No | Yes | No | Yes | No |
Each column becomes one test case. For example, R7 says a non-member with a small cart who picks express pays both the delivery fee and the express charge. This rule is easy to forget when writing tests from memory.
Shrinking the Table With "Don't Care" Entries
Look at R1 and R3. Their actions are identical, and the only difference is C2. For members, the cart total does not affect the result, so the two rules can merge into one column with a dash (meaning "any value") for C2. R2 and R4 merge the same way. The collapsed table has six rules instead of eight.
Collapsing saves effort on large tables, but be careful: only merge columns whose actions are exactly the same. If the system is risky, such as payments, many teams still test the full set.
Combining With Boundary Value Analysis
A decision table tells you which combinations to test, but not the exact numbers. Condition C2 compares the cart with a limit, so pick values right at the limit, just below it and just above it. That way R5 and R7 are tested at the point where the rule switches, which is where off-by-one bugs usually hide, such as using "greater than" instead of "greater than or equal to".
Pitfalls and a Working Checklist
- Too many conditions in one table. Ten yes/no conditions give over a thousand rules. Split the logic into smaller tables, one per business decision.
- Impossible combinations. Some columns cannot happen in real life, such as "guest user" and "member discount applied". Mark them as infeasible rather than silently deleting them, so reviewers can see they were considered.
- Vague actions. "Show correct price" is not testable. Write the exact expected result.
- Not reviewing with the business. A table is also a great way to find gaps in the requirement itself. Share it with the product owner before writing tests.
Checklist
- Extract conditions and actions from the requirement.
- Generate every combination and fill in the actions.
- Merge identical columns and mark infeasible ones.
- Add boundary values for numeric conditions.
- Write one test case per remaining rule.
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.