Decision Table Testing is a black-box testing technique that helps in testing systems or applications that have complex business rules or logic. It involves creating a structured table that lists all possible combinations of inputs and corresponding expected outputs, based on the defined business rules.
The Decision Table consists of four main components:
Conditions: These are the input conditions or variables that affect the outcome of the decision. They represent different states or values that the system can encounter.
Actions: These are the actions or outputs that are expected based on the specific combination of input conditions. They represent the desired behavior or response of the system.
Rules: Each rule represents a specific combination of conditions and the corresponding actions that should be taken. These rules are derived from the business requirements or specifications.
Result: The result section of the table specifies the expected outcome or action for each combination of conditions.
To apply Decision Table Testing, we can follow these steps:
Identify the conditions: Determine the input conditions or variables that influence the decision-making process within the system. These conditions should cover all possible scenarios and combinations.
Define the actions: Identify the actions or outputs that should occur based on the combinations of input conditions. These actions should align with the expected behavior of the system.
Create the Decision Table: Construct a decision table that represents all possible combinations of conditions and the corresponding actions. List the conditions in the leftmost column, the actions in the top row, and fill in the table with the expected outcomes for each combination.
Execute the test cases: Based on the decision table, generate test cases by selecting specific combinations of conditions to cover different scenarios. Test each combination and verify if the actual actions match the expected outcomes.
Validate the results: Compare the actual outputs of the system with the expected outcomes specified in the decision table. If any discrepancies are found, investigate and report them as defects.
Decision Table Testing helps ensure that all possible combinations of conditions and corresponding actions are considered during testing, thus providing comprehensive test coverage. It simplifies the testing process by organizing complex business rules into a structured format, making it easier to identify potential defects and validate the system’s behavior in different scenarios.
Example
Here is a simplified decision table specifically for testing the login functionality of Facebook. We’ll consider two input conditions: Password and Two-Factor Authentication (2FA). The outcomes we’ll examine are “Successful Login” and “Login Failure.”
Condition | |
Password | Valid |
Two-Factor Authentication | Enabled/Disabled |
Outcome | Successful Login |
Password | Invalid |
Two-Factor Authentication | Enabled/Disabled |
Outcome | Login Failure |
Password | Valid |
Two-Factor Authentication | Enabled |
Outcome | Successful Login |
Password | Valid |
Two-Factor Authentication | Disabled |
Outcome | Successful Login |
Password | Invalid |
Two-Factor Authentication | Enabled |
Outcome | Login Failure |
Password | Invalid |
Two-Factor Authentication | Disabled |
Outcome | Login Failure |
In this decision table:
- Each row represents a unique combination of input conditions for Facebook’s login.
- The conditions are Password and Two-Factor Authentication.
- The outcomes are Successful Login and Login Failure.
- Various combinations of input conditions are tested for Facebook’s login functionality.
This decision table helps ensure that different scenarios, such as valid and invalid passwords, and the presence or absence of Two-Factor Authentication, are considered during testing for Facebook’s login.