Black Box Testing
Black Box Testing
Black box testing is also known as opaque technique, behavioral testing, functional testing, and closed-box
testing is a type of software testing.
When we enter a topic to search on the search engine, we type out the topic and enter search.
The result is obtained thereafter without looking at the internal structure or working. This is an appropriate
example of black-box testing.
The steps for carrying out Black Box Testing are as follows:
At first, the application to be tested is studied to find out the requirements and specifications. The SRS
(Software Requirement Specification) document should be maintained with accuracy.
The inputs and test scenarios are evaluated. Efficient and time-saving techniques are incorporated.
Test cases are generated. These test cases are made in such a way that the input range is maximum.
The test cases are then processed to obtain the output. The generated output is compared with the expected
output to understand the success of the result.
If there are unsuccessful steps, they are sent to the software development teams for fixing.
The defects are fixed.
Run the tests again for confirmation.
2. Non-functional Testing
If Black box testing is used to test more aspects other than functionalities and features it comes under the
umbrella of non-functional testing. Non-functional testing revolves around examining how well the system
does a job.
This can testify whether or not the software is:
Capable of working when the load is maximum
Compatible to work with different devices
Easy to use
3. Regression Testing
Regression testing helps to find if the new codes have had any ill effects on the already existing ones.
Regression testing is basically selecting complete or parts of test cases that had already been executed to
make sure that the functionalities do have any abnormalities.
In easy words, it tests to make sure that the new codes do not have side effects on the old codes. The
different regression testing tools are Selenium, Quick Test Professional or QTP, Rational Functional Tester.
So these extreme ends like Start- End, Lower- Upper, Maximum-Minimum, Just Inside-Just Outside
values are called boundary values and the testing is called “boundary testing”.
The basic idea in normal boundary value testing is to select input variable values at their:
1. Minimum
2. Just above the minimum
3. A nominal value
4. Just below the maximum
5. Maximum
It divides the input data of software into different equivalence data classes.
You can apply this technique, where there is a range in the input field.
Submit
Order Pizza:
Here is the test condition
1. Any Number greater than 10 entered in the Order Pizza field(let say 11) is considered invalid.
2. Any Number less than 1 that is 0 or below, then it is considered invalid.
3. Numbers 1 to 10 are considered valid
4. Any 3 Digit Number say -100 is invalid.
We cannot test all the possible values because if done, the number of test cases will be more than 100. To address
this problem, we use equivalence partitioning hypothesis where we divide the possible values of tickets into
groups or sets as shown below where the system behavior can be considered the same.
The divided sets are called Equivalence Partitions or Equivalence Classes. Then we pick only one value from
each partition for testing. The hypothesis behind this technique is that if one condition/value in a partition
passes all others will also pass. Likewise, if one condition in a partition fails, all other conditions in that
partition will fail.
Boundary Value Analysis– in Boundary Value Analysis, you test boundaries between equivalence partitions
In our earlier equivalence partitioning example, instead of checking one value for each partition, you will check
the values at the partitions like 0, 1, 10, 11 and so on. As you may observe, you test values at both valid and
invalid boundaries. Boundary Value Analysis is also called range checking.
Equivalence partitioning and boundary value analysis(BVA) are closely related and can be used together at all
levels of testing.
Example 2: Equivalence and Boundary Value
Following password field accepts minimum 6 characters and maximum 10 characters
That means results for values in partitions 0-5, 6-10, 11-14 should be equivalent
Submit
Enter Password:
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.
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.
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
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
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
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
In this case, decision table testing is a good option. This technique can make sure of good coverage, and the
representation is simple so that it is easy to interpret and use.
This table can be used as the reference for the requirement and for functionality development since it is easy to
understand and cover all the combinations.
The significance of this technique becomes immediately clear as the number of inputs increases. Number of
possible Combinations is given by 2 ^ n , where n is the number of Inputs. For n = 10, which is very common in
the web-based testing, having big input forms, the number of combinations will be 1024. Obviously, you cannot
test all but you will choose a rich sub-set of the possible combinations using decision based testing technique.
State Transition Testing Technique is helpful where you need to test different system transitions.
4) Actions that result from a transition (an error message or being given the cash.)
State Transition Diagram and State Transition Table
There are two main ways to represent or design state transition, State transition diagram, and state transition table.
In state transition diagram the states are shown in boxed texts, and the transition is represented by arrows. It is
also called State Chart or Graph. It is useful in identifying valid transitions.
In state transition table all the states are listed on the left side, and the events are described on the top. Each cell in
the table represents the state of the system after the event has occurred. It is also called State Table. It is useful in
identifying invalid transitions.
In this system, if the user enters a valid password in any of the first three attempts the user will be logged in
successfully. If the user enters the invalid password in the first or second try, the user will be asked to re-enter the
password. And finally, if the user enters incorrect password 3 rd time, the account will be blocked.
In the diagram whenever the user enters the correct PIN he is moved to Access granted state, and if he enters the
wrong password he is moved to next try and if he does the same for the 3 rd time the account blocked state is
reached.
State Transition Table
Correct PIN Incorrect PIN
S1) Start S5 S2
S2) 1st attempt S5 S3
S3) 2 attempt
nd
S5 S4
S4) 3 attempt
rd
S5 S6
S5) Access Granted – –
S6) Account blocked – –
In the table when the user enters the correct PIN, state is transitioned to S5 which is Access granted. And if the
user enters a wrong password he is moved to next state. If he does the same 3 rd time, he will reach the account
blocked state.
Example 2:
In the flight reservation login screen, consider you have to enter correct agent name and password to access the
flight reservation application.
The application allows three attempts, and if users enter the wrong password at 4th attempt, the system closes the
application automatically.
The State Graphs helps you determine valid transitions to be tested. In this case, testing with the correct password
and with an incorrect password is compulsory. For the test scenarios, log-in on 2 nd, 3rd and 4th attempt anyone could
be tested.
Each cell represents the state system will move to when the corresponding event occurs.
For example, while in S1 state you enter a correct password you are taken to state S6 (Access Granted). Suppose
if you have entered the wrong password at first attempt you will be taken to state S3 or 2nd Try.
Two invalid states are highlighted using this method. Suppose you are in state S6 that is you are already logged
into the application, and you open another instance of flight reservation and enter valid or invalid passwords for
the same agent. System response for such a scenario needs to be tested.
checks boundaries for input values. Path coverage method tests all the
paths of the program.
Automated test cases can become
Update to automation test script is essential if you
Drawbacks useless if the code base is rapidly
to modify application frequently.
changing.