Software Engineering | Black box testing
Black box testing is a type of software testing in which the functionality of the software is not known. The testing is done without the internal knowledge of the products.
Prerequisite - Software Testing | Basics
Black box testing can be done in the following ways:
1. Syntax-Driven Testing – This type of testing is applied to systems that can be syntactically represented by some language. For example- compilers, language that can be represented by a context-free grammar. In this, the test cases are generated so that each grammar rule is used at least once.
2. Equivalence partitioning – It is often seen that many types of inputs work similarly so instead of giving all of them separately we can group them and test only one input of each group. The idea is to partition the input domain of the system into several equivalence classes such that each member of the class works similarly, i.e., if a test case in one class results in some error, other members of the class would also result in the same error.
The technique involves two steps:
- Identification of equivalence class – Partition any input domain into a minimum of two sets: valid values and invalid values. For example, if the valid range is 0 to 100 then select one valid input like 49 and one invalid like 104.
- Generating test cases – (i) To each valid and invalid class of input assign a unique identification number. (ii) Write a test case covering all valid and invalid test cases considering that no two invalid inputs mask each other. To calculate the square root of a number, the equivalence classes will be: (a) Valid inputs:
- The whole number which is a perfect square- output will be an integer.
- The whole number which is not a perfect square- output will be a decimal number.
- Positive decimals
- Negative numbers(integer or decimal).
- Characters other than numbers like “a”,”!”,”;”, etc.
3. Boundary value analysis – Boundaries are very good places for errors to occur. Hence if test cases are designed for boundary values of the input domain then the efficiency of testing improves and the probability of finding errors also increases. For example – If the valid range is 10 to 100 then test for 10,100 also apart from valid and invalid inputs.
4. Cause effect Graphing – This technique establishes a relationship between logical input called causes with corresponding actions called the effect. The causes and effects are represented using Boolean graphs. The following steps are followed:
- Identify inputs (causes) and outputs (effect).
- Develop a cause-effect graph.
- Transform the graph into a decision table.
- Convert decision table rules to test cases.
For example, in the following cause-effect graph:
It can be converted into a decision table like:
Each column corresponds to a rule which will become a test case for testing. So there will be 4 test cases.
5. Requirement-based testing – It includes validating the requirements given in the SRS of a software system.
6. Compatibility testing – The test case result not only depends on the product but is also on the infrastructure for delivering functionality. When the infrastructure parameters are changed it is still expected to work properly. Some parameters that generally affect the compatibility of software are:
- Processor (Pentium 3, Pentium 4) and several processors.
- Architecture and characteristics of machine (32-bit or 64-bit).
- Back-end components such as database servers.
- Operating System (Windows, Linux, etc).
Black Box Testing Type
The following are the several categories of black box testing:
- Functional Testing
- Regression Testing
- Nonfunctional Testing (NFT)
Functional Testing: It determines the system’s software functional requirements.
Regression Testing: It ensures that the newly added code is compatible with the existing code. In other words, a new software update has no impact on the functionality of the software. This is carried out after a system maintenance operation and upgrades.
Nonfunctional Testing: Nonfunctional testing is also known as NFT. This testing is not functional testing of software. It focuses on the software’s performance, usability, and scalability.
Tools Used for Black Box Testing:
- Microsoft Coded UI
- HP QTP.
Advantages of Black Box Testing:
- The tester does not need to have more functional knowledge or programming skills to implement the Black Box Testing.
- It is efficient for implementing the tests in the larger system.
- Tests are executed from the user’s or client’s point of view.
- Test cases are easily reproducible.
- It is used in finding the ambiguity and contradictions in the functional specifications.
Disadvantages of Black Box Testing:
- There is a possibility of repeating the same tests while implementing the testing process.
- Without clear functional specifications, test cases are difficult to implement.
- It is difficult to execute the test cases because of complex inputs at different stages of testing.
- Sometimes, the reason for the test failure cannot be detected.
- Some programs in the application are not tested.
- It does not reveal the errors in the control structure.
- Working with a large sample space of inputs can be exhaustive and consumes a lot of time.
Please Login to comment...