Black Box Testing: An In-depth Tutorial with Examples and Techniques

In this tutorial, using my industrial experience in software testing, let's familiarize with the types and techniques of black box testing along with its process, advantages, disadvantages and some automation tools to test it other than manual testing.

We will also learn about the differences between white box testing and black box testing. 

List of “Black Box Test Techniques” Tutorials:

Tutorial #1: What is Black Box Testing
Tutorial #2: What is White Box Testing
Tutorial #3: Functional Testing Simplified
Tutorial #4: What is Use Case Testing
Tutorial #5: Orthogonal Array Testing Technique

Techniques
Tutorial #6: Boundary Value Analysis and Equivalence Partitioning
Tutorial #7: Decision Table Testing
Tutorial #8: State Transition Testing
Tutorial #9Error Guessing
Tutorial #10: Graph-Based Testing Methods

Almost all of us perform black box testing every day! 

Whether we have learned or not, we all have and performed black box testing many times in our day to day life!!

Black box testing

From the name itself you can probably understand that it implicates interacting with the system, that you are testing as a mystery box. It means that you are not knowledgeable enough about the internal working of the system but you know how it should behave.

If we take an Example to test our car or bike, we always drive it to make sure that it doesn’t behave in an unusual way. See? We already have done black box testing.

What is Black Box Testing?

Black box testing, which is also known as behavioral, opaque-box, closed-box, specification-based or eye-to-eye testing, is a Software Testing method that analyses the functionality of a software/application without knowing much about the internal structure/design of the item that is being tested and compares the input value with the output value.

The main focus in black box testing is on the functionality of the system as a whole. The term ‘behavioral testing' is also used for black box testing. Behavioral test design is slightly different from the black-box test design because the use of internal knowledge isn't strictly forbidden, but it's still discouraged.

Each testing method has its own advantages and disadvantages. There are some bugs that cannot be found using the only black box or only white box technique. Majority of the applications are tested by black box method. We need to cover the majority of test cases so that most of the bugs will get discovered by a black-box method.

This testing occurs throughout the software development and Testing life cycle i.e in Unit, Integration, System, Acceptance, and regression testing stages.

This can be both functional or non-functional.

Black box testing

Types of Black Box Testing

Practically, there are several types of black box testing that are possible but if we consider the major variant of it then below mentioned are the two fundamental ones.

#1) Functional Testing

This type deals with the functional requirements or specifications of an application. Here, different actions or functions of the system are being tested by providing the input and comparing the actual output with the expected output.

For Example, when we test a Dropdown list, we click on it and verify that it expands and all the expected values are showing in the list.

Few major types of Functional Testing are:

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

=> Read More on Functional Testing.

#2) Non-Functional Testing

Apart from the functionalities of the requirements, there are several non-functional aspects as well that are required to be tested to improve the quality and performance of the application.

Few major types of Non-functional testing include:

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

=> Read More on Non-Functional Testing.

Black Box Testing Techniques

In order to systematically test a set of functions, it is necessary to design test cases. Testers can create test cases from the requirement specification document using the following black box testing techniques.

  • Equivalence Partitioning
  • Boundary Value Analysis
  • Decision Table Testing
  • State Transition Testing
  • Error Guessing
  • Graph-Based Testing Methods
  • Comparison Testing

Let us understand each technique in detail.

#1) Equivalence Partitioning:

This technique is also known as Equivalence Class Partitioning (ECP). In this technique, input values to the system or application are divided into different classes or groups based on its similarity in the outcome.

Hence, instead of using each and every input value we can now use any one value from the group/class to test the outcome. In this way, we can maintain the test coverage while we can reduce a lot of rework and most importantly the time spent.

For Example:

Equivalence Partitioning

As present in the above image, an “AGE” text field accepts only the numbers from 18 to 60. There will be three set of classes or groups.

Two invalid classes will be:

a) Less than or equal to 17.

b) Greater than or equal to 61.

One valid class will be anything between 18 to 60.

We have thus reduced the test cases to only 3 test cases based on the formed classes thereby covering all the possibilities. So, testing with anyone value from each set of the class is sufficient to test the above scenario.

=> Recommended Read – What is Equivalence Partitioning?

#2) Boundary Value Analysis:

From the name itself, we can understand that in this technique we focus on the values at boundaries as it is found that many applications have a high amount of issues on the boundaries.

Boundary means the values near the limit where the behavior of the system changes. In boundary value analysis both the valid inputs and invalid inputs are being tested to verify the issues.

For Example:

Boundary Value Analysis


If we want to test a field where values from 1 to 100 should be accepted then we choose the boundary values: 1-1, 1, 1+1, 100-1, 100, and 100+1. Instead of using all the values from 1 to 100, we just use 0, 1, 2, 99, 100, and 101.

#3) Decision Table Testing:

As the name itself suggests that, wherever there are logical relationships like:

If
{
(Condition = True)
then action1 ;
}
else action2; /*(condition = False)*/

Then a tester will identify two outputs (action1 and action2) for two conditions (True and False). So based on the probable scenarios a Decision table is carved to prepare a set of test cases.

For Example:

Take an example of XYZ bank that provides interest rate for the Male senior citizen as 10% and for rest of the people 9%.

Decision Table

In this example condition, C1 has two values as true and false, condition C2 also has two values as true and false. The number of total possible combinations would then be four. This way we can derive test cases using decision table.

#4) State Transition Testing:

State Transition Testing is a technique that is used to test the different states of the system under test. The state of the system changes depending upon the conditions or events. The events trigger states which become scenarios and a tester needs to test them.

A systematic state transition diagram gives a clear view of the state changes but it is effective for simpler applications. More complex projects may lead to more complex transition diagrams thus making it less effective.

For Example:

State Transition Testing

#5) Error Guessing:

This is a classic example of experience based testing.

In this technique, the tester can use his/her experience about the application behavior and functionalities to guess the error-prone areas. Many defects can be found using error guessing where most of the developers usually make mistakes.

Few common mistakes that  developers usually forget to handle:

  • Divide by zero.
  • Handling null values in text fields.
  • Accepting the Submit button without any value.
  • File upload without attachment.
  • File upload with less than or more than the limit size.

#6) Graph-Based Testing Methods:

Each and every application is build up of some objects. All such objects are identified and the graph is prepared. From this object graph, each object relationship is identified and test cases are written accordingly to discover the errors.

#7) Comparison Testing:

Different independent versions of the same software are used to compare to each other for testing in this method.

How to do Step-wise?

In general, when a systematic process is followed to test a project/application then quality is maintained and is useful in the long run for further rounds of testing.

  • The foremost step is to understand the Requirement specification of an application. A proper documented SRS(Software Requirement Specification) should be in place.
  • Using the above mentioned black box testing techniques such as Boundary value analysis, Equivalence partitioning etc sets of valid and invalid inputs are identified with their desired outputs and test cases are designed based on that.
  • The designed test cases are executed to check if they Pass or Fail by verifying the actual results with the expected results.
  • The Failed test cases are raised as Defects/Bugs and addressed to the development team to get it Fixed.
  • Further based on the defects being fixed, the tester Retests the defects to verify if it is recurring or not.

Advantages and Disadvantages

Advantages:

  • The tester need not have a technical background. It is important to test by being in the user's shoes and think from the user’s point of view.
  • Testing can be started once the development of the project/application is done. Both the testers and developers work independently without interfering in each other’s space.
  • It is more effective for large and complex applications.
  • Defects and inconsistencies can be identified at the early stage of testing.

Disadvantages:

  • Without any technical or programming knowledge, there are chances of ignoring possible conditions of the scenario to be tested.
  • In a stipulated time there are possibilities of testing less and skipping all possible inputs and their output testing.
  • A Complete Test Coverage is not possible for large and complex projects.

Difference between White Box Testing and Black Box Testing

Given below are few differences between the both:

Black Box TestingWhite Box Testing
It is a testing method without having knowledge about the actual code or internal structure of the applicationIt is a testing method having knowledge about the actual code and internal structure of the application
It is a testing method having knowledge about the actual code and internal structure of the applicationThis type of testing is performed at a lower level of testing such as Unit Testing, Integration Testing
It concentrates on the functionality of the system under testIt concentrates on the actual code – program and its syntax's
Black box testing requires Requirement specification to testWhite Box testing requires Design documents with data flow diagrams, flowcharts etc.
Black box testing is done by the testersWhite box testing is done by Developers or testers with programming knowledge.

Tools

Black box testing tools are mainly record and playback tools. These tools are used for regression testing that to check whether new build has created any bug in previous working application functionality.

These record and playback tools record test cases in the form of some scripts like TSL, VB script, Javascript, Perl etc.

Check Functional Testing tools tutorial.

Conclusion

These are some of the basic points regarding Black box testing and the overview of its techniques and methods.

As it is not possible to test everything with human involvement with 100 percent accuracy, if the above-mentioned techniques and methods are used effectively it will definitely improve the quality of the system.

To conclude, this is a very helpful method to verify the functionality of the system and identify most of the defects.

Hope you would have gained an in-depth knowledge of Black Box Testing technique.

Recommended Reading


149 thoughts on “Black Box Testing: An In-depth Tutorial with Examples and Techniques”

  1. Can smbdy explain in detail what is red box testing?

    Wiki Ans:red box testing is used to test products on hardware devices, networking components like protocolss

    Vijay says(Host):it is protocol testing-redbox, or error message testing-red box.

    Can some one clarifies these ans..?

  2. @ kalpana #49,

    inputs will be given as per the Business requirement.
    so the inputs are not standard depends on the business requirment.

  3. Hi vijay,
    Its a nice documnet.

    It would be good if you divide the testing types in functional and non-functional.

    As a testing beginner …..people want to know the basics ….

    Thanks
    Shiva

  4. Types of FRAME WORK IN TESTING

    The Test Script Modularity Framework

    The test script modularity framework requires the creation of small, independent scripts that represent modules, sections, and functions of the application-under-test. These small scripts are then used in a hierarchical fashion to construct larger tests, realizing a particular test case.

    Of all the frameworks I’ll review, this one should be the simplest to grasp and master. It’s a well-known programming strategy to build an abstraction layer in front of a component to hide the component from the rest of the application. This insulates the application from modifications in the component and provides modularity in the application design. The test script modularity framework applies this principle of abstraction or encapsulation in order to improve the maintainability and scalability of automated test suites.

    To demonstrate the use of this framework, I’ll automate a simple test case for the Windows Calculator program (see Figure 1) to test the basic functions (add, subtract, divide, and multiply).

    The Test Script Modularity Framework

    The test script modularity framework requires the creation of small, independent scripts that represent modules, sections, and functions of the application-under-test. These small scripts are then used in a hierarchical fashion to construct larger tests, realizing a particular test case.

    Of all the frameworks I’ll review, this one should be the simplest to grasp and master. It’s a well-known programming strategy to build an abstraction layer in front of a component to hide the component from the rest of the application. This insulates the application from modifications in the component and provides modularity in the application design. The test script modularity framework applies this principle of abstraction or encapsulation in order to improve the maintainability and scalability of automated test suites.

    To demonstrate the use of this framework, I’ll automate a simple test case for the Windows Calculator program (see Figure 1) to test the basic functions (add, subtract, divide, and multiply).

    The Keyword-Driven or Table-Driven Testing Framework

    Keyword-driven testing and table-driven testing are interchangeable terms that refer to an application-independent automation framework. This framework requires the development of data tables and keywords, independent of the test automation tool used to execute them and the test script code that “drives” the application-under-test and the data. Keyword-driven tests look very similar to manual test cases. In a keyword-driven test, the functionality of the application-under-test is documented in a table as well as in step-by-step instructions for each test.

    If we were to map out the actions we perform with the mouse when we test our Windows Calculator functions by hand, we could create the following table. The “Window” column contains the name of the application window where we’re performing the mouse action (in this case, they all happen to be in the Calculator window). The “Control” column names the type of control the mouse is clicking. The “Action” column lists the action taken with the mouse (or by the tester). And the “Arguments” column names a specific control (1, 2, 3, 5, +, -, and so on).

    For Further details Contact akbar.shaik@yahoo.com
    Hyderabad

  5. Hi vijay,

    excellant job yours… thanks

    i need a exact answere for two question..

    1.Define Defect Density?
    2.What are the techniques used to write a test case?

  6. i am a grasduate and i am really confused to step into testing field coz many graduates told me that it has no scope..Since black box testing does not involve internal functionality of a s/w,so a non-tech guy can also do it,than whats the use of studying engineering or graduating from Information technology..please clear my doubts.Thankyou

  7. Hi,

    can any one ans this question plz?

    1.Tell me the difference between test matrix & test metrix
    2.Explain Schedule variance, effort variance, size variance, requirement stablility index

  8. Article on BBT is very good… Want to know Examples for 4 points mentioned in ” How is this partitioning performing while testing, this will be more helpful to get much more idea on Equivalence partitioning technique.

    Thanks
    jayaprakash

  9. the data provided are valuable and helped me in making my presentataion.can u people provide me a complete ppt of software testing????

  10. Dear All,

    I am a masters student and my thesis about black box testing, the problem that I could not make a list by all the tests techniques under black box testing, different books different name, basically the same test but different name, and as well different companies different names, I need to make a list about them, so maybe anyone can help me here…

    thanks,
    Ahmad A

  11. @ varsha, bala
    “”Red Box testing
    Yellow Box testing &
    Green Box testing””,
    there is no terminology like this in testing industry, some can say it is protocol testing-redbox, or error message testing-red box, warning message testing-yellow box and green box- environmental testing, of cource white, black, grey box testing is there. Or else why it is called by red, green, yellow box testing, anyway it is not due to the icon\symbol present in the warning or error messages.

  12. Actually you could have observed that most of the testers in India are Black box testers. There is need to give more emphasis on this topic. So I will keep writing some more topics on Black box testing and practical methods.

  13. hi frnds…i just want to know that right now i am just a beginner in testing field…but i want to persue my carrer in testing and i wanna know frm where to start and study material…..i am in level 1 i.e justa a beginner….Plz help

  14. wao gr8 …..awsm keep it up dude..passed my internal exams with notes of ur’s on bbt ..keep it up keep on going lyk this

Leave a Comment