Build Decision Table Tests
Purpose
Make every combination of rule conditions explicit so that each distinct outcome is tested once, and so that gaps and conflicts in the rules are found before they become production defects.
When to use
- An outcome depends on two or more conditions (customer type, amount, channel, region, flags).
- Rules are written as prose paragraphs, and people disagree on edge combinations.
- Pricing, eligibility, approval routing or fee logic changes.
When not to use
- A single input with ranges drives the outcome. Use
equivalence-boundary-analysis.
- Behavior depends on prior events or status. Use
state-transition-testing.
- Many parameters are independent and just need combination coverage. Use
pairwise-testing.
Inputs
Required:
- The business rules (text, spec excerpt, existing rule catalog).
Optional, improves quality:
- Priority/precedence of rules, rounding rules, examples from business.
- Existing implementation behavior for comparison.
If rules are missing, ask for them. Where the rule text does not determine an outcome, mark the cell [UNKNOWN] and raise a question.
Process
- Extract conditions and make each one boolean or a small set of partitions (e.g. Amount: <200, >=200). Take partitions from boundary analysis where ranges exist.
- Extract actions/outcomes (fee amount, approval level, message, flag set).
- Compute the full combination count; if it is under ~32, enumerate all; otherwise group conditions or apply the limited-entry approach per sub-table.
- Fill each column (rule) with the expected actions from the rule text; mark cells without a stated outcome
[UNKNOWN].
- Identify impossible combinations (e.g. non-member AND member discount) and mark them, with reason.
- Collapse columns whose outcome does not depend on a condition, using "-" (don't care), and verify the collapse does not hide a difference.
- Detect anomalies: missing rules (combinations with no outcome), conflicts (two rules giving different outcomes), redundant rules.
- Derive one test case per remaining column, with concrete data that satisfies exactly that column; add boundary values for range-based conditions.
- Prioritize columns by business impact and frequency.
- Output the table, the tests and a list of rule gaps for the product owner.
- Label every inferred rule or outcome
[ASSUMPTION]; if the user continues, suggest test-case-writing to turn rules into cases or pairwise-testing when conditions explode.
Output format
# Decision Table: <rule set>
| | R1 | R2 | R3 | ... |
|---|---|---|---|---|
| C1: <condition> | Y | Y | N | |
| C2: <condition> | Y | N | - | |
| A1: <action> | X | | X | |
| A2: <action / value> | | 29 TL | | |
Impossible combinations: <list and reason>
## Rule Gaps and Conflicts
| Columns | Issue | Question |
## Derived Tests
| Test | Rule column | Data | Expected |
Quality checklist
Common pitfalls
- Collapsing columns too early and missing an interaction (e.g. express + island + member).
- Encoding ranges as boolean without boundary tests at the thresholds.
- Resolving ambiguous rules yourself. Present the options and ask the rule owner.
Example
Input: "Free shipping for members over 200 TL, standard 29 TL, express +40 TL, islands +50 TL, members get express at half price."
Excerpt of output:
| C1 Member | Y | Y | N | N |
| C2 Basket >= 200 | Y | Y | Y | N |
| C3 Express | N | Y | Y | N |
| A Fee | 0 | 20 | 69 | 29 |
- Gap: Does the island surcharge apply to free-shipping orders?
[UNKNOWN]
- Question: Is "express at half price" 20 TL on top of free shipping, or half of 69 TL?
1---2name: decision-table-testing3description: "Builds decision tables from business rules by listing conditions and actions, enumerating combinations, collapsing irrelevant ones and deriving one test per rule column, while exposing missing and contradictory rules. Use when behavior depends on combinations of conditions (eligibility, pricing, approvals, discounts, routing), or when someone asks to test a set of if-then rules."4license: MIT5metadata:6 source: https://skillmd.com/skills/muratdincer/decision-table-testing7 version: "1.0.0"8 language: en9 category: 06-quality10 role: qa-analyst11 area: design12 title: "Build decision table tests"13 related: "equivalence-boundary-analysis, business-rules-catalog, test-case-writing, pairwise-testing, state-transition-testing"14 prompt: "Build a decision table for shipping fees: free for members over 200 TL, 29 TL standard, express +40 TL, islands add 50 TL, members get express at half price."15---1617# Build Decision Table Tests1819## Purpose20Make every combination of rule conditions explicit so that each distinct outcome is tested once, and so that gaps and conflicts in the rules are found before they become production defects.2122## When to use23- An outcome depends on two or more conditions (customer type, amount, channel, region, flags).24- Rules are written as prose paragraphs, and people disagree on edge combinations.25- Pricing, eligibility, approval routing or fee logic changes.2627## When not to use28- A single input with ranges drives the outcome. Use `equivalence-boundary-analysis`.29- Behavior depends on prior events or status. Use `state-transition-testing`.30- Many parameters are independent and just need combination coverage. Use `pairwise-testing`.3132## Inputs33Required:34- The business rules (text, spec excerpt, existing rule catalog).3536Optional, improves quality:37- Priority/precedence of rules, rounding rules, examples from business.38- Existing implementation behavior for comparison.3940If rules are missing, ask for them. Where the rule text does not determine an outcome, mark the cell `[UNKNOWN]` and raise a question.4142## Process431. Extract conditions and make each one boolean or a small set of partitions (e.g. Amount: <200, >=200). Take partitions from boundary analysis where ranges exist.442. Extract actions/outcomes (fee amount, approval level, message, flag set).453. Compute the full combination count; if it is under ~32, enumerate all; otherwise group conditions or apply the limited-entry approach per sub-table.464. Fill each column (rule) with the expected actions from the rule text; mark cells without a stated outcome `[UNKNOWN]`.475. Identify impossible combinations (e.g. non-member AND member discount) and mark them, with reason.486. Collapse columns whose outcome does not depend on a condition, using "-" (don't care), and verify the collapse does not hide a difference.497. Detect anomalies: missing rules (combinations with no outcome), conflicts (two rules giving different outcomes), redundant rules.508. Derive one test case per remaining column, with concrete data that satisfies exactly that column; add boundary values for range-based conditions.519. Prioritize columns by business impact and frequency.5210. Output the table, the tests and a list of rule gaps for the product owner.5311. Label every inferred rule or outcome `[ASSUMPTION]`; if the user continues, suggest `test-case-writing` to turn rules into cases or `pairwise-testing` when conditions explode.5455## Output format56```markdown57# Decision Table: <rule set>58| | R1 | R2 | R3 | ... |59|---|---|---|---|---|60| C1: <condition> | Y | Y | N | |61| C2: <condition> | Y | N | - | |62| A1: <action> | X | | X | |63| A2: <action / value> | | 29 TL | | |6465Impossible combinations: <list and reason>66## Rule Gaps and Conflicts67| Columns | Issue | Question |68## Derived Tests69| Test | Rule column | Data | Expected |70```7172## Quality checklist73- [ ] Every condition combination is either tested, marked impossible, or collapsed with "-" justified.74- [ ] Each column has exactly one expected outcome or is flagged `[UNKNOWN]`.75- [ ] Conflicts and gaps are listed as questions, not silently resolved.76- [ ] Test data satisfies the column precisely, including boundary values for ranges.77- [ ] Rule precedence (which rule wins) is stated or questioned.78- [ ] All checks pass; if any fails, revise the output and re-run this checklist before answering.7980## Common pitfalls81- Collapsing columns too early and missing an interaction (e.g. express + island + member).82- Encoding ranges as boolean without boundary tests at the thresholds.83- Resolving ambiguous rules yourself. Present the options and ask the rule owner.8485## Example86Input: "Free shipping for members over 200 TL, standard 29 TL, express +40 TL, islands +50 TL, members get express at half price."8788Excerpt of output:89| C1 Member | Y | Y | N | N |90| C2 Basket >= 200 | Y | Y | Y | N |91| C3 Express | N | Y | Y | N |92| A Fee | 0 | 20 | 69 | 29 |93- Gap: Does the island surcharge apply to free-shipping orders? `[UNKNOWN]`94- Question: Is "express at half price" 20 TL on top of free shipping, or half of 69 TL?