Black Box Testing

Learn via video courses
Topics Covered

Overview

The black box testing technique focuses on writing test cases only concerned with getting expected output based on the input test data. The black box denotes that a tester has no idea about the code written in the program. If he gets the expected output, the code would be working; else, test case failure is noted.

What is Black Box Testing?

A black box signifies an object where one has no idea what is inside it. Black box testing methodology is also based on it, and where a tester writes test cases not considering how the code works but rather the functionality, he wants to test. For example, a tester wants to test the authentication system of a website. The tester tries with the wrong credentials and the correct credentials. If he is getting the correct response from the API. The authentication functionality is working correctly.

Black Box Testing Techniques

  • Equivalence Class Testing: We all know that we can't provide every input test data. Hence, test data are divided into sub-categories where one test data from each represent the given scenario.

equivalence-class-testing

  • Boundary Value Testing: When test case input data is at the edges of a condition. For example, we want to test a login form functionality where the password should be between 8 to 13 characters. Test data input for passwords with 7 characters, 8 characters, and 13 characters would be at the edge-changing interval.

boundary-value-testing

  • Decision Table Testing: Decision table testing ensures all possible combinations of test case scenarios are covered, i.e. when both username and password are correct, when either of them is correct, and when none is correct. decision-table-testing

  • State Transition Testing: Here, we write test cases when the state/ condition in the code is changing. For instance, if you are trying to provide a pin in UPI application like GPay, you are granted three attempts, and on the 4th attempt, the application locks down. Test cases would look like the below:

state-transition-testing

state-transition-testing2

  • Orthogonal Array Testing: OAT is a quantitative approach when input test data is huge. It helps to maximize test coverage by pairing test case scenarios. For example, there are three sections in a webpage-top, middle, and bottom. And each has an option for text to be shown or hidden. Total test cases normally would be 3x2=6. But if we use OAT pairwise testing, then, orthogonal-array-testing Runs (N) – Number of rows in the array ie. number of test cases Factors (K) – Number of columns in the array, i.e., number of variables Levels (V) – Maximum number of values that an individual variable can take in

No of Factors = 3 (Top, Middle, Bottom)
No of Levels (Visibility) = 2 (Hidden or Shown)
Array Type = L4(23)

Types of Black Box Testing

There are different types of black box testing, including functional testing, non-functional testing, and regression testing described as follows:

1. Functional Testing

Functional testing is a type of black box testing that aims to ensure the software's functionality aligns with the specified requirements. It focuses on testing the individual functions, features, and behaviors of the system. This type of testing verifies that the software performs the intended tasks accurately, produces the expected outputs, and handles different inputs appropriately.

2. Non-Functional Testing

Non-functional testing examines the non-functional aspects of the software, such as performance, scalability, usability, security, and reliability. Unlike functional testing, which focuses on what the system does, non-functional testing assesses how well the system performs. This type of testing helps ensure that the software meets the user's expectations in terms of responsiveness, efficiency, accessibility, and other quality attributes.

3. Regression Testing

Regression testing is conducted to ensure that modifications or updates to the software do not introduce new defects or negatively impact existing functionality. It involves retesting the previously tested features and functions to ensure they still operate correctly after changes have been made. Regression testing can include both functional and non-functional aspects, ensuring that the software remains stable and reliable throughout its development lifecycle.

How to Do BlackBox Testing?

  • Requirements listed by the clients are understood. The exact functionalities he wants are noted.
  • Test Cycle is planned from tools selection, test case execution, and bug reporting.
  • Testing phase is planned. Which is the combination of both automated and manual test cases.
  • Black box testing is all about running test cases by validating the output.
  • If the expected output matches, the test case is passed else, the test case is failed.
  • Failed test cases are reported as bugs and go through a bug cycle.

Advantages of Black Box Testing

  1. Black box testing technique requires less knowledge of coding.
  2. Black box testing is much faster than white box testing.
  3. Black box testing allows random and exploratory testing as mostly manual testing is involved.

Disadvantages of Black Box Testing

  1. Writing automated test cases is impossible with the black box technique.
  2. In the black box, since code is not getting tested, one might not be able to find excess code or code of higher time and space complexity.
  3. Integration and data flow testing cannot be done in black box testing.

Conclusion

  1. Black box testing technique tests the functionality of the application based on the output. If the output is correct, the test case is passed, but a bug is reported if the expected output doesn't match the output obtained.
  2. Black box testing is faster than white box testing and requires less coding knowledge. Black box testing is mostly manual.
  3. Equivalence class partitioning, Boundary Value Analysis, and Decision Table testing are all black box testing techniques.
  4. Black box testing won't be able to tell any faulty code in the program as the code structure is not checked here.

See More