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 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 any one 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 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 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 a 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.

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

  1. nice to understand the black box testing technics

  2. NICE Example 4 Black Box Testing.

  3. nice sharing ……….

  4. Desertation Topic: Designing and boundary value analysis (using Black Box Testing).
    Abstract:
    Black box testing treats the system as a “black-box”, so it doesn’t explicitly use Knowledge of the internal structure or code. Or in other words the Test engineer need not know the internal working of the “Black box” or application.
    Main focus in black box testing is on functionality of the system as a whole. The term ‘behavioral testing’ is also used for black box testing and white box testing is also sometimes called ‘structural testing’. Behavioral test design is slightly different from 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 only black box or only white box. Majority of the applicationa are tested by black box testing method. We need to cover majority of test cases so that most of the bugs will get discovered by blackbox testing.
    Black box testing occurs throughout the software development and Testing life cycle i.e in Unit, Integration, System, Acceptance and regression testing stages.
    Tools used for Black Box testing:

    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 records test cases in the form of some scripts like TSL, VB script, Java script, Perl.

    Advantages of Black Box Testing

    – Tester can be non-technical.
    – Used to verify contradictions in actual system and the specifications.
    – Test cases can be designed as soon as the functional specifications are complete

    Disadvantages of Black Box Testing

    – The test inputs needs to be from large sample space.
    – It is difficult to identify all possible inputs in limited testing time. So writing test cases is slow and difficult
    – Chances of having unidentified paths during this testing

    Methods of Black box Testing:
    Graph Based Testing Methods:

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

    This is purely based on previous experience and judgment of tester. Error Guessing is the art of guessing where errors can be hidden. For this technique there are no specific tools, writing the test cases that cover all the application paths.

    Boundary Value Analysis:

    Many systems have tendency to fail on boundary. So testing boundry values of application is important. Boundary Value Analysis (BVA) is a test Functional Testing technique where the extreme boundary values are chosen. Boundary values include maximum, minimum, just inside/outside boundaries, typical values, and error values.
    Extends equivalence partitioning
    Test both sides of each boundary
    Look at output boundaries for test cases too
    Test min, min-1, max, max+1, typical values

    BVA techniques:
    1. Number of variables
    For n variables: BVA yields 4n + 1 test cases.

    2. Kinds of ranges
    Generalizing ranges depends on the nature or type of variables
    Advantages of Boundary Value Analysis
    1. Robustness Testing – Boundary Value Analysis plus values that go beyond the limits
    2. Min – 1, Min, Min +1, Nom, Max -1, Max, Max +1
    3. Forces attention to exception handling

    Limitations of Boundary Value Analysis
    Boundary value testing is efficient only for variables of fixed values i.e boundary.

    Equivalence Partitioning:
    Equivalence partitioning is a black box testing method that divides the input domain of a program into classes of data from which test cases can be derived.

    How is this partitioning performed while testing:
    1. If an input condition specifies a range, one valid and one two invalid classes are defined.
    2. If an input condition requires a specific value, one valid and two invalid equivalence classes are defined.
    3. If an input condition specifies a member of a set, one valid and one invalid equivalence class is defined.
    4. If an input condition is Boolean, one valid and one invalid class is defined.

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

    Boundary value analysis and Equivalence partitioning, explained with simple example:
    Boundary value analysis and equivalence partitioning both are test case design strategies in black box testing.
    Equivalence Partitioning:

    In this method the input domain data is divided into different equivalence data classes. This method is typically used to reduce the total number of test cases to a finite set of testable test cases, still covering maximum requirements.
    In short it is the process of taking all possible test cases and placing them into classes. One test value is picked from each class while testing.

    E.g.: If you are testing for an input box accepting numbers from 1 to 1000 then there is no use in writing thousand test cases for all 1000 valid input numbers plus other test cases for invalid data.
    Using equivalence partitioning method above test cases can be divided into three sets of input data called as classes. Each test case is a representative of respective class.
    So in above example we can divide our test cases into three equivalence classes of some valid and invalid inputs.

    Test cases for input box accepting numbers between 1 and 1000 using Equivalence Partitioning:

    1) One input data class with all valid inputs. Pick a single value from range 1 to 1000 as a valid test case. If you select other values between 1 and 1000 then result is going to be same. So one test case for valid input data should be sufficient.

    2) Input data class with all values below lower limit. I.e. any value below 1, as a invalid input data test case.

    3) Input data with any value greater than 1000 to represent third invalid input class.
    So using equivalence partitioning you have categorized all possible test cases into three classes.

    Test cases with other values from any class should give you the same result.
    We have selected one representative from every input class to design our test cases. Test case values are selected in such a way that largest number of attributes of equivalence class can be exercised.
    Equivalence partitioning uses fewest test cases to cover maximum requirements.
    Boundary value analysis:

    It’s widely recognized that input values at the extreme ends of input domain cause more errors in system. More application errors occur at the boundaries of input domain. ‘Boundary value analysis’ testing technique is used to identify errors at boundaries rather than finding those exist in center of input domain.
    Boundary value analysis is a next part of Equivalence partitioning for designing test cases where test cases are selected at the edges of the equivalence classes.
    Test cases for input box accepting numbers between 1 and 1000 using Boundary value analysis:

    1) Test cases with test data exactly as the input boundaries of input domain i.e. values 1 and 1000 in our case.
    2) Test data with values just below the extreme edges of input domains i.e. values 0 and 999.
    3) Test data with values just above the extreme edges of input domain i.e. values 2 and 1001.
    Boundary value analysis is often called as a part of stress and negative testing.
    Note: There is no hard-and-fast rule to test only one value from each equivalence class you created for input domains. You can select multiple valid and invalid values from each equivalence class according to your needs and previous judgments.

    E.g. if you divided 1 to 1000 input values in valid data equivalence class, then you can select test case values like: 1, 11, 100, 950 etc. Same case for other test cases having invalid data classes.
    This should be a very basic and simple example to understand the Boundary value analysis and Equivalence partitioning concept.
    ` `

  5. good information

  6. Where is the techinques explained here?

  7. wat is functional testing types

  8. wat is functional testing types and wat do u mean by smoke testing

  9. it was quite useful information..worked well for me..

  10. its very valuable.And very usefull for my seminar…..

  11. asalam…..:)
    nice awsm…its really good to know the basics in blackbox testing and so many other terminologies
    thanx 2 all……viki

  12. nice coverage on BBT…especially for a fresher in testing…simple and understandable.

  13. what is sdlc and stlc

  14. can u explan phases of sdlc and their use

  15. Hi Vijay,
    Thanks alot for sharing such a good explaination.

    can u please send me some ebooks related to testing on my id: saxena.aditi7887@gmail.com

    Thanks in advance!!!

  16. what is object testing ?

  17. If any company is hiwring me for the job of black box testing then can i change it to WBT???

  18. Hi Varsha,(#16)

    I jus want to share my knowledge abt yellow and green box testing.
    YELLOW BOX : Yellow box is a testing technique for acceptance testing. Alpha and Beta tests together is called as Yellow box testing technique.
    Product based acceptance testing is called as Alpha test and Project based acceptance testing is called as Beta test.

    GREEN BOX TESTING TECHNIQUE: This is related to the s/w release or delivery. “Delivery team” will go the customer site, install the s/w, and observe various factors as below mentioned:
    1. Complete installation of s/w
    2. Overall functionality
    3. Input devices handling
    4. Output devices handling
    5. Secondary storage devices handling
    6. OS support
    7. Co-existence with other s/w
    The above observations at the customer site are called as Green Box Testing Technique.

  19. can u tell me which type of questions ,i have to face in blockbox testers interview? plz help me.. i am a beginner

  20. These Articles are very good.
    But i want to
    1.Test Case Template for Web Application.
    2.How to write test cases for Black box and White Box Testing.

  21. what is a benefit of blackbox tester. help me please im just a fool

  22. what is a shortcomings of black box testing. please help me

  23. Hi –
    Pl share me more details on Graph based tests.
    If possible, share me with examples. Thanks.

  24. I am looking for some live project with the test cases.If anybody can be nice enough to send them.my email is akulk2000@yahoo.com

  25. hii All,

    can anybody tell me how to write basic testcases for login application and the format of testcases

    vsudheer55@gmail.com

  26. Thanks a lot Dude..! Could you please share the Testcase Template.

  27. in smoke testing we are veifying whether the build is ready for testing by entering with valid data and with out valid data.

  28. hii vijay,
    tell me the diff betwn static n dynamic testing,wbt and bbt,types of static,dynamic,wbt and bbt.if we draw a diagram and relate them then how are they realted??

  29. Hello,

    What are Software Testing Methods ? and Software Testing Techniques and Software Testing Types?
    Plz..

  30. white box tester can do black box testing?

  31. Hi,Vijay

    you are doing a great job..Really improving the knowledge about the BBT and WBT..

  32. you practically did my term paper

  33. Hi All,

    Good day for you,

    Use case testing comes under Black box Testing or White box testing?

  34. this information is help for me and save the time also.

  35. This article was not so informative.full of crap

  36. begin
    x ? x * 2;
    if x > 0 then
    y ? y + 200;
    else
    y ? 5 * y;
    endif;
    while x > y do
    x ? x – 10;
    endwhile;
    z ? y – x;
    end;

    How you would apply Functional (Black Box) Testing to this subroutine?

    How you would apply Structural (White Box) Testing to this subroutine?

  37. Hi All,

    I am new in this field kindly share me about the black box testing now a days it is more valuable than WBox testing.
    Request you kindly share the knowledge which is helpful to me.

    My email ID is rsatish2010@gmail.com

  38. unit and component testing is black box testing or white box testing?

  39. Hi,
    What are the techniques of black box testing can you explain it in detail please ..

    Thanks,
    Tejas

  40. Test to mobile app

  41. hi,

    I m fresher ,I started studying manual testing ,can i get easy notes to understand more regarding software testing.

    My email :-trupti90d@gmail.com

    Regards,
    Trupti

  42. There is one mistake in the differences between black box testing and white box testing technique. Please review it.

  43. Point number 2 in difference between white box and black box has been swapped

Leave a Comment