Friday, May 1, 2009

Black Box Testing

Black Box Testing
Black box testing is a test design method. Black box testing treats the system as a "black-box", so it doesn't explicitly use Knowledge of the internal structure. Or in other words the Test engineer need not know the internal working of the “Black box”. It focuses on the functionality part of the module.
Some people like to call black box testing as behavioral, functional, opaque-box, and closed-box. While the term black box is most popularly use, many people prefer the terms "behavioral" and "structural" for black box and white box respectively. 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.
Personally we feel that there is a trade off between the approaches used to test a product using white box and black box types.
There are some bugs that cannot be found using only black box or only white box. If the test cases are extensive and the test inputs are also from a large sample space then it is always possible to find majority of the bugs through black box testing.
Tools used for Black Box testing: Many tool vendors have been producing tools for automated black box and automated white box testing for several years. The basic functional or regression testing tools capture the results of black box tests in a script format. Once captured, these scripts can be executed against future builds of an application to verify that new functionality hasn't disabled previous functionality.
Advantages of Black Box Testing:
- Tester can be non-technical.
- This testing is most likely to find those bugs as the user would find.
- Testing helps to identify the vagueness and contradiction in functional specifications.
- Test cases can be designed as soon as the functional specifications are complete.
Disadvantages of Black Box Testing:
- Chances of having repetition of tests that are already done by programmer.
- 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.
- Graph Based Testing Methods: Software testing begins by creating a graph of important objects and their relationships and then devising a series of tests that will cover the graph so that each objects and their relationships and then devising a series of tests that will cover the graph so that each object and relationship is exercised and error is uncovered.
Error Guessing: Error Guessing comes with experience with the technology and the project. Error Guessing is the art of guessing where errors can be hidden. There are no specific tools and techniques for this, but you can write test cases depending on the situation: Either when reading the functional documents or when you are testing and find an error that you have not documented.
Boundary Value Analysis: Boundary Value Analysis (BVA) is a test data selection technique (Functional Testing technique) where the extreme values are chosen. Boundary values include maximum, minimum, just inside/outside boundaries, typical values, and error values. The hope is that, if a system works correctly for these special values then it will work correctly for all values in between.
- 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 focuses on the boundary of the input space to identify test cases
- Rational is that errors tend to occur near the extreme values of an input variable
There are two ways to generalize the BVA techniques:
By the number of variables (For n variables): BVA yields 4n + 1 test cases.
By the kinds of ranges: Generalizing ranges depends on the nature or type of variables:
- NextDate has a variable Month and the range could be defined as {Jan, Feb, …Dec}Min = Jan, Min +1 = Feb, etc.
- Triangle had a declared range of {1, 20,000}
- Boolean variables have extreme values True and False but there is no clear choice for the remaining three values
Advantages of Boundary Value Analysis:
- Robustness Testing - Boundary Value Analysis plus values that go beyond the limitsMin - 1, Min, Min +1, Nom, Max -1, Max, Max +1
- Forces attention to exception handling
- For strongly typed languages robust testing results in run-time errors that abort normal execution
Limitations of Boundary Value Analysis: BVA works best when the program is a function of several independent variables that represent bounded physical quantities:
1. Independent Variables:NextDate test cases derived from BVA would be inadequate: focusing on the boundary would not leave emphasis on February or leap years.
- Dependencies exist with NextDate's Day, Month and Year.- Test cases derived without consideration of the function
2. Physical Quantities:An example of physical variables being tested, telephone numbers - what faults might be revealed by numbers of 000-0000, 000-0001, 555-5555, 999-9998, 999-9999?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. EP can be defined according to the following guidelines:
- If an input condition specifies a range, one valid and one two invalid classes are defined.
- If an input condition requires a specific value, one valid and two invalid equivalence classes are defined.
- If an input condition specifies a member of a set, one valid and one invalid equivalence class is defined.
- If an input condition is Boolean, one valid and one invalid class is defined.
Comparison Testing: There are situations where independent versions of software be developed for critical applications, even when only a single version will be used in the delivered computer based system. It is these independent versions which form the basis of a black box testing technique called Comparison testing or back-to-back testing.
Orthogonal Array Testing: The Orthogonal Array Testing Strategy (OATS) is a systematic, statistical way of testing pair-wise interactions by deriving a suitable small set of test cases (from a large number of possibilities).

Equivalence Partitioning
Equivalence partitioning is a test case selection technique for black box testing. In this method, testers identify various classes of input conditions called as equivalence classes. These classes are identified such that each member of the class causes the same kind of processing and output to occur.
Basically, a class is a set of input conditions that are similar in nature for a system. In this test case selection technique, it is assumed that if the system will handle one case in the class erroneously, it would handle all cases erroneously.
This technique drastically cuts down the number of test cases required to test a system reasonably. Using this technique, one can found the most errors with the smallest number of test cases.
To use equivalence partitioning, you will need to:
Determining conditions to be tested Defining and designing testsDetermining conditions to be tested:
All valid input data for a given condition are likely to go through the same process.Invalid data can go through various processes and need to be evaluated more carefully. For example:Treat the blank entry differently than an incorrect entry.Treat a value differently if it is less than or greater than a range of values.If there are multiple error conditions within a function, one error may override the other, which means that the subordinate error does not get tested unless the other value is valid.Defining and Designing Test Cases:
First, include valid tests and include as many valid tests as possible in one test case.For invalid input, include only one test in a test case in order to isolate the error.Example: In a company, first three digits of all employee IDs, the minimum number is 333 and the maximum number is 444. For the fourth and fifth digits, the minimum number is 11 and the maximum number is 99.So, for the first three digits the various test conditions can be
a. = or > 333 and = or <>b. <>c. > 444, (invalid input, above the range)d. Blank, (invalid input, below the range).And for the third and fourth digits the various test conditions can bee. = or > 11 and = or <>f. <>g. > 99, (invalid input, above the range)h. blank, (invalid input, below the range)Now, while using equivalence partitioning; only one value that represents each of the eight equivalence classes needs to be tested.
Now, after identifying the tests, you will need to create test cases to test each equivalence class. Create one test case for the valid input conditions and identify separate test cases for each invalid input.
As a black box tester, you might not know the manner in which the programmer has coded the error handling. So, you will need to create separate tests for each invalid input, to avoid masking the result in the event one error takes priority over another.
Thus, based on the test conditions, there can be seven test cases:
Test case for a and e - (both are valid)Test case for b and e - (only the first one is invalid)Test case for c and e - (only the first one is invalid)Test case for d and e - (only the first one is invalid)Test case for a and f - (only the second one is invalid)Test case for a and g - (only the second one is invalid)Test case for a and h - (only the second one is invalid)

3 comments:

  1. Hello,
    The Article on brief explanation of Black box testing is informative . It give detail information about it .Thanks for Sharing the information about black box testing brief information. Software Testing Company

    ReplyDelete
  2. Really nice topics you had discussed above. I am much impressed. Thank you for providing this nice information here.

    Software Testing Company

    QA Services

    Game Testing Companies

    Console Game Testing

    ReplyDelete
  3. Really good information to show through this blog. I really appreciate you for all the valuable information that you are providing us through your blog.

    Pen testing services
    Vulnerability assessment services
    Load Testing Services
    Mobile app testing services

    ReplyDelete