A decision table in software testing is a reliable approach for managing diverse combinations of inputs and their corresponding outputs. Learn what is decision table and its related concepts.
OVERVIEW
A decision table is a systematic approach or representation for detailing different combinations of conditions or aspects and their diverse outcomes and actions. In simple terms, in software testing, a decision table analyzes the functionality and behavior of a software application or system by systematically documenting various combinations of inputs in a tabular format.
The testers use these to seek clarity on the decision-making process during the Software Development Life Cycle (SDLC) as they provide a structured way to handle decision logic and have expected outcomes. In the Software Development Life Cycle, decisions on making choices and taking actions for the software application enhancement are based on particular conditions and inputs like environmental variables, user inputs, and other parameters.
Such factors directly impact the functionality of the software applications because different combinations of conditions or inputs will lead to diverse test outcomes or actions. It is very important that testers and developers understand and manage such conditions and inputs to ensure that developed software applications function accurately.
This can be better done by creating a decision table. It gives a way to figure out all the possible scenarios for testing and their expected outcome. This not only saves testers and developers from missing any test case but also allows them to understand the decision logic and make correct decisions for the test process of software applications based on different conditions.
A decision table in software testing is a reliable approach for managing diverse combinations of inputs and their corresponding outputs. To put it differently, a decision table serves as a tabular representation that captures inputs in relation to rules, cases, or test conditions. Here, input denotes the factors or conditions needed to evaluate the behavior of the software application.
Likewise, output is the expected result of what the software application should do or produce in response to different input conditions. It encompasses information about various rules, test conditions, and inputs as perceived by the tester, represented as 'Yes' or 'No,' 'True' or 'False,' 'Y' or 'N,' and similar variations. This proves instrumental in facilitating both straightforward and complex software testing.
Here are some key points about decision tables:
Here is a sample of the decision table:
Conditions | Rule 1 | Rule 2 | Rule 3 | Rule 4 |
---|---|---|---|---|
Condition 1 | T | T | F | F |
Condition 2 | F | T | F | T |
Condition 3 | T | F | T | F |
Actions/output | Rule 1 | Rule 2 | Rule 3 | Rule 4 |
Action 1 | ||||
Action 2 | ||||
Action 3 |
While other testing methodologies like boundary value testing and equivalence class partitioning testing address distinct scenarios, conflict arises when the system exhibits varying input behaviors. A decision table proves invaluable in such situations.
The decision table gives a visual representation of different input conditions and their related action that allows easy evaluation of all possible combinations. This enables comprehensive coverage of various input conditions to assess the software applicationâs responses comprehensively. Thus, it helps the testing of extensive datasets, which allows the streamlining of the testing activities and evaluation of the complete Software Testing Life Cycle (STLC).
Decision tables can also be used to reduce the number of test cases that need to be created. By eliminating redundant or irrelevant scenarios, it can help testers to save time and effort and create more comprehensive and well-thought-out test cases. By clearly defining the inputs, conditions, actions, and expected results for each test case, decision tables can help to reduce the risk of human error.
A decision table consists of several key components that work together to define and represent decision logic in a structured format. These components include
You have got an idea about the decision table and its components; now let us understand its various uses and implementation.
Decision tables are used for various purposes and are not just limited to software testing. Let us explore some examples of decision tables in action.
Different types of decision tables are used in developing and testing software applications. Let us have a look at those in the below sections.
Basically, when it comes to decision tables, they are divided into four main types based on different purposes and situations involved in software testing. These are:
Limited Entry Decision Table
The name itself signifies a limited number of included inputs and actions in this table. Since there is less data in this decision table, it becomes easy for testers to manage and handle them effectively. It's often used for testing scenarios with few input conditions and corresponding outcomes.
Condition 1 | Condition 2 | Condition 3 | Decision |
---|---|---|---|
A | X | Y | Yes |
B | X | Z | No |
A | Y | Z | Yes |
B | Z | Y | No |
Unlimited Entry Decision Table
This decision table is leveraged to handle a large number of conditions and actions. It is being used mainly for complex software testing, which incorporates different input variables and possible outcomes.
Condition 1 | Condition 2 | âŠâŠâŠâŠâŠ. | Condition N | Decision |
---|---|---|---|---|
A | X | âŠâŠâŠâŠâŠ. | P | Yes |
B | X | âŠâŠâŠâŠâŠ. | Q | No |
C | Y | âŠâŠâŠâŠâŠ. | R | Yes |
⊠| âŠ. | âŠâŠâŠâŠâŠ. | âŠ. | ⊠|
You can have as many conditions in an unlimited entry decision table (Condition 1, Condition 2, ..., Condition N) as needed.
Simple Decision Table
Simple decision tables have a single set of conditions, and each condition directly maps to an action or outcome. They are suitable for scenarios where the relationship between inputs and outputs is straightforward and linear.
Conditions | Actions/Outcome |
---|---|
A | X |
B | Y |
C | Z |
D | X |
Each condition (A, B, C, D) directly maps to a specific action or outcome (X, Y, Z).
Complete Decision Table
In this decision table, all the included and possible combinations of conditions and their actions are considered. It is valuable as it ensures exhaustive test coverage by verifying and validating every possible test scenario of software applications.
Condition 1 | Condition 2 | Condition 3 | Decision |
---|---|---|---|
A | X | P | Yes |
A | X | Q | No |
A | Y | P | Yes |
B | Y | Q | No |
B | X | P | No |
B | X | Q | Yes |
B | Y | P | No |
There are multiple conditions (Condition 1, Condition 2, Condition 3), and each row represents a specific combination of conditions and outcomes.
Orthogonal Array Decision Table
This decision table is mainly specialized in the optimization of test cases as it allows a reduction in the number of test cases for better test coverage. This can be done while still testing crucial combinations of conditions.
Extended Decision Table
Extended decision tables incorporate additional information such as priority levels, test data, or expected results into the table.
Condition 1 | Condition 2 | Priority | Test Data | Expected result |
---|---|---|---|---|
A | X | High | Data 1 | Pass |
B | Y | Low | Data 2 | Fail |
C | Z | Medium | Data 3 | Pass |
D | X | High | Data 4 | Fail |
E | Z | Low | Data 5 | Pass |
Let us now learn about decision tables with an example.
Example 1: Managing User Access Rights
Let us create a decision table for managing the user access rights based on different conditions. For example, you have web applications where you are supposed to test the different login conditions to the web page. Here are some conditions:
Now let us make a decision table based on the above cases:
Conditions | Case 1 (Admin, >=8) | Case 2 (Admin, <8) | Case 3 (User, >=8) | Case 4 (User, <8) |
---|---|---|---|---|
Role (Admin/User) | TRUE | TRUE | FALSE | FALSE |
Password Length (>=8/<8) | TRUE | FALSE | TRUE | FALSE |
Access Right | True (Full) | True (Error Msg) | False (Limited Access) | False (Error Msg) |
For the different conditions, four different test cases need to be tested in the testing process:
Expected outcome: The admin is shown with full access to the features of the applications.
Expected outcome: The admin is shown an error message.
Expected outcome: The user is given limited access to the features of the applications.
Expected outcome: The user is shown an error message.
When you define the above four test cases based on the developed decision table, you can analyze the work and functionality of the software applications, like how they handle the user access rights under different role and password length conditions.
Example 2: Web Application Compatibility Testing
Imagine you have been assigned the responsibility of verifying the compatibility of a web application across various web browsers and operating systems. To accomplish this task, we will construct a decision matrix delineating multiple test scenarios and their anticipated outcomes.
Testing Conditions: These conditions pertain to the specific web browsers and operating systems on which the web application must undergo testing. For the sake of simplicity, we will consider three web browsers (Chrome, Firefox, and Safari) and three operating systems (Windows, macOS, and Linux).
Test Cases:
Expected Result: The web application should operate without any issues.
Expected Result: The web application should operate without issues.
Expected Result: The web application should operate without issues.
Expected Result: The web application should operate without issues.
Expected Result: The web application should operate without issues.
Expected Result: The web application should operate without issues.
Expected Result: The web application should operate without issues.
Here is the decision table:
Expected Result: The web application should operate without issues.
Expected Result: The web application should operate without issues.
Expected Result: The web application should display a message indicating that it is not supported on Internet Explorer.
Expected Result: The web application should operate without issues.
Conditions | Case 1 | Case 2 | Case 3 | Case 4 | Case 5 | Case 6 | Case 7 | Case 8 | Case 9 | Case 10 | Case 11 | Case 12 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Browser | Chrome | Chrome | Chrome | Firefox | Firefox | Firefox | Safari | Safari | Safari | Internet Explorer | Edge | Edge |
Operating System | Windows | macOS | Linux | Windows | macOS | Linux | macOS | Windows | Linux | Windows | Windows | macOS |
Expected Result | Functions correctly | Functions correctly | Functions correctly | Functions correctly | Functions correctly | Functions correctly | Functions correctly | Functions correctly | Functions correctly | Not supported on Internet Explorer | Functions correctly | Functions correctly |
Expected Result: The web application should operate without issues.
From the above two examples on the decision table, you must be aware that it is the best approach to identify and resolve any potential issues in the software application. Now read the below section to get an idea of its advantages.
The use of decision tables in software testing offers several advantages, including.
However, knowing about the advantages of the decision table is not sufficient when you have to start with it. Having a good idea of its disadvantages can guide you to ways to optimize the decision table.
Continue reading the section below to know more.
Despite the need and importance of a decision table in software testing, it has certain disadvantages that may interfere with the test process. Here are some of those disadvantages:
Now, let us learn how to construct a decision table.
Before digging into the exact way to create a decision table, we will understand its features.
Condition being tested | Condition statements | Conditions entries |
Possible actions to take | Action statements | Actions entries |
Here are the general steps you should follow to construct a decision table:
Step 1: Problem Identification
The initial step in constructing a table is pinpointing and defining the problem. This involves recognizing the relevant factors and determining the necessary next steps.
Step 2: Condition and Action Definition
Once the problem is acknowledged, it becomes crucial to delineate the specific conditions and actions involved. Deconstructing the problem and identifying its constituent elements is an essential part of this process.
Step 3: Table Making
Step 4: Rule Formulation
Step 5: Decision Table Organization
Now let us elaborate on this in more detail with the example below:
Suppose you are to create a table with the requirement: A user can delete a file if they are the file owner or have been granted delete permissions by the file owner.
Now, you have to express the conditional and its underlying actions in a list so that you define them as either TRUE or FALSE. Here, there are two conditions: âUser is the file ownerâ and âUser has been granted delete permissions by the file ownerâ. There is one result: the user can delete the file.
Conditions |
---|
User is the file owner |
User has been granted delete permissions by the file owner |
Actions |
User can delete the file |
The next step is to calculate the exact number of columns needed to be constructed in the decision table. Here, the number of conditions and alternatives for each condition defines the number of columns. As in this example, there are two conditions, each of which can be TRUE or FALSE, so you will need a total of 4 columns.
However, if you have more columns, you can use the formula 2conditions.
Tip: You should create several smaller tables instead of a few larger ones. This precautionary measure helps prevent tables from growing so large that they become difficult to manage. You can validate this approach by beginning with areas with fewer business rules for testing purposes.
Now, you have to add T (TRUE) and F (FALSE) for the conditions. But you may think, what is the best way to do this? Remember, for each defined row, the number of "T" and "F" values is doubled compared to the previous row. This pattern continues horizontally across the entire row. For instance, in a table with 8 columns, the first row will display "TFTFTFTF," the second row will display "TTFFTTFF," and the third row will display "TTTTFFFF."
Now, you have to add T (TRUE) and F (FALSE) for the conditions. But you may think, what is the best way to do this? Remember, for each defined row, the number of "T" and "F" values is doubled compared to the previous row. This pattern continues horizontally across the entire row. For instance, in a table with 8 columns, the first row will display "TFTFTFTF," the second row will display "TTFFTTFF," and the third row will display "TTTTFFFF."
Conditions | ||||
---|---|---|---|---|
User is the file owner | T | F | T | F |
User has been granted delete permissions by the file owner | T | T | F | F |
Actions | ||||
User can delete the file |
You may use an Excel template to construct and fill in the decision tables.
You should now mark the unimportant value with â-â. If the user is the file owner, it does not matter if the user is granted to delete the file. Hence, you should check for invalid combinations and complete this step by removing duplicate columns. In the example provided, the first and third columns are equal; hence, one is eliminated.
Now that you have lowered the table, you have to enter the actions for each column in the table. You can find this information in the requirement and, based on that, name the columns. You can define them as R1/Rule 1, R2/Rule 2, etc.
Conditions | |||
---|---|---|---|
User is the file owner | T | F | F |
User has been granted delete permissions by the file owner | - | T | F |
Actions | |||
User can delete the file | T | T | F |
Now, you can write the test cases based on the table.
Here is the series of steps that you should follow to apply a decision table to the software applications being tested to determine its behavior under various input conditions:
We can say that the decision table represents complex conditional logic that eventually directs and guides the testing strategies. When we make a table, we have different combination and action that signifies specific test scenario, and it becomes important to test the accuracy and reliability of your software applications across different environments and browsers. Such test scenarios can be tested and leveraged across various real-world environments by executing them in a cloud-based platform like LambdaTest.
LambdaTest is an AI-powered test orchestration execution platform that allows the execution of both manual and automation tests across an online browser farm of 3000+ browsers, devices, and OS combinations. This will help you to test your applicationâs behavior consistency across different environments. We know that the decision table may have numerous test cases.
With LambdaTest, you can leverage parallel test capabilities using different automation testing frameworks and languages and execute multiple test cases simultaneously. You can also detect errors and bugs in the software application by LambdaTestâs in-built debugging tools, thus making it easier to report and fix them efficiently.
Following is the tutorial below on running parallel testing using TestNG on the LambdaTest platform.
Subscribe to the LambdaTest YouTube Channel for more videos on automation testing and Cypress testing and to elevate your testing game!
To improve the accuracy and efficiency of the decision table, you should optimize it by applying specific rules and steps. Here are explanations of those steps:
By following these optimization steps, you create a decision table that is more concise and precise. Other than optimizing the table, it's also important to perform decision table testing.
Decision table testing is a way to test software by trying out different combinations of inputs. It is especially useful for testing complex business logic, where the system's behavior changes depending on the specific inputs.
Other techniques, such as boundary value testing and equivalent partitioning, are also used to ensure good test coverage. However, these techniques are less effective when the system's behavior differs for each input set.
Decision tables are easy to understand and use and can be used to ensure good test coverage for complex business logic. They can also be used as a reference for the requirement and functionality development. The importance of decision table testing becomes clear as the number of inputs increases.
For example, if a system has 10 inputs, there are 1024 possible combinations of inputs. It is obviously not possible to test all of these combinations, but decision table testing can be used to choose a subset of the combinations to test. Decision table testing is important because it helps us test different combinations of conditions and provides better test coverage for complex business logic. It is instrumental when testing the behavior of a large set of inputs where the system's behavior differs with each set of inputs. Decision tables are easy to understand and use, and they can provide good coverage and representation.
Decision table testing is important because it helps us test different combinations of conditions and provides better test coverage for complex business logic. It is instrumental when testing the behavior of a large set of inputs where the system's behavior differs with each set of inputs. Decision tables are easy to understand and use, and they can provide good coverage and representation.
Here are some tools that can be used to create decision tables:
Here are some best practices that can be used to improve the process of creating a decision table:
In this tutorial, we have discussed in great detail the decision and way to construct those, which will eventually help you get started with it. Let us now summarize the key learning. A decision table is an effective way to manage different types of combinations of inputs along with their expected outcome related to software testing and others. However, using decision tables is not just limited to software testing. They are also used for any business purpose to break down any complex requirements and give the visual appearance to the expected outcome in the form of a table.
Using a decision table for software testing is recommended when a large combination of test cases is involved. As a tester, it becomes easy for them to create and execute test cases without missing any test cases. Hence, it is advised that you should make a decision table at an early stage of software development; then, it will become useful for developers, end-users, testers, and requirement specialists. The tabular representation of the outcome eases the analysis process of test cases of the software applicationâs features and components.
However, it has some notable drawbacks, such as increased time consumption, potential security and performance scanning issues, and the requirement for expert testers to maintain the tables. Despite these drawbacks, decision table testing is highly recommended, given its ability to provide comprehensive coverage for different scenarios.
Did you find this page helpful?
Try LambdaTest Now !!
Get 100 minutes of automation test minutes FREE!!