Black Box Testing in Software Engineering

Black Box Testing

  • Black box testing is also called “Behavioral Testing, opaque-box, closed-box, specification-based or eye-to-eye testing”.
  • In the black box testing, testers only tests the functionality or working of the software product. Testers don’t know about the interior structure of the code and internal path of the system.
  • Testers only select a function and give the inputs and check outputs corresponding to the inputs  of the system.
  • Tester gives valid and invalid inputs & determines the correct expected results. All the test cases are designed based on the  requirements & specifications document.
  • Testers does not aware of how the program gets the output and what application does with the entered data. Testers only checks the behavior or functionality of the system.
  • Hence this is the reason why black box testing is also called behavioral testing.

This testing is used to find errors in the following types :

  • Related to incorrect or missing functions
  • Data structures errors
  • Error in external database access
  • Functionality errors
  • Initialization and termination errors

 

Black Box Testing

Steps of Black box testing :

  1. At beginning, the requirements and specifications are examined.
  2. Testers creates a positive test scenario and negative test scenario by choosing valid and invalid inputs to ensure that software is working correctly or not.
  3. At this step, tester develops the various test cases.
  4. Test cases are executed in the fourth step.
  5. Tester compares the output with the expected output.
  6. In the final step, if there is any error then fix the bugs and then tested again.

Types of Black box testing :-

There are mainly three type of black box testing –

Functional Testing :

In this type of black box testing, the several functions of the system are tested by giving the inputs and checks the expected outputs corresponding to the inputs.Functional testing is a testing which is related to the functional requirements or specification of the program so that the testing is known as functional testing. This testing is done by software testers.

some functional testing are-

  • Smoke Testing
  • Sanity Testing
  • Integration Testing
  • System Testing
  • Regression Testing
  • User Acceptance Testing

Non-functional Testing :

Non-functional testing is a type of black box testing in which performance, quality, scalability, usability are tested. This testing is not related to the functionality or working of the program. This testing tests how long program takes time for a function to to give response to user and how fast a function process inputs and produce outputs. Non-functional testing focuses on the system performance and improving the quality.

Some non-functional testing are-

  • Usability Testing
  • Load Testing
  • Performance Testing
  • Compatibility Testing
  • Stress Testing
  • Scalability Testing

Regression Testing :

Regression testing is a black box testing which is used to check the modified code or program has not altered the functionality of the existing program. This testing is done after fixing the bugs. This testing is mainly used for system maintenance.    

Techniques of Black box testing :

There are some techniques which is used for black box testing-

1. Equivalence Class Partitioning :

The concept of equivalence partitioning technique comes from equivalence class which in turn comes from equivalence relation. Equivalence class partitioning is a technique of software black box testing in which input data is divided into partitions of equivalent data that is valid and invalid values. This strategy is used to minimize the number of possible test cases while maintains reasonable test coverage.

Steps involves in this technique are:

  • Divide any input domain into two sets that is valid values and invalid values.
  • Test cases are developed :

    a.  Assign unique identification number to each valid and invalid class of input.
    b.  Write the test cases i.e. valid and invalid test cases.

2. Boundary Value Analysis:

Boundaries are the values near the range where the behavior of the system alters. As name defines, this technique focused on the boundaries because there is a higher chances of errors. So that if test cases are designed at the boundaries then the probability of finding errors increased. Boundary value analysis is a software testing technique in which test cases are designed at the boundaries and just below or above of the boundaries. In boundary value analysis strategy, the valid inputs and invalid inputs are being tested to verify the software. It only checks that the software is producing correct output or not.

For example- If we test a field and the range of the field is 1 to 100 then we select the boundary values: 0, 1, 2, 99, 100 and 101 instead of choosing all the values.

3. Cause Effect Graph :

 

Cause-effect graph is a software testing technique that involves specifying the causes (input conditions) and effects (output conditions) and producing a Cause-Effect Graph, and designed test cases. Causes are the input conditions and effects are the output conditions. The causes and effects are represented using Boolean graphs. 

steps involved in this technique are :

  1. Specify causes and effects.
  2.  Produce the cause effect graph.
  3. Convert the cause-effect graph into decision table.
  4. Convert decision table rules into the test cases.

4. Decision Table Testing :

Decision table testing is a software testing technique in which various input combinations and their system behavior are represented in a tabular form. A decision table places the causes (input conditions) and effects (output conditions) in a matrix. Each column represents unique combination.

As the name describes that, there are logical relationships like :

if(Condition = True)
{

then action 1 ;
}
else

{

action 2;

}

Then a tester will identify two outputs for two conditions so based on the probable scenarios a Decision table is created to design the test cases.

Advantages of Black Box testing :

  • The tester need not have a technical background. Tests are done from a user’s point of view.
  • Tester need not to know about the technical and specific programming languages.
  • Test cases can be developed when the requirements and specifications are complete.
  • Testing can be started when the project is developed.
  • This technique is more effective for large and complex projects.

Disadvantages of Black Box Testing :

  • Test cases will be difficult to design if requirements and specifications are not clear.
  • If the tester have no technical or programming knowledge, there are higher chances of ignoring possible conditions to be tested.
  • If the project is very large and complex then it is difficult to design the test cases.
  • Testing every input condition is impossible because it would take time and cost.