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. 

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: 

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

Shape
Text Box
Shape
Shape
Shape
Text Box

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

Text Box
Shape
Text Box
Shape
Shape
Shape
Text Box

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

Shape
Text Box
Text Box
Shape

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

Shape
Shape
Text Box
Shape
Shape
Shape
Shape
Text 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/CausesRules
Actions/EffectsOutcomes

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 Box
Text Box
Text Box
Text Box
Text Box
Text 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 Box
Text Box
Shape
Shape
Shape
Shape
Shape
Shape
Text Box
Text Box
Shape
Shape
Shape
Text Box
Text 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
Shape
Text Box
Text Box
Text Box
Text Box
Shape
Shape
Text Box
Text Box
Shape
Shape
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

CausesR1R2R3R4R5R6R7R8
Over 60s Entry CardYYYYFFFF
Family Entry CardYYFFYYFF
Visiting with childYFYFYFYF
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)

CausesR1R2R3R4R5R6R7R8
Over 60s Entry CardYYYYFFFF
Family Entry CardYYFFYYFF
Visiting with childYFYFYFYF
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)

CausesR1R2R3R4R5R6R7R8
Over 60s Entry CardYYYYFFFF
Family Entry CardYYFFYYFF
Visiting with childYFYFYFYF
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%

CausesR1R2R3R4R5R6R7R8
Over 60s Entry CardYYYYFFFF
Family Entry CardYYFFYYFF
Visiting with childYFYFYFYF
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%

CausesR1R2R3R4R5R6R7R8
Over 60s Entry CardYYYYFFFF
Family Entry CardYYFFYYFF
Visiting with childYFYFYFYF
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%

CausesR1R2R3R4R5R6R7R8
Over 60s Entry CardYYYYFFFF
Family Entry cardYYFFYYFF
Visiting with childYFYFYFYF
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

CausesR1R2R3R4R5R6R7R8
Over 60s Entry CardYYYYFFFF
Family Entry CardYYFFYYFF
Visiting with childYFYFYFYF
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%

CausesR1R2R3R4R5R6R7R8
Over 60s Entry CardYYYYFFFF
Family Entry CardYYFFYYFF
Visiting with childYFYFYFYF
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

CausesR1R2R3R4R5R6R7R8
Over 60s Entry CardYYYYFFFF
Family Entry CardYYFFYYFF
Visiting with childYFYFYFYF
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.

About MST

At MST Solutions our cornerstone is to adapt, engage and create solutions which guarantee the success of our clients. The talent of our team and experiences in varied business verticals gives us an advantage over other competitors.

Recent Articles

Work with us.

Our people aren’t just employees, they are key to the success of our business. We recognize the strengths of each individual and allow them time and resources to further develop those skills, crafting a culture of leaders who are passionate about where they are going within our organization.