Open In App

Black box testing – Software Engineering

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

Black box testing is a testing technique in which the internal workings of the software are not known to the tester. The tester only focuses on the input and output of the software. 

Prerequisite - Software Testing | Basics 

What is Black Box Testing?

Black-box testing is a type of software testing in which the tester is not concerned with the internal knowledge or implementation details of the software but rather focuses on validating the functionality based on the provided specifications or requirements.

Black-box-testing

Black Box Testing

Types Of Black Box Testing

The following are the several categories of black box testing: 

  1. Functional Testing 
  2. Regression Testing
  3. Nonfunctional Testing (NFT) 

Functional Testing:

Functional testing is defined as a type of testing that verifies that each function of the software application works in conformance with the requirement and specification. This testing is not concerned with the source code of the application. Each functionality of the software application is tested by providing appropriate test input, expecting the output, and comparing the actual output with the expected output. This testing focuses on checking the user interface, APIs, database, security, client or server application, and functionality of the Application Under Test. Functional testing can be manual or automated. It determines the system’s software functional requirements.

Regression Testing:

Regression Testing is the process of testing the modified parts of the code and the parts that might get affected due to the modifications to ensure that no new errors have been introduced in the software after the modifications have been made. Regression means the return of something and in the software field, it refers to the return of a bug. 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:

Non-functional testing is a software testing technique that checks the non-functional attributes of the system. Non-functional testing is defined as a type of software testing to check non-functional aspects of a software application. It is designed to test the readiness of a system as per nonfunctional parameters which are never addressed by functional testing. Non-functional testing is as important as functional testing. Non-functional testing is also known as NFT. This testing is not functional testing of software. It focuses on the software’s performance, usability, and scalability.

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 to find 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.

Black Box and White Box Testing

Black box testing is a testing technique in which the internal workings of the software are not known to the tester. The tester only focuses on the input and output of the software. Whereas, White box testing is a testing technique in which the tester has knowledge of the internal workings of the software, and can test individual code snippets, algorithms and methods.

  • Testing objectives: Black box testing is mainly focused on testing the functionality of the software, ensuring that it meets the requirements and specifications. White box testing is mainly focused on ensuring that the internal code of the software is correct and efficient.
  • Knowledge level: Black box testing does not require any knowledge of the internal workings of the software, and can be performed by testers who are not familiar with programming languages. White box testing requires knowledge of programming languages, software architecture and design patterns.
  • Testing methods: Black box testing uses methods like equivalence partitioning, boundary value analysis, and error guessing to create test cases. Whereas, white box testing uses methods like control flow testing, data flow testing and statement coverage.
  • Scope: Black box testing is generally used for testing the software at the functional level. White box testing is used for testing the software at the unit level, integration level and system level.

Grey Box Testing

Gray Box Testing is a software testing technique that is a combination of the Black Box Testing technique and the White Box Testing technique.

  1. In the Black Box Testing technique, the tester is unaware of the internal structure of the item being tested and in White Box Testing the internal structure is known to the tester.
  2. The internal structure is partially known in Gray Box Testing.
  3. This includes access to internal data structures and algorithms to design the test cases. 
  4. Gray Box Testing is named so because the software program is like a semitransparent or gray box inside which the tester can partially see.
  5. It commonly focuses on context-specific errors related to web systems.

Objectives of Gray Box Testing

  • To provide combined advantages of both black box testing and white box testing.
  • To combine the input of developers as well as testers.
  • To improve overall product quality.

Ways of Black Box Testing Done

1. Syntax-Driven Testing – This type of testing is applied to systems that can be syntactically represented by some language. For example, language can be represented by 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:

  1. 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.
  2. 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 entire 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:

  1. Identify inputs (causes) and outputs (effect).
  2. Develop a cause-effect graph.
  3. Transform the graph into a decision table.
  4. 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 results 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:

  1. Processor (Pentium 3, Pentium 4) and several processors.
  2. Architecture and characteristics of machine (32-bit or 64-bit).
  3. Back-end components such as database servers.
  4. Operating System (Windows, Linux, etc).

Tools Used for Black Box Testing:

  1. Appium
  2. Selenium
  3. Microsoft Coded UI
  4. Applitools
  5. HP QTP.

What can be identified by Black Box Testing

  1. Discovers missing functions, incorrect function & interface errors
  2. Discover the errors faced in accessing the database
  3. Discovers the errors that occur while initiating & terminating any functions.
  4. Discovers the errors in performance or behaviour of software.

 Features of black box testing

  1. Independent testing: Black box testing is performed by testers who are not involved in the development of the application, which helps to ensure that testing is unbiased and impartial.
  2. Testing from a user’s perspective: Black box testing is conducted from the perspective of an end user, which helps to ensure that the application meets user requirements and is easy to use.
  3. No knowledge of internal code: Testers performing black box testing do not have access to the application’s internal code, which allows them to focus on testing the application’s external behaviour and functionality.
  4. Requirements-based testing: Black box testing is typically based on the application’s requirements, which helps to ensure that the application meets the required specifications.
  5. Different testing techniques: Black box testing can be performed using various testing techniques, such as functional testing, usability testing, acceptance testing, and regression testing.
  6. Easy to automate: Black box testing is easy to automate using various automation tools, which helps to reduce the overall testing time and effort.
  7. Scalability: Black box testing can be scaled up or down depending on the size and complexity of the application being tested.
  8. Limited knowledge of application: Testers performing black box testing have limited knowledge of the application being tested, which helps to ensure that testing is more representative of how the end users will interact with the application.



Last Updated : 14 Mar, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads