Table of Contents
All the testing techniques are broadly put into two categories. The first category is the White box set of techniques which check inside the internal architecture of the product and its building blocks. And the second category is the Black box set of techniques which consider the input and output of the product and do not check the internal processing of it. In this article, we will learn about this second type of technique in detail.
In back box testing, the tester views the product as a black box which processes the input to produce an output. Because the product is a black box, the internals of the product is not visible while testing. The black box testing applicable to both functional and nonfunctional testing. Examples of black box testing are system testing, regression, performance, and user acceptance testing.
Definition of Black box testing
Black box testing is the testing method of input and output of the application under test without considering its internal processing.
This testing focusses on the behavior of the system with various types of inputs without bothering about its internal architecture, implementation and data path. Therefore, black box testing is also known as behavioral testing.
Black box testing Characteristics
Some of the important characteristics of black box testing are:
- Requirements, specifications, use cases, and user stories form the basis for test scenarios and conditions.
- Test cases focus to identify the gap between requirements which form expected output and the actual output.
- The test coverage measures the functionalities or test items covered during testing.
Black box testing example
Suppose there is an online shopping e-commerce website. The functional testing of this website is an example of the black box testing technique. As a thumb rule, the tests do not bother about how the website works internally, which technology it is built on or how the web server works. In this testing method, tester only provides inputs to the website and verifies the output against the requirements. Some of the tests can be:
|1.||Create a user login. Login into the website and create the complete profile of the user.|
|2.||Log in to the website with valid user credentials and select an item. Goto the cart and do the checkout while making the payment.|
|3.||Log in to the website with valid user credentials and search for an item which is not available. Verify the error message.|
Black box testing techniques
Following are the techniques of Black box testing:
This method divides input data in such a way that each group gets processed in the same way. As a rule, there should be there is a partition for valid and invalid data sets both. The tests should cover all partitions to cover the functionality of the product properly.
For instance, a printer accepts the number of copies from 1 to 100. If the input is less than 1 or more than 100, it shows an error. So the equivalence partition for this use case is:
Invalid Inputs: 0 and 105
Valid Input: 50
Boundary value analysis:
In this technique, boundary input conditions are considered for testing. Boundary conditions quite often call for the switch in the code logic. Therefore, edge inputs are prone to defects. Hence this technique helps to cover these borderline inputs for testing.
Considering the example of the printer which accepts the number of copies from 1 to 100 from equivalence partitioning, boundary value inputs are
input set 1: 0,1,2
input set 2: 99,100,101
Decision table testing:
This technique comes into picture when there are complex business rules dictating the processing of the input. In this method, a table is created which shows all the inputs, business rules, and corresponding outputs.
For instance, to understand the decision table, consider the example of a simple login page which has 2 inputs user id and password and depending on these inputs output or error is shown:
N: invalid input
Y: valid input
X: identifies the output
State transition testing:
State transitioning testing method traces the changes in the state of the application under test based on the inputs and conditions. The state transition testing incorporates testing of transition in the state and state sequences of the application as per the events. It is suitable for smaller applications with finite inputs and states.
For instance, consider search item functionality of an online e-commerce website.
- User searches for an item. If found system lists it. Else system shows an error.
- User searches the item again and if found system lists it. Otherwise shows an error.
- User clicks on Catalogue and hence the system shows Catalogue menu. Or else, in case of issues shows an error message.
Use case testing:
In this technique, test scenarios are derived from use cases. Use cases are the user requirements in their own language. Moreover, they include exceptional and error behavior as well. Hence, this technique makes use of these use cases to derive the test scenarios. It’s an effective way of testing the system from its requirements or specifications.
- Testers do not need coding and internal architecture knowledge.
- Tests do not have the complexity of verifying the product internally. Hence, are simple to design and easy to execute.
- This is an effective way of testing an application from the user’s perspective.
- Test scenarios can be written early when requirement specifications are available.
- Testing the team can work independently from the development team and record their observations.
- The best way to test an application is to test it using the black box and white box techniques both. In other words, black box testing techniques alone are not sufficient to test the application properly.
- It becomes difficult when the project has volatile requirements.
- The code coverage can remain low while following black box testing techniques.
Black box testing help improve the quality of the product by detecting functional and non-functional defects. Because it is not possible to cover each and every possible form of input, the black box testing techniques help in improving overall testing coverage. Although this method of testing does not require programming knowledge from the tester, one should have good functional knowledge of the product and domain for effective testing.