Aller au contenu principal

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

  1. Conditions/Inputs: The variables or decisions.
  2. Actions/Outputs: The system response or expected result.
  3. 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:

  1. Is user a member? (Yes/No)
  2. Is cart value > $100? (Yes/No)

Actions:

  • Apply 20% discount
  • Apply 10% discount
  • Apply no discount

Step 2: Create the Decision Table

Rule #MemberCart > $10020% Discount10% DiscountNo Discount
1YesYes
2YesNo
3NoYes
4NoNo

Step 3: Design Test Cases

Test Case IDMemberCart ValueExpected Discount
TC01Yes$15020%
TC02Yes$8010%
TC03No$120None
TC04No$50None

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 1Condition 2...Action 1Action 2...
1TRUEFALSE......
2FALSETRUE......

Use this format for modeling if-else, switch-case, or multi-factor logic cleanly.