Decision Table Testing
Example 1: How to make Decision Base Table for Login Screen
Let's create a decision table for a login screen.
The condition is simple if the user provides correct username and password the user will be
redirected to the homepage. If any of the input is wrong, an error message will be displayed.
• T – Correct username/password
• F – Wrong username/password
• E – Error message is displayed
• H – Home screen is displayed
Interpretation:
• Case 1 – Username and password both were wrong. The user is shown an error message.
• Case 2 – Username was correct, but the password was wrong. The user is shown an error
message.
• Case 3 – Username was wrong, but the password was correct. The user is shown an error
message.
• Case 4 – Username and password both were correct, and the user navigated to homepage
Example 2: How to make Decision Table for Upload Screen
Now consider a dialogue box which will ask the user to upload photo with certain conditions like
–
1. You can upload only '.jpg' format image
2. file size less than 32kb
3. resolution 137*177.
Input Class:
format: [.jpg, Not .jpg]
Size: [less than 32kb, >=32kb,]
resolution: [137*177, Not 137*177]
If any of the conditions fails the system will throw corresponding error message stating the issue
and if all conditions are met photo will be updated successfully
For this condition, we can create 8 different test cases and ensure complete coverage based on the
above table.
1. Upload a photo with format '.jpg', size less than 32kb and resolution 137*177 and click on
upload. Expected result is Photo should upload successfully
2. Upload a photo with format '.jpg', size less than 32kb and resolution not 137*177 and click
on upload. Expected result is Error message resolution mismatch should be displayed
3. Upload a photo with format '.jpg', size more than 32kb and resolution 137*177 and click
on upload. Expected result is Error message size mismatch should be displayed
4. Upload a photo with format '.jpg', size more than equal to 32kb and resolution not 137*177
and click on upload. Expected result is Error message size and resolution mismatch should
be displayed
5. Upload a photo with format other than '.jpg', size less than 32kb and resolution 137*177
and click on upload. Expected result is Error message for format mismatch should be
displayed
6. Upload a photo with format other than '.jpg', size less than 32kb and resolution not 137*177
and click on upload. Expected result is Error message format and resolution mismatch
should be displayed
7. Upload a photo with format other than '.jpg', size more than 32kb and resolution 137*177
and click on upload. Expected result is Error message for format and size mismatch should
be displayed
8. Upload a photo with format other than '.jpg', size more than 32kb and resolution not
137*177 and click on upload. Expected result is Error message for format, size and
resolution mismatch should be displayed
Example 3:
Create a decision table of following case. A software engineering company is having
reorganization. Current staff will be assigned to new positions according to the following criteria
i. Staff over 30 years of age with either a degree in computing or five years programming
experience are assigned to team leader
ii. Staffs over 30 years of age have both a degree in computing and five years experiences
are assigned to be analyst.
iii. Staff aged with 30 or less with either a degree in computing or five years’ experience in
programming are assigned to be programmers
iv. Staff aged with 30 or less with both degree in computing or five years’ experience in
programming are assigned to be senior programmers
v. All other staff remains in current position
Solution:
Conditions: Actions:
C1: age>30 A1: Team Leader
C2: degree in computing A2: Analyst
C3: five-year programming experience A3: Programmer
A4 Senior Programmer
A5: Remain in current position
Conditions/Actions R1 R2 R3 R4 R5 R6 R7 R8
C1: age>30 F F F F T T T T
C2: degree in computing F F T T F F T T
C3: five-year programming F T F T F T F T
experience
A1: Team Leader x x
A2: Analyst x
A3: Programmer x x
A4 Senior Programmer x
A5: Remain in current position x x