Black-box testing is a ‘software testing technique’ used to examine the functionality of the software instead of bothering about the ‘internal structure’ of the software. It is also termed as behavioral testing as it examines the behavior of the software.
Black box testing analyzes different categories of errors by testing all the functions of the software. In this section, we will study more about black-box testing, its method of testing, its techniques along with its advantages and disadvantages.
Content: Black-Box Testing in Software Engineering
- What is Black Box Testing?
- How to Perform Black Box Testing?
- Example of Black Box Testing
- Techniques of Black Box Testing
- Advantages & Disadvantages
- Key Takeaways
What is the Black-Box Testing?
Black box testing is behavioural testing that is employed to test the functionality of the developed software without going into the control structure of the software. The testers derive all the possible input values for designing the test cases that would examine all the functions of the software.
Black box test is never considered as an alternative to ‘white box testing’ instead it is a complementary approach; as the white box testing examines the internal structure or the control structure of the software and black box test the functions of the software.
Let’s discuss what types of error are identified by the black-box test?
- As black box test functionality of the software, it will discover all the functions that are missing in the software and also the functions that are implemented incorrectly.
- It also uncovers the errors that come across while using the interface.
- It uncovers the errors faced in accessing the database.
- It discovers the errors that occur, while initiating any function or while terminating any function.
- It also uncovers the error in the performance or behaviour of the software.
The black box test is implemented at later stages of testing schedule as it is concerned only with the functional information of the software. While testing with the black box techniques the testers are able to answer the questions:
- What type of input values would lead to a good test case?
- How to test the validity of the functions of the software?
- How to examine the performance of the software?
- To what type of values, the software is perceptive?
- How the values to the input domain are bounded?
- What amount of data is can be accepted by the system?
How to Perform Black-Box Testing?
To perform the black-box test, testers have to perform the following steps:
- For testing any software, the tester must understand the requirements that were specified by the customer while allotting the project. So, the first step is to analyze the requirements and specifications of the software.
- After reviewing the requirements and specification testers have to select the set of valid input values that the system has to process and set of invalid input values that the system must detect as an error.
- The testers must also declare the desired output.
- The testers must now design test cases, execute them with the set of valid & invalid inputs and collect the generated output.
- Now, its time to compare the output generated by the system against the desired output.
- In case any error is detected, it is fixed and testing is performed again.
Example of Black-Box Testing
Let us understand the black-box test with the help of an example. Consider we have to perform the black box test on the word processor.
So, the black box test will examine whether the word processor is able to manage files. The test cases would include whether a word document can be created, it can be saved, it is able to open the already created documents, delete word document.
Another test case would be testing editing tools. Like, is it possible to find, select any word in the document? You can test whether you are able to change the font style and size in the document and so on.
While testing all this the tester does not have to bother about the control structure of the word processor. The tester must not be worried about how the functions in the word processor are implemented or how it is coded. Black-box testing has to examine whether all the functions, tools of the word processor are working properly or not.
Techniques of Black Box Testing
1. Graph-Based Testing Methods
In the graph-based testing initially, all the objects that have been modelled in the software are identified. Then the relationship between those objects is identified. Now, in the graph-based method, a graph is created which has nodes that represent the ‘objects’ and the link between the nodes are considered as the ‘relationship’ between the nodes.
Now, a series of test cases are identified and implemented on the graph which exercises all the object and every possible relationship between them to uncover the errors.
2. Equivalence Partitioning
This technique of black-box testing divides the input fields of the program into the categories. There can be many input values and exercising all values while testing becomes a lengthy process.
So, the input values are grouped and representative input from each group is tested. In this way, many inputs can be exercised at once.
3. Boundary Value Analysis
It is complementary to the equivalence partitioning. In the equivalence partitioning, a representative from each input domain is exercised but, in boundary value analysis the boundary values for each input domain is tested.
4. Orthogonal Array Testing
Sometimes, we have an application that requires minimum or limited inputs. In such cases, orthogonal array testing is implemented. As the input domains are limited it is feasible to test all the possible input values form each input domain.
Advantages & Disadvantages of Black Box Testing
- The tester does not need to have knowledge of programming languages.
- Testing is done from the users’ point of view, so it becomes easy to identify missing functions and function errors.
- Testers do not worry about the control structure of the software.
- Black box test does not uncover the errors of the control structure.
- As the representative values from each input domain are tested, it may be the case that some sensitive values are skipped or remain unchecked.
- As the testers having with programming language knowledge are allowed to test it may be the case that they skip some technical test case while testing.
- Black-box testing tests the functionality of the software.
- It has nothing to do with the internal structure of the software.
- It is also called behavioural testing.
- It is implemented in the last stages of testing.
- It is complementary to white box testing.
- It derives all possible inputs along with their desired outputs and develops the test cases. These test cases are then executed and then the generated outputs are tested against the desired output to uncover the errors.
- There are four black-box test techniques graph-based technique, equivalence partitioning, boundary value analysis and orthogonal array test.
So, this is all about the black box test which only tests the functional behaviour of the software and does not bother about the control structure of the software.