Software Testing Decision Table Testing

Business rules often depend on several conditions at once. A bank approves a loan only when income, credit history, and age all meet certain limits. Testing each condition alone misses the interaction between them. Decision table testing lists every combination of conditions in a grid, so no combination slips through.

What Is a Decision Table

A decision table is a compact grid. Conditions sit in the top rows, actions sit in the bottom rows, and each column represents one rule. Every column becomes one test case.

  +-------------------+--------+--------+--------+--------+
  |                   | Rule 1 | Rule 2 | Rule 3 | Rule 4 |
  +-------------------+--------+--------+--------+--------+
  | CONDITIONS        |        |        |        |        |
  |  Condition A      |   Y    |   Y    |   N    |   N    |
  |  Condition B      |   Y    |   N    |   Y    |   N    |
  +-------------------+--------+--------+--------+--------+
  | ACTIONS           |        |        |        |        |
  |  Action X         |   X    |        |        |        |
  |  Action Y         |        |   X    |   X    |   X    |
  +-------------------+--------+--------+--------+--------+

When to Use It

  • The requirement contains many "if-and-or" rules
  • Different input combinations lead to different results
  • Analysts want to reveal missing or conflicting rules

Steps to Build a Decision Table

  1. List all conditions from the requirement.
  2. Calculate the number of rules. Two Yes/No conditions give four rules, and three give eight.
  3. Fill the grid with every combination of Yes and No.
  4. Write the expected action for each rule.
  5. Merge rules that produce the same action regardless of one condition.
  6. Convert each remaining column into a test case.

Worked Example: Free Delivery Offer

The Business Rule

An online store offers free delivery when the customer is a member or when the order total is above 50 dollars. Non-members with small orders pay a delivery fee.

The Decision Table

  Conditions          Rule 1   Rule 2   Rule 3   Rule 4
  Member?               Y        Y        N        N
  Total over 50?        Y        N        Y        N
  ------------------------------------------------------
  Free delivery         X        X        X
  Delivery fee                                      X

Resulting Test Cases

TestMemberOrder TotalExpected Result
TC1Yes80Free delivery
TC2Yes20Free delivery
TC3No80Free delivery
TC4No20Delivery fee

Collapsing Rules

Rules 1 and 2 give the same result whatever the order total is when the customer is a member. A tester can merge them into one rule marked with a dash for "does not matter". Merging reduces the number of test cases without losing coverage.

  Member?          Y     N     N
  Total over 50?   -     Y     N
  Free delivery    X     X
  Delivery fee                 X

Growth Warning

The number of rules doubles with each additional Yes/No condition. Ten conditions create 1,024 rules. Teams control the size by grouping related conditions, merging rules, and applying risk-based selection.

Advantages

  • Covers every logical combination in a structured way
  • Exposes gaps and contradictions in requirements
  • Gives business owners a readable summary of the rules
  • Produces test cases quickly

Limitations

  • The table grows large when many conditions exist
  • The technique ignores timing, order of actions, and data volumes
  • Conditions must be clear and independent

Practice Exercise

A streaming service gives a student discount when the user is a student and holds a valid student ID. A seasonal coupon adds an extra discount for annual plans. List the conditions, build the table, and write the test cases. Compare the number of rules before and after merging.

Decision tables give testers a clear map of business logic. Draw the table before writing cases, and confirm it with the analyst who owns the rules.