Test Case Design Technique: Decision Table Testing
Overview
Decision Table Testing is a powerful black-box test design technique used to model complex business logic with combinations of inputs and corresponding system behaviors. It’s particularly useful when different combinations of inputs yield different outputs or actions.
A decision table helps ensure all possible rules and conditions are covered in your test cases in a structured, traceable way.
Why Use Decision Table Testing?
- Clarifies complex rule-based logic
- Ensures full coverage of combinations of conditions
- Helps find missing or conflicting rules
- Easily understandable by both technical and non-technical stakeholders
Components of a Decision Table
- Conditions/Inputs: The variables or decisions.
- Actions/Outputs: The system response or expected result.
- Rules: Combinations of input values and their corresponding actions.
Example: Online Shopping Discount Rules
Business Rules:
- If user is a member and cart value is > $100, apply 20% discount
- If user is a member and cart value is ≤ $100, apply 10% discount
- If user is not a member, no discount regardless of cart value
Step 1: Identify Conditions and Actions
Conditions:
- Is user a member? (Yes/No)
- Is cart value > $100? (Yes/No)
Actions:
- Apply 20% discount
- Apply 10% discount
- Apply no discount
Step 2: Create the Decision Table
Rule # | Member | Cart > $100 | 20% Discount | 10% Discount | No Discount |
---|---|---|---|---|---|
1 | Yes | Yes | ✅ | ❌ | ❌ |
2 | Yes | No | ❌ | ✅ | ❌ |
3 | No | Yes | ❌ | ❌ | ✅ |
4 | No | No | ❌ | ❌ | ✅ |
Step 3: Design Test Cases
Test Case ID | Member | Cart Value | Expected Discount |
---|---|---|---|
TC01 | Yes | $150 | 20% |
TC02 | Yes | $80 | 10% |
TC03 | No | $120 | None |
TC04 | No | $50 | None |
Real-World Use Cases
- Pricing or discount logic (e-commerce, insurance)
- Access control systems (roles, permissions)
- Loan eligibility based on credit, income, and age
- Form validation rules (required fields, dependencies)
When to Use Decision Table Testing
- Multiple inputs influencing outcomes
- Business logic with conditional rules
- Ensuring completeness and consistency in requirements
- Optimizing test coverage from combinations
Best Practices
- Limit each condition to binary or distinct values to keep the table manageable
- Use tools like Excel or test case management systems with matrix/table support
- Collaborate with business analysts or product owners to derive accurate rules
- Highlight any uncovered or contradictory rules for resolution
Summary
Decision Table Testing is an ideal technique for validating complex business logic through systematic input-output combinations. It reduces oversight, improves clarity, and promotes robust test coverage.
"Think of a decision table as a truth table for QA—it guarantees logic is tested, not just code."
Quick Template
Rule # | Condition 1 | Condition 2 | ... | Action 1 | Action 2 | ... |
---|---|---|---|---|---|---|
1 | TRUE | FALSE | ... | ✅ | ❌ | ... |
2 | FALSE | TRUE | ... | ❌ | ✅ | ... |
Use this format for modeling if-else, switch-case, or multi-factor logic cleanly.