You are using an older browser that might negatively affect how this site is displayed. Please update to a modern browser to have a better experience. Sorry for the inconvenience!

Decision Table Testing


The main aim of the testing team is to produce a reliable quality software product. To produce a quality software, there are two measures of testing techniques involved– they are the Static and Dynamic Testing Techniques. In software testing, we often use the term Validation and Verification to see whether the product meets the requirement specification.  These two terms technically point to the Dynamic and the Static Technique

Static Analysis – involves verification of the documents, design, plan etc… at every stage

Dynamic Analysis – involves the validation of the given business requirement in various ways

Decision Table Testing: 

Decision Table Testing is one of the Black Box Testing Technique that comes under the Dynamic Analysis. It is also known as Cause Effect Table; the diagrammatic Representation of the logic is known as Cause Effect Graphing. This graphical representation is used to derive the Decision Table.

Equivalence Testing and Boundary Value Analysis are often applied only for specific input values whereas the Decision Table Technique are used when a combination of inputs is given for various outputs. The main purpose is used to check the business logic and the test coverage.

Cause and Effect Graph – Pictorial Representation

It provides the Requirement specification in a logical i.e. AND, OR, NOT and MUTUALLY EXCLUSIVE

AND is Symbolized as ^

OR is Symbolized as v

NOT is Symbolized as ~

MUTUALLY EXCLUSIVE is Symbolizes in ————-

General Pictorial Representation: 

Text BoxText BoxAND – Both the causes should be true for the Effect E1 to be true

ShapeText Box

ShapeShapeShapeText Box

 

OR – Either C1 or C2 cause should be true for the Effect E1 to be true

Text Box

ShapeText Box

ShapeShapeShapeText Box

 

NOT – Cause C1 should be false for the Effect E1 to be true

ShapeText BoxText BoxShape

 

MUTUALLY EXCLUSIVE – It is used to represent when only one among the existing Cause is true

ShapeShapeText BoxShapeShapeShapeShapeText Box

 

How to Design a Cause and Effect graph? 

  1. First draw the cause and effect circles as per the situation, Cause to the left Effect to the right
  2. Sort out the scenarios from the given situation and represent it in logical diagram
  3. Start from the Effect and move towards the cause
  4. Look for Mutually Exclusive Causes

Decision Table Format: 

Conditions/Causes Rules
Actions/Effects Outcomes

 

How to Design a Decision Table:

  1. First we must Discover the subset of the functionality
  2. Then frame a table with the conditions/Causes that were identified
  3. Sort out the True or False combination with the identified conditions

NOTE: The no of combinations (True/False) can be sorted by using the formula 2 power n where n represents the number of conditions that were discovered at the first stage

  1. Next is to identify the correct outcome based on the sorted combinations
  2. At times, there are possibilities to face additional outcomes (i.e. out of the box logic the doesn’t) so we must assume a way to proceed with this

Let us see an example for Decision Table 

Scenario: A science space exhibition is held in the important cities of our country to provide awareness about the space science to the people they have just offered some discounts on the tickets If you hold an ‘over 60s’ entry card, you get a 34% discount on whatever ticket you buy. If you are entering with a child (under 16), you can get a 50% discount on any ticket if you hold a family card, otherwise you get a 10% discount. You can only hold one type of entry card.

First we should design a cause and effect for the scenario

The Causes for this scenario are

  1. C1 – Over 60s Entry Card
  2. C2 – Visiting with child / Family Entry Card
  3. C3 –  Visiting as child alone

The Effects for this scenario are

  1. E1 – Offers a discount of 34%
  2. E2 – Offers a discount of 50%
  3. E3 – Offers a discount of 10%
  4. E4 – Offers a discount of 0%

First draw the Cause and Effect

Text BoxText Box

 

Text BoxText Box

 

Text BoxText Box

 

For E1 to be true following are the causes

–  C1 should be true

–  C1 OR C2 should be true and C3 should be false so that only the Effect E1 will be valid

Text Box

Shape

 

For E2 to be true following are the causes

  • C2 and C3 should be true
  • C1 and C2 cannot be true together. This means C1 and C2 are mutually exclusive

For E3 to be true following are the causes

  • C1 and C2 Should be invalid
  • C3 should be true

 

Text BoxText Box

ShapeShapeShape

ShapeShapeShapeText BoxText Box

Shape

ShapeShapeText BoxText Box

Shape

 

Let us assume Effect E4 is 0%

For E4 to be true following are the causes

  • C1 and C3 should be invalid and C2 should be true

 

ShapeText BoxText Box

 

Text BoxText Box

ShapeShape

Text BoxText Box

ShapeShape

Text Box

 

Totally 3 Conditions

  • Over 60s Entry card – Discount 34%
  • Visiting with child / Family Entry card – Discount 50%
  • Visiting as child alone – Discount 10%

So totally the rules derived from the conditions are 2^3 – 8

Decision Table

Causes R1 R2 R3 R4 R5 R6 R7 R8
Over 60s Entry Card Y Y Y Y F F F F
Family Entry Card Y Y F F Y Y F F
Visiting with child Y F Y F Y F Y F
Effects        

 

       
Discounts (%)                

 

Rule 1: 

In Rule 1 a person meets all the three conditions which is not possible. As explained in the scenario, a person cannot hold more than one entry card and there is nothing mentioned what is the case for having two entry cards; so, let us assume that a person on having two entry cards uses the one with the high discount, so for Rule 1 the discount will be 50% (Family entry Card + With Child)

Causes R1 R2 R3 R4 R5 R6 R7 R8
Over 60s Entry Card Y Y Y Y F F F F
Family Entry Card Y Y F F Y Y F F
Visiting with child Y F Y F Y F Y F
Effects        

 

       
Discounts (%) 50%              

 

Rule 2: 

In Rule 2, a person meets two conditions where He / She has “Over 60s entry card” and “Family entry card”; so, here the case of Visiting with the child is false; so, the person gets a discount of 34% (Over 60s entry card)

Causes R1 R2 R3 R4 R5 R6 R7 R8
Over 60s Entry Card Y Y Y Y F F F F
Family Entry Card Y Y F F Y Y F F
Visiting with child Y F Y F Y F Y F
Effects        

 

       
Discounts (%) 50% 34%            

 

Rule 3: 

In Rule 3, a person meets two condition but the effect of the two is just an assumption as because the Discount 10% for the “otherwise” that is mentioned in the scenario is not given in detail; So, let us assume that the person travels with the “over 60s entry card” and hence the person gets a discount of 34%

Causes R1 R2 R3 R4 R5 R6 R7 R8
Over 60s Entry Card Y Y Y Y F F F F
Family Entry Card Y Y F F Y Y F F
Visiting with child Y F Y F Y F Y F
Effects        

 

       
Discounts (%) 50% 34% 34%          

 

Rule 4: 

In Rule 4, it is very clear and direct that the person has only one Entry Card “Over 60s entry card” and hence the discount is 34%

Causes R1 R2 R3 R4 R5 R6 R7 R8
Over 60s Entry Card Y Y Y Y F F F F
Family Entry Card Y Y F F Y Y F F
Visiting with child Y F Y F Y F Y F
Effects        

 

       
Discounts (%) 50% 34% 34% 34%        

 

Rule 5: 

In Rule 5 also, it very clear that the person has a “Family Entry Card” and “Visiting with child”; so, in this case the discount is 50%

Causes R1 R2 R3 R4 R5 R6 R7 R8
Over 60s Entry Card Y Y Y Y F F F F
Family Entry card Y Y F F Y Y F F
Visiting with child Y F Y F Y F Y F
Effects        

 

       
Discounts (%) 50% 34% 34% 34% 50%      

 

Rule 6: 

In Rule 6, the person has only “Family Entry Card” from the mentioned scenario it doesn’t make sense or the card has no effect if the person is not Visiting with the child, so the scenario completely has no meaning and the person gets 0% discount

Causes R1 R2 R3 R4 R5 R6 R7 R8
Over 60s Entry Card Y Y Y Y F F F F
Family Entry Card Y Y F F Y Y F F
Visiting with child Y F Y F Y F Y F
Effects        

 

       
Discounts (%) 50% 34% 34% 34% 50% 0%    

 

Rule 7: 

In Rule 7, the person is just visiting with a child, which means the person does not have Family Entry Card / Over 60s Entry card and hence this case falls under the Otherwise Case as mentioned in the Scenario and hence the person receives a discount of 10%

Causes R1 R2 R3 R4 R5 R6 R7 R8
Over 60s Entry Card Y Y Y Y F F F F
Family Entry Card Y Y F F Y Y F F
Visiting with child Y F Y F Y F Y F
Effects        

 

       
Discounts (%) 50% 34% 34% 34% 50% 0% 10%  

 

Rule 8:

In Rule 8, a person does not have any of the Entry Card and so this scenario completely has no meaning and the person receives 0% discount

Causes R1 R2 R3 R4 R5 R6 R7 R8
Over 60s Entry Card Y Y Y Y F F F F
Family Entry Card Y Y F F Y Y F F
Visiting with child Y F Y F Y F Y F
Effects        

 

       
Discounts (%) 50% 34% 34% 34% 50% 0% 10% 0%

 

Thus, the above derived tables can be used for Test Design based on the outcome of the Decision Table. It is not that each column from the above table should be tested, but it just a reference that enables us to decide on which combination can be tested and which combination are not needed to test e.g. In the above derived table

To be tested – Rule1, Rule2, Rule3, Rule4, Rule5, Rule7

Not needed to be tested – Rule6, Rule8

So, we will be designing around 6 test cases for the above table.

Advantages:

  1. Makes it easy for the testers to design test for complex scenarios
  2. It provides clarity for complex business scenarios
  3. It follows an iterative process that is the table created for the first input can be used for the second and the second can be used for the third and so on
  4. It reduces the rework on writing Test Cases and Test Scenarios

Conclusion: 

This process is a good way to deal with different combinations of input and following a structured way of sorting out the requirements of the complex business scenarios.