Black Box Testing
Black Box Testing
Decision table testing is a software testing technique used to test system behavior for
different input combinations. This is a systematic approach where the different input
combinations and their corresponding system behavior (Output) are captured in a
tabular form. That is why it is also called as a Cause-Effect table where Cause and
effects are captured for better test coverage.
A Decision Table is a tabular representation of inputs versus rules/cases/test
conditions. It is a very effective tool used for both complex software testing and
requirements management. A decision table helps to check all possible combinations of
conditions for testing and testers can also identify missed conditions easily. The
conditions are indicated as True(T) and False(F) values.
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 the 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.
Conditions Rule 1 Rule 2 Rule 3 Rule 4
Username (T/F) F T F T
Password (T/F) F F T T
Output (E/H) E E E H
Legend:
● 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
the homepage
While converting this to a test case, we can create 2 scenarios,
● Enter the correct username and correct password and click on login, and the
expected result will be the user should be navigated to the homepage
And one from the below scenario
● Enter wrong username and wrong password and click on login, and the expected
result will be the user should get an error message
● Enter correct username and wrong password and click on login, and the
expected result will be the user should get an error message
● Enter wrong username and correct password and click on login, and the
expected result will be the user should get an error message
As they essentially test the same rule.
Example 2: How to make Decision Table for Upload Screen
Now consider a dialogue box that will ask the user to upload a photo with certain
conditions like –
1. You can upload only ‘.jpg’ format image
2. file size less than 32kb
3. resolution 137*177.
If any of the conditions fails the system will throw a corresponding error message stating
the issue and if all conditions are met photo will be updated successfully
There is a text box in an application which can accept only numbers. Entering values up
to 99999 will be acceptable by the system and any other values apart from this should
not be acceptable. To do positive testing, set the valid input values from 0 to 99999 and
check whether the system is accepting the values.
Negative Testing
RTM is a document that confirms the requirements defined for a system
are linked correctly during the verification process. It helps the testing team
understand the testing level done for a given product. The traceability
process is used to review the test cases defined for any requirement.
Each column corresponds to a rule which will become a test case for testing. So there
will be 4 test cases.
Notations Used:
Now let’s try to implement this technique with some examples:
Situation:
The “Print message” is software that reads two characters and, depending on their
values, messages is printed.
Solution:
C1 – First character is A
C2 – First character is B
LET’S START!!
First, draw the Causes and Effects as shown below:
Key – Always go from Effect to Cause (left to right). That means, to get effect “E”,
what causes should be true.
– The first character can either be “A” or “B” and cannot be both.
– C1 and C2 cannot be true together. This means C1 and C2 are mutually exclusive.
Now let’s draw this:
So as per the above diagram, for E1 to be true the condition is (C1 C2) C3
The circle in the middle is just an interpretation of the middle point to make the graph
less messy.
There is a third condition where C1 and C2 are mutually exclusive. So the final graph for
effect E1 to be true is shown below:
Let’s move to Effect E2:
E2 states print message “X”. Message X will be printed when the First character is
neither A nor B.
This means Effect E2 will hold true when either C1 OR C2 is invalid. So the graph for
Effect E2 is shown as (In blue line)
E3 states print message “Y”. Message Y will be printed when the Second character is
incorrect.
This means Effect E3 will hold true when C3 is invalid. So the graph for Effect E3 is
shown as (In Green line)
This completes the Cause and Effect graph for the above situation.
Now let’s move to draw the Decision table based on the above graph.
First, write down the Causes and Effects in a single column shown below
The Key is the same. Go from bottom to top which means traverse from Effect to
Cause.
Start with Effect E1. For E1 to be true, the condition is (C1 C2) C3.
So it is completed. Let’s complete the graph by adding 0 in the blank column and
include the test case identifier.
Writing Test Cases From The Decision Table
Below is a sample test case for Test Case 1 (TC1) and Test Case 2 (TC2).