Skip to content
Bugwise
Menu
Testing Fundamentals

Decision Tables

How to turn business rules with several conditions into a simple table, collapse it, derive test cases from it, and use it to find gaps and contradictions in requirements.

beginner Mobile & web
Short on time? Switch to the quick version.

A food delivery app launches two features in the same sprint: free delivery for members on orders of €30 or more, and a €1 surcharge on rainy days. Both are tested separately, both pass. On the first rainy Saturday, the support team is flooded: members with big orders are being charged €1 for “free” delivery. Is that a bug? Nobody knows, because nobody ever decided what happens when both rules apply at once.

That missing decision would have been obvious in five minutes with a decision table.

Part Not started

What is a decision table?

A decision tableDecision tableA table listing combinations of conditions and the action the software should take for each.Open in glossary → is a grid that lists every combination of conditions in a business rule, and the action the system should take for each one. Each column is one rule: “if these conditions are true, do this”.

Here’s the smallest possible example, a login screen with two conditions:

ConditionsR1R2R3R4
Email registered?YYNN
Password correct?YNYN
Actions
ResultLog inErrorErrorError
Two yes/no conditions give 2 × 2 = 4 rules. Each column becomes one test.

Decision tables are a black-boxBlack-box testingTesting based only on inputs and outputs, without looking at the code.Open in glossary → technique: you build them from the requirementsRequirementA statement of what the software must do or how well it must do it.Open in glossary →, not from the code. They sit alongside equivalence partitioning and boundary value analysis, which handle single inputs, while decision tables handle combinations.

When to use one

Use a decision table when the outcome depends on two or more conditions together: discounts, fees, eligibility, permissions, login and security rules. If you catch yourself reading “if… and… unless…”, draw a table.

When to use a decision table

Decision tables shine when several conditions combine to decide one outcome. Typical places in mobile and web apps:

They’re not the best tool when there’s only one input (use equivalence partitioning and boundaries), or when the outcome depends on the order of events, like an order moving from “placed” to “delivered” (use state transition testing).

Check this part

  1. When is a decision table the right tool?

  2. What does one column in a decision table describe?

A grid of every combination of conditions and the action for each, for rules where several conditions decide one outcome.

Part Not started

Building a decision table

  1. List the conditions. Things that can be true or false and change the outcome (member? order ≥ €30? rainy day?).
  2. List the actions. What the system does (charge a fee, show an error, log in).
  3. Write every combination. With n yes/no conditions you get 2ⁿ columns: 2 conditions → 4, 3 → 8, 4 → 16.
  4. Fill in the action for each column from the requirement. If you can’t, you’ve found a gap.
  5. Collapse. When two columns have the same action and differ in only one condition, that condition doesn’t matter there: merge them and write ”–” (don’t care).
  6. Turn each column into a test case.

For example, in the login table above the two columns with an unregistered email both end in “Error” and differ only in “Password correct?”, so they merge:

ConditionsR1R2R3
Email registered?YYN
Password correct?YN–
Actions
ResultLog inErrorError
Collapsed: 4 rules became 3. “–” means any value gives the same result.

Building one step by step: login with 2FA

The requirement for a banking app:

“Users log in with email and password. If the email or password is wrong, show Incorrect email or password. If both are correct and the user has two-factor authentication (2FA) turned on, ask for the 6-digit code. If 2FA is off, log the user straight in.”

Step 1: list the conditions

Read the requirement and underline everything that can be true or false and changes what happens:

  1. Is the email registered?
  2. Is the password correct?
  3. Is 2FA turned on for the account?

Things like “the phone is in dark mode” don’t change the outcome, so they’re not conditions here.

Step 2: list the actions

What can the system do? Show the error, ask for the 2FA code, or log the user in.

Step 3: count and write every combination

Each yes/no condition doubles the number of combinations, so 3 conditions give 2 × 2 × 2 = 2³ = 8 rules. A simple trick to write them all without missing any: in the first row, write half Y then half N (YYYY NNNN); in the second, alternate in pairs (YY NN YY NN); in the last, alternate one by one (Y N Y N…).

Step 4: fill in the actions

Go column by column and ask “according to the requirement, what happens here?”

ConditionsR1R2R3R4R5R6R7R8
Email registered?YYYYNNNN
Password correct?YYNNYYNN
2FA on?YNYNYNYN
Actions
Show error✓✓✓✓✓✓
Ask for 2FA code✓
Log in✓
The full table: 8 rules. Six of them end in the same error.

Step 5: collapse the table

Six columns end in “Show error”. Do we need six tests? Look at R3 and R4: same action, and they differ only in “2FA on?”. So 2FA doesn’t matter when the password is wrong: merge them into one column with ”–” (don’t care) for 2FA. Repeat until no two columns can be merged:

ConditionsR1R2R3R4
Email registered?YYYN
Password correct?YYN–
2FA on?YN––
Actions
Show error✓✓
Ask for 2FA code✓
Log in✓
Collapsed: 8 rules became 4. “–” means any value gives the same result.

The merge rule is simple: same actions, and exactly one condition different. Never merge columns with different actions; their difference is the whole point. If you end up with more columns than you expected, try merging in a different order.

Turning columns into test cases

Each column is one test case: the conditions become preconditionsPreconditionSomething that must already be true before you can start a test.Open in glossary → and test dataTest dataThe input values, accounts and records you use while testing.Open in glossary →, and the actions become the expected resultExpected resultWhat should happen when you perform a test step, according to the requirements.Open in glossary →. For ”–”, pick any value, ideally the riskier one. See how to write test cases for the full format.

TC-DT-01Correct credentials with 2FA on: the app asks for the code

Preconditions

  • Account anna@test.com exists with 2FA turned on

Steps

  1. Open the app
  2. Enter anna@test.com and the correct password
  3. Tap Log in

Expected result

The 6-digit code screen appears; the user is not logged in yet.

TC-DT-02Correct credentials with 2FA off: the user is logged straight in

Preconditions

  • Account ben@test.com exists with 2FA turned off

Steps

  1. Open the app
  2. Enter ben@test.com and the correct password
  3. Tap Log in

Expected result

The Home screen opens; no code is requested.

TC-DT-03Wrong password shows the generic error (2FA on)

Preconditions

  • Account anna@test.com exists with 2FA turned on

Steps

  1. Enter anna@test.com and a wrong password
  2. Tap Log in

Expected result

"Incorrect email or password" is shown; no code is requested; the user stays on the login screen.

TC-DT-04Unregistered email shows the same generic error

Steps

  1. Enter nobody@test.com and any password
  2. Tap Log in

Expected result

The exact same "Incorrect email or password" message is shown (it must not reveal that the email does not exist).

Tip: click a test case to expand it.

Notice TC-DT-03 picks “2FA on” for the don’t-care condition on purpose: it’s the riskier choice, because it catches the “asked for the code before checking the password” bug. TC-DT-04 links nicely to account enumerationAccount enumerationFinding out which emails are registered from differences in error messages or responses.Open in glossary →, covered in login and sign-up.

Another example: credit card approval

“Applicants under 18 are always rejected. Adults with a credit score of 650 or higher are approved instantly. Adults with a lower score go to manual review if they have a regular income, and are rejected if they don’t.”

After collapsing:

ConditionsR1R2R3R4
18 or older?YYYN
Score ≥ 650?YNN–
Regular income?–YN–
Actions
DecisionApproveReviewRejectReject
8 combinations collapse to 4 rules. The under-18 rule ignores everything else.

Real rules are often less tidy. If the bank later adds “scores from 600 to 649 get a lower credit limit”, the score is no longer yes/no: it has three ranges. You can still use a decision table, with a row whose values are ranges (< 600, 600–649, ≥ 650) instead of Y/N. This is sometimes called an extended-entry table. The number of columns is then the product of the number of values per condition (here 2 × 3 × 2 = 12).

Check this part

  1. A rule depends on four yes/no conditions. How many columns does the full decision table have?

  2. Two columns have the same action and differ only in "Rainy day?". What can you do?

List conditions and actions, write all 2ⁿ combinations, fill in the actions, collapse, and turn each column into a test.

Part ProNot started

Spotting missing and contradictory rules

Decision tables make missing rules (a combination that no rule covers) and contradictory rules (two rules that both apply but say different things: is a member’s free delivery still free when the rainy-day surcharge applies?) jump out. Finding those before coding is one of the cheapest bug fixes there is.

When you find a gap or a conflict, don’t decide yourself: raise it with the product owner (or whoever wrote the requirement).

Example: a delivery fee

Back to the rainy Saturday. The requirement:

“Delivery normally costs €3.99. Members get free delivery on orders of €30 or more, and pay €1.99 on smaller orders. On rainy days, a €1.00 surcharge is added to every order.”

ConditionsR1R2R3R4R5R6R7R8
Member?YYYYNNNN
Order ≥ €30?YYNNYYNN
Rainy day?YNYNYNYN
Actions
Delivery fee€1.00€0.00€2.99€1.99€4.99€3.99€4.99€3.99
R1 is the combination nobody discussed: is free delivery still free when it rains?

Two things stand out:

  • R1 needs a decision. Read literally (“every order”), a member’s free delivery costs €1 on rainy days. “Free delivery” and “a surcharge on every order” pull in different directions: that’s a conflict. Maybe the €1 is intended, maybe not. A tester’s job is to ask before release, not guess.
  • Only two pairs collapse. For non-members, the order size doesn’t matter (R5 = R7, R6 = R8), so 8 columns become 6. Rain matters in every rule, so it can never be ”–”. Not every table shrinks much, and that’s fine.

This is the hidden superpower of decision tables. Because you’re forced to fill in every column, two kinds of requirement bugs become impossible to miss:

ProblemWhat you noticeExample
Gap (missing rule)A column where no rule says what happens“Free cancellation before the restaurant accepts” and “€2 fee after accepting” — but what about after the courier picks up?
Conflict (contradiction)A column where two rules apply and disagree“Not enough money → Insufficient funds” and “Face ID fails → ask for PIN”: what if both are true?
Impossible combinationA column that can’t happen in realityCourier picked up, but restaurant never accepted

When you find a gap or conflict, don’t decide yourself. Raise it with the product owner (or whoever wrote the requirement), ideally while the user storyUser storyA short description of a feature from the user's point of view.Open in glossary → is still being refined. It’s a five-minute conversation now, versus an angry rainy Saturday later.

Check this part

  1. While building a table, you find a column that no rule in the requirement covers. What should you do?

  2. Two rules both apply to the same column but prescribe different actions. What is that called?

Filling in every column exposes missing rules and rules that contradict each other.

The rest of this lesson is in Bugwise Pro

The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.

Part ProNot started

Limits: when the table explodes

Every extra condition doubles the table. With 10 conditions you’d have 1,024 columns. Then teams use risk to pick the important ones, or pairwise testing, which covers every pair of values with far fewer tests.

The number of columns doubles with every yes/no condition:

ConditionsCombinations
38
532
101,024
20over 1 million

This is called combinatorial explosion. Ways to handle it:

  • Collapse with don’t-cares, as above.
  • Split the rule into smaller, independent tables (fees in one, eligibility in another).
  • Prioritize by risk: test the combinations that involve money, security or the most users first.
  • Pairwise testing: instead of every combination, choose a small set of tests in which every pair of condition values appears at least once (for 10 yes/no conditions, a handful of tests instead of 1,024).

Common mistakes

  • Mixing up conditions and actions. “Show an error” is something the system does, not a condition.
  • Missing a combination. Use the YYYY NNNN / YY NN / Y N pattern so you never skip one.
  • Merging columns with different actions. Only merge when the actions are identical.
  • Guessing to fill a gap. An empty column is a question for the team, not for your imagination.
  • Testing only one value for ”–”. Fine for low-risk rules; for payments and security, add the risky value too.

Check this part

  1. A rule has 12 yes/no conditions. Why might the team use pairwise testing instead of a full decision table?

  2. A rule has 10 yes/no conditions. Roughly how many columns does the full table have?

Every extra condition doubles the table, so teams collapse, split, prioritize by risk or use pairwise testing.

The rest of this lesson is in Bugwise Pro

The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.

Try it: build a decision table

Pick a requirement, find the conditions, fill in every rule, collapse the table, and watch the test cases appear.

🧮 Decision-table builder

Turn a business rule into a table, and the table into test cases, in four steps.

RequirementUsers log in with email and password. If the email or password is wrong, show “Incorrect email or password”. If both are correct and the user has two-factor authentication (2FA) turned on, ask for the 6-digit code. If 2FA is off, log the user straight in.

Step 1. Which of these are conditions (inputs that can be true or false and change the outcome)? Leave out actions (what the system does) and things that don’t matter.

0 conditions selected → 20 = 1 combination (columns).

Try it: find the gap

Decision tables don’t just produce tests. They expose holes in requirements. In each round, decide for every column whether the requirement covers it.

🔍 Find the gap

Each requirement is laid out as a full decision table. For every column, decide: is it covered by a rule, impossible, a gap (no rule says what happens) or a conflict (two rules disagree)?

Food delivery: canceling an order

  • R1. Customers can cancel for free while the restaurant hasn’t accepted the order.
  • R2. If the restaurant has accepted the order but the courier hasn’t picked it up yet, canceling costs a €2.00 fee.
  1. Column 1

    Restaurant accepted?
    Y
    Courier picked up?
    Y
  2. Column 2

    Restaurant accepted?
    Y
    Courier picked up?
    N
  3. Column 3

    Restaurant accepted?
    N
    Courier picked up?
    Y
  4. Column 4

    Restaurant accepted?
    N
    Courier picked up?
    N
Give every column a verdict to check.

Practice: free checked bag

Build a decision table for this airline app rule, collapse it, and write down the test cases. Then compare with the answer.

“Business class passengers always get a free checked bag. Economy passengers get one free if they are Gold members or if the flight is longer than 6 hours. Otherwise, a checked bag costs €35.”

Show the answer

Three conditions (Business class? Gold member? Flight over 6 hours?) give 2³ = 8 combinations. All four Business columns are free, so they collapse to one. For Economy, Gold members are free whatever the flight length.

ConditionsR1R2R3R4
Business class?YNNN
Gold member?–YNN
Flight > 6h?––YN
Actions
Checked bagFreeFreeFree€35

That’s 4 test cases. Good extra ideas: test a flight of exactly 6 hours (“longer than 6 hours” means 6:00 should cost €35, a boundary worth confirming), and ask the team whether a Gold member in Business gets a second free bag. The rule doesn’t say, so it’s a question, not an assumption.

Decision table checklist

0 of 8 checked

Key takeaways

  • Use a decision table when several conditions combine to decide an outcome: fees, discounts, eligibility, login and permission rules.
  • Build it in order: conditions → actions → all 2ⁿ combinations → fill in actions → collapse → test cases.
  • Merge two columns only when they have the same actions and differ in exactly one condition; that condition becomes ”–” (don’t care).
  • Every remaining column is one test case. For risky ”–” values, test the riskier option too.
  • An empty column is a gap, two disagreeing rules are a conflict: both are requirement bugs worth raising early.
  • Tables explode with many conditions; collapse, split, prioritize by risk, or use pairwise testing.

Finished this page?Nice work, this page is complete!

Mark it as done to track your progress. It's saved in this browser, no account needed.

Its cards are now in your Bites review ⚡
Esc

Type to search the whole site.