
I recently saw a comment about how testers should be able to use decision tables to aid their testing. I decided to refresh my understanding of them and these are the notes I created about them.
Decision tables are an analytical tool. They are used to describe logic and can be helpful in understanding the rules that make up functionality.
The example decision table below contains the rules for car insurance:
| Rules | ||||
| Conditions | 1 | 2 | 3 | 4 |
| Is car is older than 5 years | Y | N | N | Y |
| driver has no accidents in the last 2 years | Y | N | Y | N |
| Actions | ||||
| Discount of 10% | X | X | ||
| Discount of 20% | X | |||
| Decline insurance | X |
| Key | Y | Yes |
| N | No |
A decision table should have the conditions and actions in the left hand column. The left hand column defines the rules. The table must also have the columns that contain the entries for the conditions and the entries for the actions to be taken for each combination of conditions. None of the columns that contain the entries for conditions should be the same.
A decision table is drawn from left to right. You should start by listing the conditions in the left hand column. Each of the rules columns should be unique. You can then enter the combinations of conditions in the rules columns. Once the rules columns are complete you can fill in the actions. You should follow each rule down and mark the action to be taken.
The table can help in understanding functionality because it enables you to see the effect of different combinations of conditions. You can then look for gaps, and issues and decide on the level of coverage that is appropriate for your testing.
Decision tables are less likely to be helpful when testing a UI as probably the UI you are testing is not so complex as to require decision tables to analyse it. However, decision tables are likely to be useful when analysing an API endpoint as you can use the table to analyse the effects of parameters on the return values of the endpoint.
I have used Computer Science 4th Edition by C.S French as a reference for this post.
Leave a comment