Decision Table and Collapsed Decision Table
A decision table is a good way to deal with combinations of things (e.g. inputs). This technique is sometimes also referred to as a ’cause-effect’ table.
How to Use decision tables for test designing?
Technique followed for decision table testing are follows:
Technique followed for decision table testing are follows:
- Analyze the given test inputs or requirements an list out the various Conditions in the decision table.
- Calculate the number of possible combinations called Rules. Rules is usually calculated as 2 to the power of condition (2^condition).
- Fill columns of the decision table with all possible combinations (Rules)
- For each of the combination of values, find out the Action or Expected result.
Let us consider an example to construct decision table:
Q: For persons in the age group 16-65 (both inclusive) tax payment have to be calculated. A person earning less than £20,000 will pay 20% taxes, otherwise they pay 50% taxes. If the person has children he/she will receive a tax reduction of 10%.
Let us first identify conditions and action in the given example,
Now I would like to talk about Collapsed Decision Table, if for two test columns only one condition differs and resulting actions are same these columns can be joined or in other words delete likely non - relevant test cases.
Rules for applying collapsing decision table:
Step 1: Compare column 1-2, 3-4, 5-6, 7-8
Step 2: Compare column 1-3, 2-4, 5-7, 6-8
Step 3: Compare column 1-5, 2-6, 3-7, 4-8
Things to remember:
Step 1: Applying this role to the table above,
Column 1- 2 = not same action
Column 3-4 = not same action
Column 5-6 = are same in terms of action with only condition differing i.e., children hence we can delete column 6 ( column on right ).
Column 7-8 = are same in terms of action with only condition differing i.e., children hence we can delete column 8 ( column on right ).
After applying step 1 table looks like below:
Step 2: Applying this role to the table above,
Column 1-3 = not same action
Column 2-4 = not same action
Column 5-7 = are same in terms of action with only condition differing i.e.,earning hence we can delete column 7 ( column on right ).
Column 6-8 = as there is no column to compare, we just ignore this
After applying step 2 table looks like below:
Step 3: Applying this role to the table above,
Column 1-5 = not same action
Column 2-6 = as there is no column 6 to compare, we just ignore this
Column 3-7 = as there is no column 7 to compare, we just ignore this
Column 4-8 = as there is no column 8 to compare, we just ignore this
So in our example collapsed decision table is:
I hope, now concept of Decision table and Collapsed decision table is clear. If you have any question you can reach out to me. Please leave your questions in the comments.
Q: For persons in the age group 16-65 (both inclusive) tax payment have to be calculated. A person earning less than £20,000 will pay 20% taxes, otherwise they pay 50% taxes. If the person has children he/she will receive a tax reduction of 10%.
Let us first identify conditions and action in the given example,
Condition
|
Values
|
Age
|
16 – 65 and >16/>65
|
Earning
|
<20,000 and >20,000
|
Children
|
Yes and No
|
Action
|
Tax 20%
|
Tax 50%
|
Tax Reduction 10%
|
No Tax Calculation
|
In order to construct decision table we need to know number of columns/ test set that is derived from formula explained earlier i.e., 2^condition so in our example it is 2^3 = 8 test sets.
Lets construct Decision Table:
Condition
|
Numbers
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
Age 16 - 65
|
|||||||||
Earning < 20, 000
|
|||||||||
Children = Yes
|
|||||||||
Action
|
Tax 20%
|
||||||||
Tax 50%
|
|||||||||
Tax Reduction 10 %
|
|||||||||
No Tax Calculation
|
|||||||||
Result
|
as we know we need 8 test set hence we have 8 columns which are numbered. If you look at condition here we have taken only positive set as when you go on filling decision table we fill it with either 1 or 0. where 1 represents positive set and 0 represents negative set. For example in case of condition Children 1 = Yes and 0 = No
Easily way to fill in Decision table:
1st Row = start with 1 and fill in test set / 2 columns with it. i.e., 8/2 =4 so , first 4 columns with 1 and next 4 column with 0
2nd Row = start with 1 and fill in test set/4 with it. i.e., 8/4 = 2 so, first 2 column with 1 and second 2 columns with zero and repeat same for rest of 4 columns
3rd Row = start with 1 and fill in test set/8 with it. i.e., 8/8 = 1 so first column with 1 and second column with 0 and repeat same for rest of the columns.
Completed table should look like this:
Condition
|
Numbers
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
Age 16 - 65
|
1
|
1
|
1
|
1
|
0
|
0
|
0
|
0
|
|
Earning < 20, 000
|
1
|
1
|
0
|
0
|
1
|
1
|
0
|
0
|
|
Children = Yes
|
1
|
0
|
1
|
0
|
1
|
0
|
1
|
0
|
|
Action
|
Tax 20%
|
||||||||
Tax 50%
|
|||||||||
Tax Reduction 10 %
|
|||||||||
No Tax Calculation
|
|||||||||
Result
|
Now lets start marking actions in the table,
1st column: A Person with age 16 - 65 and earning less than 20,000 and has children so he has to pay 20% tax because he has child he gets 10 % tax deduction = 10% Tax
2nd Column:A Person with age 16- 65 , earning < 20,000 and has no children hence get does not get any deduction and has to pay 20% tax.
3rd Column: A Person with age 16 - 65 and earns > 20, 000 and has children hence he has to pay 50 % tax because he has child he gets 10 % deduction = 40% tax
Now, you just go on to fill in rest of columns. Completed table looks like this:
Condition
|
Numbers
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
Age 16 - 65
|
1
|
1
|
1
|
1
|
0
|
0
|
0
|
0
|
|
Earning < 20, 000
|
1
|
1
|
0
|
0
|
1
|
1
|
0
|
0
|
|
Children = Yes
|
1
|
0
|
1
|
0
|
1
|
0
|
1
|
0
|
|
Action
|
Tax 20%
|
X
|
X
|
-
|
-
|
-
|
-
|
-
|
-
|
Tax 50%
|
-
|
-
|
X
|
X
|
-
|
-
|
-
|
-
|
|
Tax Reduction 10 %
|
X
|
-
|
X
|
-
|
-
|
-
|
-
|
-
|
|
No Tax Calculation
|
-
|
-
|
-
|
-
|
X
|
X
|
X
|
X
|
|
Result
|
10%
|
20%
|
40%
|
50%
|
0%
|
0%
|
0%
|
0%
|
Now I would like to talk about Collapsed Decision Table, if for two test columns only one condition differs and resulting actions are same these columns can be joined or in other words delete likely non - relevant test cases.
Rules for applying collapsing decision table:
Step 1: Compare column 1-2, 3-4, 5-6, 7-8
Step 2: Compare column 1-3, 2-4, 5-7, 6-8
Step 3: Compare column 1-5, 2-6, 3-7, 4-8
Things to remember:
- Always delete column on the right
- Do not rename the columns after deletion.
Step 1: Applying this role to the table above,
Column 1- 2 = not same action
Column 3-4 = not same action
Column 5-6 = are same in terms of action with only condition differing i.e., children hence we can delete column 6 ( column on right ).
Column 7-8 = are same in terms of action with only condition differing i.e., children hence we can delete column 8 ( column on right ).
After applying step 1 table looks like below:
Condition
|
Numbers
|
1
|
2
|
3
|
4
|
5
|
7
|
Age 16 - 65
|
1
|
1
|
1
|
1
|
0
|
0
|
|
Earning < 20, 000
|
1
|
1
|
0
|
0
|
1
|
0
|
|
Children = Yes
|
1
|
0
|
1
|
0
|
~
|
~
|
|
Action
|
Tax 20%
|
X
|
X
|
-
|
-
|
-
|
-
|
Tax 50%
|
-
|
-
|
X
|
X
|
-
|
-
|
|
Tax Reduction 10 %
|
X
|
-
|
X
|
-
|
-
|
-
|
|
No Tax Calculation
|
-
|
-
|
-
|
-
|
X
|
X
|
|
Result
|
10%
|
20%
|
40%
|
50%
|
0%
|
0%
|
Step 2: Applying this role to the table above,
Column 1-3 = not same action
Column 2-4 = not same action
Column 5-7 = are same in terms of action with only condition differing i.e.,earning hence we can delete column 7 ( column on right ).
Column 6-8 = as there is no column to compare, we just ignore this
After applying step 2 table looks like below:
Condition
|
Numbers
|
1
|
2
|
3
|
4
|
5
|
Age 16 - 65
|
1
|
1
|
1
|
1
|
0
|
|
Earning < 20, 000
|
1
|
1
|
0
|
0
|
~
|
|
Children = Yes
|
1
|
0
|
1
|
0
|
~
|
|
Action
|
Tax 20%
|
X
|
X
|
-
|
-
|
-
|
Tax 50%
|
-
|
-
|
X
|
X
|
-
|
|
Tax Reduction 10 %
|
X
|
-
|
X
|
-
|
-
|
|
No Tax Calculation
|
-
|
-
|
-
|
-
|
X
|
|
Result
|
10%
|
20%
|
40%
|
50%
|
0%
|
Step 3: Applying this role to the table above,
Column 1-5 = not same action
Column 2-6 = as there is no column 6 to compare, we just ignore this
Column 3-7 = as there is no column 7 to compare, we just ignore this
Column 4-8 = as there is no column 8 to compare, we just ignore this
So in our example collapsed decision table is:
Condition
|
Numbers
|
1
|
2
|
3
|
4
|
5
|
Age 16 - 65
|
1
|
1
|
1
|
1
|
0
|
|
Earning < 20, 000
|
1
|
1
|
0
|
0
|
~
|
|
Children = Yes
|
1
|
0
|
1
|
0
|
~
|
|
Action
|
Tax 20%
|
X
|
X
|
-
|
-
|
-
|
Tax 50%
|
-
|
-
|
X
|
X
|
-
|
|
Tax Reduction 10 %
|
X
|
-
|
X
|
-
|
-
|
|
No Tax Calculation
|
-
|
-
|
-
|
-
|
X
|
|
Result
|
10%
|
20%
|
40%
|
50%
|
0%
|
I hope, now concept of Decision table and Collapsed decision table is clear. If you have any question you can reach out to me. Please leave your questions in the comments.
Thank you so much for your explanation)
ReplyDeleteThank you so much!
ReplyDeleteWell explained. The outcome (Actions) is the deciding factor.
ReplyDeleteDecision Table And Collapsed Decision Table >>>>> Download Now
ReplyDelete>>>>> Download Full
Decision Table And Collapsed Decision Table >>>>> Download LINK
>>>>> Download Now
Decision Table And Collapsed Decision Table >>>>> Download Full
>>>>> Download LINK 4g
Thanks for broad explanation
ReplyDeleteThanks and that i have a dandy proposal: House Renovation What Order complete house renovation cost
ReplyDelete