~/qa-guides/decision-table-testing
>_ Decision Table Testing: Examples and Test Cases
Turn business conditions into expected actions with three worked models, four decision tables, coverage calculations, and 15 test cases.
Short answer
Decision table testing derives tests from combinations of conditions and their required actions. Each rule identifies which facts hold, the result the system must return, and the effects that must occur or remain absent.
Use it when several business conditions jointly determine an outcome, such as a shipping fee, order acceptance, or export eligibility. Agree on the rules before comparing them with the implementation, and state whether coverage refers to a full or minimized table.
The three worked models below include four decision tables and 15 test cases. Their business policies are declared fixtures to adapt to your product.
How to read a decision table
In the tables below, conditions and actions are rows, and rules are columns. Read one rule from top to bottom: set up its conditions, perform the operation, and compare every required action with the result.
Use this legend:
- T: The condition is true.
- F: The condition is false.
- -: Either value is acceptable because it does not change that rule's required actions.
- X: The action must occur.
- Blank action cell: The action must not occur.
- N/A: The rule is infeasible under the stated model, so it has no business outcome to execute in this table.
The ISTQB Foundation Level syllabus, section 4.2.3, describes decision rules, feasible-column coverage, and notation for irrelevant or infeasible entries. This guide uses the legend above consistently, including an explicit N/A action marker for the infeasible rule in the third example.
A dash is not false, missing data, or a failed check. For a Boolean condition it represents both true and false within that rule. A blank action cell has a different meaning: the action is prohibited for that outcome.
For more general technique selection, see black-box versus white-box testing. Decision tables model required business behavior without depending on the source code's branch structure.
Decision tables versus pairwise testing
Pairwise testing covers pairs of values across parameters. A full decision table gives each feasible complete condition combination an expected action vector, so a particular triple omitted by a pairwise set can still be a required decision rule.
Use equivalence partitioning to choose representatives for conditions derived from larger input domains. Keep pair coverage and decision-rule coverage attached to their own inventories.
When decision table testing is useful
Build a table when requirements combine conditions with and, or, unless, only if, or otherwise, especially after a changed eligibility policy or an incident involving several simultaneous conditions.
The coupon and discount testing checklist covers the broader promotion workflow; a decision table can specify one eligibility decision within it. For behavior determined by retries, cancellation, or event order, use state transition testing.
How to create decision table test cases
1. Define the decision and its facts
Name the operation, evaluation point, and facts held constant during the attempt. Separate decisions with different timing, such as calculating a quote and later processing a refund.
Give each condition an evaluable meaning, including units, limits, normalization, and data source. Identify whether it comes from entered data, a trusted record, or a validator. A changing fact during execution introduces a concurrency question beyond a fixed snapshot table.
2. Enumerate and identify feasible columns
For n independent Boolean conditions, the unfiltered space has 2^n combinations. Other domains and dependencies need their own inventory. Assign stable rule identifiers before deriving fixtures.
Exclude a column only when an invariant makes its facts impossible. A feasible input that the business rejects remains a required rule. Record each exclusion's reason and keep blocked tests in the execution report rather than removing them from the model.
3. Specify actions and error priority
Record required feedback, saved records, quantities, and messages, including effects prohibited on rejection. Resolve whether simultaneous failures produce all applicable errors or one primary result.
Inspect overlaps before implementation testing. A member rule granting free shipping and a low-subtotal rule charging a fee conflict for a member below the minimum unless the contract resolves them. Column position alone does not establish priority.
4. Validate any minimization
Merge rules only when their entire action vectors are equivalent. Use a dash for conditions made irrelevant, then expand the patterns and compare their feasible combinations and actions with the original table.
The order example below demonstrates this audit, including why matching expansion totals are insufficient and how full and minimized coverage differ.
5. Prepare concrete, independent cases
Choose values and records that establish each selected rule at the test layer. System tests need real fixture facts; component tests may obtain them from controlled dependencies. Internal flags are not public request fields unless the interface defines them that way.
Reset independent attempts and inspect side effects through an authoritative read. State left by a previous order, reservation, or export must not satisfy a later case.
6. Keep execution evidence tied to the table
Record the table version, rule ID, applied facts, observed actions, and verdict. Declare the full or minimized inventory before testing, and revisit affected rules when conditions, priorities, or actions change.
Retain defect-specific inputs where several concrete values exercise the same rule. Their value comes from the fault they reproduce rather than from increasing the column count.
Worked example 1: A shipping fee decision
Assume a fictional store calculates shipping with these rules:
- A recognized member receives free shipping.
- A nonmember receives free shipping when merchandise subtotal is at least 100.00 USD.
- Otherwise the shipping fee is 5.00 USD.
- Merchandise subtotal is the supplied fixture amount before shipping, with no taxes, coupons, or other charges in this model.
- The quote returns shipping fee and quoted total. It does not create an order or reserve stock.
The two conditions are member recognized and minimum subtotal met. All four Boolean combinations are feasible.
Full shipping decision table
| Condition / action | S1 | S2 | S3 | S4 |
|---|---|---|---|---|
| Member recognized | F | F | T | T |
| Subtotal at least 100.00 | F | T | F | T |
| Set fee to 5.00 | X | |||
| Set fee to 0.00 | X | X | X |
Each rule requires exactly one fee action. A member with a low subtotal follows S3 and still receives free shipping. A high subtotal does not require membership under S2.
Cases 1-4 below use subtotal 50.00 for false and 150.00 for true, with the expected fee and total for each membership combination.
These four runs give 4 / 4 = 100% coverage of the feasible shipping columns. Repeating S1 with subtotal 60.00 still exercises S1; it does not add another logical rule.
The model does not claim complete coverage of monetary inputs. A separate boundary value analysis pass should include 99.99, 100.00, and 100.01 for an otherwise valid nonmember quote. Those values check how the condition is calculated, while the table checks its interaction with membership.
Worked example 2: Order submission with error priority
Assume one order-submission decision evaluates three prepared facts:
- Address passes: The address validator accepts the fixture.
- Stock available: The requested quantity is available.
- Payment authorized: A valid authorization exists for the fixture order.
All eight combinations are feasible in this model. Freeze those facts for the attempt. Other fields and permissions are valid, and each independent run begins with no order, no stock reservation, and no queued confirmation for that attempt.
The product contract chooses one primary result. Address failure takes priority over stock failure; stock failure takes priority over missing payment authorization. Only an attempt satisfying all three conditions creates an order, reserves its requested quantity, and queues one confirmation.
Rejected attempts create none of those three effects. The operation reads the prepared authorization state; payment capture, refund handling, and competing stock updates are outside this decision model.
Full order-submission decision table
| Condition / action | C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 |
|---|---|---|---|---|---|---|---|---|
| Address passes | F | F | F | F | T | T | T | T |
| Stock available | F | F | T | T | F | F | T | T |
| Payment authorized | F | T | F | T | F | T | F | T |
| Request address correction | X | X | X | X | ||||
| Report unavailable stock | X | X | ||||||
| Request payment authorization | X | |||||||
| Create order | X | |||||||
| Reserve requested quantity | X | |||||||
| Queue one confirmation | X |
The columns describe prepared combinations, not a requirement to call every validator on every rejected attempt. The primary-result policy can permit early rejection. Verify the specified feedback and effects without inventing an internal call-order requirement.
Minimized order-submission table
The first four full columns have identical actions and differ only in stock and authorization facts. Merge them into M1. Merge C5 and C6 into M2 because payment authorization is irrelevant when the valid-address attempt has unavailable stock.
| Condition / action | M1 | M2 | M3 | M4 |
|---|---|---|---|---|
| Address passes | F | T | T | T |
| Stock available | - | F | T | T |
| Payment authorized | - | - | F | T |
| Request address correction | X | |||
| Report unavailable stock | X | |||
| Request payment authorization | X | |||
| Create order | X | |||
| Reserve requested quantity | X | |||
| Queue one confirmation | X |
The expansion is explicit:
- M1: Represents C1-C4, four original combinations.
- M2: Represents C5-C6, two original combinations.
- M3: Represents C7, one original combination.
- M4: Represents C8, one original combination.
The check 4 + 2 + 1 + 1 = 8 is useful, but the total alone does not prove equivalence. Replacing one single-combination rule with a duplicate of another could preserve the total while leaving a gap. Expand the actual patterns and compare every action vector.
The ISTQB Test Analyst syllabus, decision table testing, discusses minimization, consistency, completeness, and the limits of checksum checks. It also distinguishes choosing concrete values for a dash from covering the feasible columns of the full table.
Calculate coverage against the chosen table
Select C1, C5, C7, and C8. They exercise M1, M2, M3, and M4, giving 4 / 4 = 100% coverage of the minimized table.
Against the original table, the same executions cover only C1, C5, C7, and C8: 4 / 8 = 50%. C2-C4 and C6 remain unexecuted. A minimized rule's expansion is a specification relationship, not evidence that its other concrete combinations ran.
The eight order cases later in this guide exercise C1-C8 separately. If all are properly set up and reach the decision, exercised full-table coverage is 8 / 8 = 100%. Their pass or fail verdicts remain separate from that percentage.
If C6 is blocked before submission, the exercised full-table coverage is 7 / 8 = 87.5%. Four minimized rules might still have been exercised, but that fact does not fill the missing original column. Report the precise gap rather than switching denominators after execution.
Keep verdicts separate: C8 can exercise its column and fail because two confirmations were queued. Check every required effect against the same execution identity.
Review a conflicting requirement before testing it
Suppose another stakeholder expects every applicable error, while the agreed table returns one primary result. C1 would expose that disagreement: the all-errors interpretation expects three messages, but the stated priority interpretation expects address correction alone.
Resolve the policy with the owner of the requirement and update the action rows consistently. Testing the current implementation repeatedly cannot decide which business contract is intended. Preserve the eventual rule and the example that exposed the ambiguity.
Worked example 3: A dataset with one infeasible combination
Assume an export decision uses the result of validating one immutable dataset. Every row must contain a nonnegative integer quantity. Invalid rows are counted only within that same dataset and validation result.
The conditions are dataset has rows and dataset has invalid rows. The product contract is:
- An empty dataset shows No rows and creates neither an export job nor an artifact.
- A nonempty dataset with no invalid rows creates one export job and one artifact containing all source rows in source order.
- A nonempty dataset with any invalid row shows its validation errors and creates neither an export job nor an artifact. Partial export is not supported in this example.
Dataset decision table
| Condition / action | D1 | D2: infeasible | D3 | D4 |
|---|---|---|---|---|
| Dataset has rows | F | F | T | T |
| Dataset has invalid rows | F | T | F | T |
| Show No rows | X | N/A | ||
| Create one export | N/A | X | ||
| Show row validation errors | N/A | X |
D2 would require an invalid row inside a dataset containing zero rows. That contradicts the stated subset invariant, so it is excluded from this model's feasible-rule denominator.
D4 is different: the dataset exists and contains bad input, so the rejection is a feasible, required outcome. Do not discard it merely because it is a negative case.
Prepare three concrete datasets:
- D1 fixture: Zero rows, with zero invalid rows.
- D3 fixture: A1 with quantity 1 and A2 with quantity 2; both valid.
- D4 fixture: A1 with quantity 1 and A2 with quantity -1; A2 is invalid.
One execution of each fixture covers 3 / 3 = 100% of the feasible columns. Dividing by four would incorrectly include the impossible D2 target. Testing only the empty and clean datasets gives 2 / 3 = 66.7%, rounded to one decimal place.
Derive both flags from the same frozen source. If a product accepts externally supplied aggregates, corrupt counts or a stale validation result may need additional tests under that interface's contract. They are outside this internally consistent snapshot model, not evidence that D2 should have a normal export outcome.
15 decision table test cases
Each case identifies a full-table rule and the expected effects. Reset the fixture before each independent execution. For the order model, prepare the address, inventory, and authorization facts at the layer under test rather than treating internal flags as arbitrary public request fields.
Test case 1: Charge a nonmember below the shipping minimum
- Rule: S1.
- Preconditions and input: Nonmember fixture; merchandise subtotal 50.00 USD; other quote inputs valid.
- Steps: Request a shipping quote and inspect fee, quoted total, and order/reservation state.
- Expected result: Fee is 5.00 and total is 55.00. The free-fee action does not occur, and no order or stock reservation is created.
Test case 2: Give a nonmember free shipping above the minimum
- Rule: S2.
- Preconditions and input: Nonmember fixture; subtotal 150.00 USD.
- Steps: Request a fresh quote and compare the returned fee and total with the source subtotal.
- Expected result: Fee is 0.00 and total is 150.00. No 5.00 charge is added and no order or reservation is created.
Test case 3: Give a member free shipping below the minimum
- Rule: S3.
- Preconditions and input: Recognized member fixture; subtotal 50.00 USD.
- Steps: Request the quote and inspect membership recognition, shipping fee, and total.
- Expected result: Fee is 0.00 and total is 50.00. The low subtotal does not override the member benefit under this contract. No order or reservation is created.
Test case 4: Apply free shipping once when both conditions qualify
- Rule: S4.
- Preconditions and input: Recognized member fixture; subtotal 150.00 USD.
- Steps: Request the quote and inspect the fee and total.
- Expected result: Fee is 0.00 and total is 150.00. Qualifying through both conditions does not create a negative fee or subtract an additional shipping benefit. Cases 1-4 cover all four shipping rules.
Test case 5: Prioritize address correction when all checks fail
- Rule: C1; address F, stock F, authorization F.
- Preconditions: Prepare an invalid address, insufficient stock, and no authorization. No prior order, reservation, or confirmation exists for the attempt.
- Steps: Submit once and inspect the primary response and all three side-effect records.
- Expected result: The primary result requests address correction. No order, stock reservation, or confirmation is created; stock and payment failures do not replace the declared primary result.
Test case 6: Keep an authorization from overriding address failure
- Rule: C2; address F, stock F, authorization T.
- Preconditions: Prepare invalid address and unavailable stock with a valid fixture authorization; clear attempt output.
- Steps: Submit once and inspect response, orders, reservations, and queued confirmations.
- Expected result: Address correction is the primary result. The existing authorization does not cause acceptance. All three output counts remain zero.
Test case 7: Prioritize invalid address despite available stock
- Rule: C3; address F, stock T, authorization F.
- Preconditions: Prepare the stated facts and reset attempt output.
- Steps: Submit and inspect feedback and inventory reservation state.
- Expected result: Address correction is the primary result. No order or confirmation is created, and available stock is not reserved by this rejected attempt.
Test case 8: Reject invalid address when the other checks pass
- Rule: C4; address F, stock T, authorization T.
- Preconditions: Prepare an invalid address with available stock and valid authorization; clear attempt output.
- Steps: Submit once and inspect the response and saved effects.
- Expected result: The request still requires address correction. No order, reservation, or confirmation is created even though stock and payment facts pass.
Test case 9: Prioritize stock failure over missing authorization
- Rule: C5; address T, stock F, authorization F.
- Preconditions: Prepare valid address, insufficient stock, and no authorization; reset output.
- Steps: Submit and inspect the primary response and side-effect records.
- Expected result: The primary result reports unavailable stock. Payment authorization is not the primary result, and no order, reservation, or confirmation is created.
Test case 10: Reject unavailable stock despite valid authorization
- Rule: C6; address T, stock F, authorization T.
- Preconditions: Prepare the stated facts and clear output.
- Steps: Submit once and inspect the response, order state, stock reservations, and confirmations.
- Expected result: Unavailable stock is the primary result. Existing authorization does not permit order creation or reservation; no confirmation is queued.
Test case 11: Request authorization after address and stock pass
- Rule: C7; address T, stock T, authorization F.
- Preconditions: Prepare valid address and available stock without authorization; reset output.
- Steps: Submit and inspect the response and resulting records.
- Expected result: The primary result requests payment authorization. No order, stock reservation, or confirmation is created under this model's policy.
Test case 12: Execute the complete accepted-order action vector
- Rule: C8; address T, stock T, authorization T.
- Preconditions: Prepare all three passing facts with requested quantity 2 and clear output.
- Steps: Submit once and inspect the returned order, reserved quantity, and queued confirmation.
- Expected result: Exactly one order is created, exactly 2 units are reserved for it, and exactly one confirmation is queued for that order. No address, stock, or authorization correction is returned as the primary result.
Test case 13: Handle an empty dataset without an export
- Rule: D1; has rows F, has invalid rows F.
- Preconditions and input: An immutable empty dataset, with its matching validation result; clear export output.
- Steps: Request export and inspect the visible result and artifact/job records.
- Expected result: The result shows No rows. No export artifact or export job is created, and no row-level validation errors are invented.
Test case 14: Export every row of a clean dataset
- Rule: D3; has rows T, has invalid rows F.
- Preconditions and input: A1 with quantity 1 and A2 with quantity 2; matching successful validation; clear output.
- Steps: Request export, inspect the export job and completed artifact, and compare its records with the source.
- Expected result: Exactly one export job produces one artifact containing A1 followed by A2 with unchanged quantities. The empty-result message and row validation errors are absent.
Test case 15: Reject a feasible dataset containing an invalid row
- Rule: D4; has rows T, has invalid rows T.
- Preconditions and input: A1 with quantity 1 and A2 with quantity -1; matching validation identifies A2; clear output.
- Steps: Request export and inspect validation feedback and artifact/job records.
- Expected result: A2 has a quantity validation error. No export artifact or export job is created, including a partial export containing only A1. This negative rule counts toward the three feasible dataset rules.
FAQ
A truth table lists logical input combinations and their logical results. A testing decision table relates conditions to required actions, which can include several visible or persisted effects. It can retain a full combination inventory or use minimized rules with explicitly irrelevant conditions.
Separate decisions with genuinely different responsibilities, derive meaningful condition classes, and consider justified minimization or a declared risk-based subset. Preserve the remaining full-rule gaps. If you choose pairwise selection, report its pair coverage rather than renaming it complete decision-table coverage.