Can decision tables help you test API endpoints?

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
Conditions1234
Is car is older than 5 yearsYNNY
driver has no accidents in the last 2 yearsYNYN
Actions
Discount of 10%XX
Discount of 20%X
Decline insuranceX
KeyYYes
NNo

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.

Published by Mike Harris

Mike has been a testing professional for over 20 years. He has been a Test Lead and has also worked as a part of waterfall, lean and agile teams. He has set up and led a Testing Community of Practice and been part of a successful agile transition. He is Vice-Chair of the British Computer Society’s Specialist Interest Group in Software Testing. He also contributed to the e-books Testing Stories and How Can I test This?

Join the Conversation

  1. Unknown's avatar

1 Comment

Leave a comment

Design a site like this with WordPress.com
Get started