Decision Table Testing

From Canonica AI

Overview

A decision table is a software testing technique used in both black box testing and white box testing. This method is particularly useful for systems that have logical relationships between different inputs. Decision table testing is a systematic and disciplined approach to test complex systems that could be described by logical conditions and have different combinations of inputs.

Concept

The concept of decision table testing is based on the principles of decision theory and boolean algebra. It is a tabular representation of inputs versus rules/cases. The rows of the table represent the inputs, while the columns represent the rules or cases. The cells in the table are the outcomes of each combination of inputs and rules.

Creating a Decision Table

Creating a decision table involves identifying input conditions and determining possible outcomes. The number of rules or cases in the table is usually 2^n, where n is the number of conditions. This is because each condition can have two states: true or false. However, this number can be reduced if certain combinations of inputs are impossible or don't result in a unique outcome.

Advantages of Decision Table Testing

Decision table testing has several advantages. It ensures that all possible combinations of inputs are tested, which can help to uncover bugs that might be missed by other testing methods. It also provides a clear and concise way to represent complex business rules, which can be helpful for both developers and stakeholders.

Limitations of Decision Table Testing

However, decision table testing also has some limitations. If the number of inputs is large, the number of combinations can become unmanageable. In addition, creating and maintaining decision tables can be time-consuming.

Example of Decision Table Testing

Consider a simple example of a system that calculates discounts for a retail store. The inputs are "Customer is a senior citizen" and "Customer has a loyalty card". The possible outcomes are "No discount", "10% discount", and "15% discount". A decision table for this system would look like this:

|- | Senior Citizen | Loyalty Card | Discount |- | Yes | Yes | 15% |- | Yes | No | 10% |- | No | Yes | 10% |- | No | No | No discount

In this example, each row after the first represents a test case. The tester would ensure that the system produces the expected discount for each combination of inputs.

A decision table with two input conditions and four rules. Each cell in the table is filled with either "Yes", "No", or a percentage.
A decision table with two input conditions and four rules. Each cell in the table is filled with either "Yes", "No", or a percentage.

See Also