Decision Table Testing Fundamentals

Decision Table Testing Fundamentals

Decision tables are one of the oldest, most reliable test design techniques in existence — and one of the most underused. QA engineers reach for exploratory testing or equivalence partitioning and forget that for systems with complex conditional logic, a decision table gives you something those techniques can't: a guarantee that you've covered every meaningful combination of conditions.

This post covers what decision tables are, how to build them correctly, and how to extract a complete, non-redundant test suite from one. No fluff.

What Is a Decision Table?

A decision table is a structured representation of business logic. It maps every combination of input conditions to a corresponding set of actions (outputs). The table forces you to enumerate every case explicitly — including the ones your developers forgot to handle.

The structure has four sections:

  • Conditions (also called causes): the inputs or states that affect behavior
  • Actions (also called effects): the outputs or behaviors that result
  • Condition entries: the values each condition takes in a given rule
  • Action entries: whether each action fires for a given rule

Each column in the body of the table is one rule — a complete specification of what happens when a particular combination of conditions holds.

Limited Entry vs Extended Entry Tables

There are two styles of decision tables, and the choice affects readability and compactness.

Limited Entry Tables

In a limited entry table, conditions are phrased as yes/no questions, and condition entries are Y (yes), N (no), or — (don't care). Actions are similarly binary: X means the action fires, blank means it doesn't.

This is the most common style and the easiest to reason about mechanically.

Extended Entry Tables

In an extended entry table, conditions can take multiple values (not just yes/no). The condition entry itself contains the value. For example, a condition "Membership tier" might have entries: Gold, Silver, Bronze, None.

Extended entry tables are more compact but harder to check for completeness. For complex logic, start with limited entry tables and move to extended entry only when the binary form produces too many columns.

How to Construct a Decision Table

Follow these steps:

Step 1: Identify all conditions. List every input or state that independently affects the output. Be precise — "user is logged in" and "user has verified email" are two separate conditions if both affect the outcome.

Step 2: Calculate the maximum number of rules. For N binary conditions, you have 2^N possible combinations. This is the theoretical maximum — you'll often reduce it.

Step 3: Enumerate all combinations. Fill in the condition entries systematically. A standard approach: for condition 1, alternate Y and N every 2^(N-1) rows. For condition 2, alternate every 2^(N-2) rows, and so on.

Step 4: Determine the action for each rule. Work through your requirements or specification for each column. What does the system do when all those conditions hold simultaneously?

Step 5: Collapse redundant rules. Where two adjacent rules differ in only one condition and produce the same action, they can be merged with a "don't care" (—) for that condition.

Step 6: Derive test cases. Each rule becomes one (or more) test cases. Rules with "don't care" conditions need only one test case — pick any representative value for the don't-care conditions.

Worked Example: Discount Pricing Rule

Consider an e-commerce platform with the following discount logic:

  • Customers get a 20% discount if they are a Premium member AND the order total is over $100
  • Customers get a 10% discount if they are a Premium member OR the order total is over $100 (but not both)
  • No discount otherwise

Two conditions, so 2^2 = 4 rules maximum.

Rule 1 Rule 2 Rule 3 Rule 4
Conditions
Premium member Y Y N N
Order > $100 Y N Y N
Actions
Apply 20% discount X
Apply 10% discount X X
No discount X

This table is already complete. Four rules, three distinct actions. You derive exactly four test cases:

  1. Premium member, order $150 → expect 20% discount
  2. Premium member, order $50 → expect 10% discount
  3. Non-member, order $150 → expect 10% discount
  4. Non-member, order $50 → expect no discount

Notice what this does that freehand test case writing doesn't: it forces you to ask what happens in Rule 1. Without the table, a developer might implement "20% for Premium AND order > $100, else 10% for Premium OR order > $100" but accidentally apply both discounts when both conditions hold. The table makes it explicit that 20% and 10% are mutually exclusive.

A More Complex Example: Loan Pre-Qualification

Three conditions:

  • Credit score >= 700 (Y/N)
  • Income >= $50,000/year (Y/N)
  • Existing debt < 40% of income (Y/N)

2^3 = 8 rules.

R1 R2 R3 R4 R5 R6 R7 R8
Conditions
Credit score >= 700 Y Y Y Y N N N N
Income >= $50k Y Y N N Y Y N N
Debt < 40% income Y N Y N Y N Y N
Actions
Approve — standard rate X
Approve — higher rate X X X
Decline X X X X

After working through the requirements, you might find that R2 and R3 both result in "approve at higher rate" — meaning a good credit score alone can compensate for income, and vice versa. That insight comes from the table, not from reading a requirements doc.

Now collapse: R2 and R3 can't be merged (they differ in two conditions, not one). But check if any rules are identical in action — they're not here. Eight test cases, clearly specified.

Collapsing Rules (Don't-Care Conditions)

Suppose R5, R6, R7, R8 all result in "Decline" from the table above. That means whenever credit score < 700, the system declines regardless of income or debt. You can collapse R5–R8 into one rule:

R1 R2 R3 R4 (collapsed)
Credit score >= 700 Y Y Y N
Income >= $50k Y Y N
Debt < 40% income Y N Y
Actions
Approve — standard rate X
Approve — higher rate X X
Decline X

One test case covers the collapsed rule — pick any values for income and debt when credit is bad. This keeps your test suite lean.

Deriving Test Cases from the Table

Once your table is final, test case derivation is mechanical:

  1. Each rule = one test case (minimum)
  2. Choose concrete values for each condition: for Y, pick a value that satisfies the condition; for N, pick one that doesn't; for —, pick any representative value
  3. Document the expected action explicitly
  4. For higher confidence, consider adding boundary values at the edges of numeric conditions (that's where BVA comes in — but that's a different technique)

Decision tables pair naturally with data-driven test frameworks. The table itself is essentially a test data matrix. Each row of inputs plus expected output maps directly to a parameterized test.

What Decision Tables Catch That Ad-Hoc Testing Misses

Gaps in the specification. If you can't fill in an action for a rule, you've found a case the requirements don't cover. That's a requirement defect, found before a single line of code is written.

Contradictions. If two rules with identical conditions map to different actions, the spec is contradictory. Again, find it early.

Redundant rules. If you find two rules that are identical in conditions and actions, you've got dead logic in the spec — possibly dead code in the implementation.

Missed combinations. Freehand test writing almost always misses some combinations. Decision tables make omissions impossible to hide.

When to Use Decision Tables

Decision tables are the right tool when:

  • The system has multiple independent boolean conditions
  • The output varies based on combinations of those conditions
  • Requirements are expressed as business rules (eligibility, pricing, routing)
  • You need to demonstrate coverage to a regulator or auditor

They're less useful for:

  • Sequential processes (use flowcharts or state transition testing)
  • Single-condition logic (overkill — use equivalence partitioning)
  • Performance or load testing (different domain entirely)

The Bottom Line

A decision table is not just a test artifact — it's a requirements artifact. Building one forces precision. If you can't fill in every cell, your requirements are incomplete. If cells contradict, your requirements are wrong.

Build the table before implementation starts. Get it reviewed. Then derive your test cases. You'll cover the spec completely, and you'll have documented evidence that you did.

If you're testing a system with multiple interacting rules and find yourself writing test cases ad-hoc, stop. Draw the table first. Every test you write without one is a guess.

Read more

Start now free