Purpose
Express complex business logic as decision tables or decision trees. Use this when multiple interacting conditions determine system behavior, and prose requirements would be ambiguous or incomplete.
Decision tables guarantee completeness. If you have N binary conditions, the table has 2^N columns. Every column gets a defined action. No gaps, no ambiguity.
Key Concepts
Decision Table Structure
| 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 | X | ||
| Action Y | X | X |
- Conditions (upper half): Input conditions that can be true or false
- Actions (lower half): System behaviors triggered by condition combinations
- Rules (columns): Each unique combination of conditions and its resulting actions
- X marks which actions execute for each rule
Decision Table Types
Limited-entry: Conditions are binary (Y/N). Full coverage = 2^N rules.
Extended-entry: Conditions have multiple values (e.g., "Order total: <$50 / $50-$100 / >$100"). More compact but harder to verify completeness.
Decision Tree (Alternative Representation)
A decision tree shows the same logic as a branching diagram:
Order total? ├── < $50 │ └── Shipping: Standard ($5) ├── $50 - $100 │ ├── Member? │ │ ├── Yes -> Shipping: Free │ │ └── No -> Shipping: Reduced ($3) └── > $100 └── Shipping: Free
When to use which:
- Decision table -- When completeness checking is critical (regulated, safety). Tables make gaps visible.
- Decision tree -- When the logic is hierarchical and some conditions only matter in certain branches. Trees are more readable for stakeholders.
Completeness Check
For a limited-entry decision table with N conditions:
- Expected number of rules = 2^N
- If you have fewer rules, either:
- Some combinations are consolidated (marked with "--" meaning "don't care")
- Some combinations are missing (a bug)
Anti-Patterns
- The Missing Column -- Not accounting for all condition combinations. This is the exact bug decision tables prevent.
- Ambiguous Conditions -- "Large order" instead of "Order total > $100." Conditions must be precise and binary.
- Redundant Rules -- Two columns with identical conditions but different actions. This is a contradiction.
Application
Step 1: Identify the Decision
Look for requirements with language like:
- "If X and Y, then..."
- "Depending on..."
- "When A but not B..."
- Multiple nested if-then-else statements
Step 2: List All Conditions
Extract every condition that affects the outcome. Phrase each as a yes/no question for limited-entry tables.
Example conditions:
- Is the order total >= $100?
- Is the customer a member?
- Is the shipping address domestic?
Step 3: List All Possible Actions
List every possible system action:
- Apply free shipping
- Apply standard shipping rate
- Apply international surcharge
- Send membership discount offer
Step 4: Build the Table
- Calculate rules: 2^N for N binary conditions (2^3 = 8 rules for 3 conditions)
- Fill in condition combinations systematically (alternate Y/N to ensure completeness)
- For each rule, mark which actions apply
Step 5: Simplify (Optional)
Look for conditions that do not matter for certain rules. If the action is the same regardless of Condition C's value, consolidate two rules into one with "--" for Condition C.
Step 6: Validate
- Number of rules = 2^N (or fewer with documented consolidation)
- Every rule has at least one action
- No two rules have identical condition combinations (no duplicates)
- No two rules have the same conditions but different actions (no contradictions)
- Review with domain expert: "For this combination, is this the right action?"
Examples
See examples/sample.md for complete decision tables.
Mini example:
markdown## Chemical Disposal Authorization | | Rule 1 | Rule 2 | Rule 3 | Rule 4 | |---|--------|--------|--------|--------| | **Conditions** | | | | | | Chemical is hazardous? | Y | Y | N | N | | Quantity > 5 kg? | Y | N | Y | N | | **Actions** | | | | | | Require EHS officer approval | X | X | | | | Require lab director approval | X | | | | | Technician can self-authorize | | | X | X | | Generate hazmat disposal form | X | X | | | | Generate standard disposal form | | | X | X |
Common Pitfalls
Pitfall 1: Incomplete Table
Symptom: The table has 6 rules for 3 binary conditions (should be 8).
Consequence: Two combinations have no defined behavior. When they occur in production, the system does something unpredictable.
Fix: Always calculate 2^N and account for every combination. If two rules are identical, consolidate explicitly with "--" for the irrelevant condition.
Pitfall 2: Contradictory Rules
Symptom: Two rules have the same condition values but specify different actions.
Consequence: The requirement is contradictory. Developers pick one; it may be wrong.
Fix: Review contradictions with domain experts. One rule is wrong -- find out which.
Pitfall 3: Conditions Are Not Binary
Symptom: "Customer type: Gold / Silver / Bronze" in a limited-entry table.
Consequence: The table is incomplete because multi-valued conditions do not fit the Y/N format.
Fix: Either use extended-entry tables, or convert to binary: "Is customer Gold?", "Is customer Silver?" (with constraint that only one can be true).
References
Related Skills
skills/business-rule/SKILL.md-- Decision tables implement complex business rulesskills/srs-document/SKILL.md-- Decision tables appear in SRS Appendix B (Analysis Models)skills/acceptance-criteria/SKILL.md-- Decision table rules map directly to acceptance criteriaskills/requirements-analysis-process/SKILL.md-- Decision table analysis is part of the analysis workflow
External Frameworks
- Karl Wiegers & Joy Beatty, Software Requirements, Third Edition (2013) -- Chapter 12
- Systematic Software Testing (2002) -- Decision table testing technique
Skill type: Component
Dependencies: References skills/business-rule/SKILL.md
Used by: skills/srs-document/SKILL.md, skills/requirements-analysis-process/SKILL.md


