Home

Monday, May 18, 2009

Black Box Testing

A testing technique in which tester doesn't need to know the internal structure of the code to test an application. The main objective of Black Box Testing is to test the functionality of the application as a whole.

The Black Box testing considers the application as black box so explicitly it doesn't need the knowledge of internal structure or code. While designing test cases, tester takes external perspective of the application and based on the perspective the test cases are derived which can be functional and non functional.

The Black Box testing techniques is applicable to all levels of testinng : Unit, Integration, System and Acceptance Testing.

Advantage of Black Box Testing:

  • More Effective when used for large systems

  • As the tester and developer are independent of each other, test is balanced and unprejudiced

  • Tester can be non-technical.

  • There is no need of having detailed functional knowledge of system to the tester.

  • Testing helps to identify the vagueness and contradiction in functional specifications.

  • Test cases can be designed as soon as the functional specifications are complete

Disadvantage of Black Box Testing:

  • Test cases are tough and challenging to design, without having clear functional specifications

  • It is difficult to identify tricky inputs, if the test cases are not developed based on specifications.

  • It is difficult to identify all possible inputs in limited testing time. So writing test cases is slow and difficult

  • Chances of leaving many program paths untested

  • Chances of repeating the tests that are already done by programmer.

Black Box Testing Techniques: Typical Black Box testing techniques are as follows:

  • Error Guessing

  • Equivalence Partitioning

  • Boundary Value Analysis

Error Guessing: Error Guessing is a testing technique which is based upon the tester's past experience, knowledge and intution to predict where the bugs can be found in application under test. Some areas to guess are: empty or null strings, zero instances, occurrences, blank or null characters in strings, Negative numbers etc.

Equivalence Partitioning: Equivalence Partitioning is a Black Box testing technique in which input domain data is divided into different equivalence data classes. This technique tries to define test case that uncovers classes of errors, thereby reducing the total number of test cases that must be developed.

For E.g.: Consider you are testing a date field which can accept date from 01-01-2001 to 31-12-2010 . In this case there is no use to write 3652 test cases for all valid inputs plus test cases for invalid inputs.

By using Equivalence Partitioning, we can divide all the inputs into three classes:

  1. Dates before 01/01/2001 - Input data class with all values below lower limit. i.e. any value below 01/01/2001, as a invalid input data test case.

  2. Dates from 01/01/2001 to 31/12/2009 - One input data class with all valid inputs. Choose a single value from 01/01/2001 to 31/12/2009 as a valid test case. One test case for valid input data is sufficient because If you select other values between 1 and 1000 then result is going to be same.

  3. Dates after 31/12/2009 - Input data class with all values upper to higher limit. i.e. any value after 31/12/2010, as a invalid input data test case.

By using Equivalence Partitioning, we have categorize all the test cases into three classes. Now we can choose an input value from each class to design our test cases. As you can see by using Equivalence Partitioning, we have covered maximum condition from fewest test cases.

Boundary Value Analysis (BVA): From Practice and Experience, it has been prove that most of the errors are found at the boundaries of input and output ranges of an application component that result in application faults. Boundary value analysis assists with the design of test cases that will exercise these boundaries in an attempt to uncover faults in the software during the testing process.

As Equivalence Partitioning, BVA is also used to design test cases where test cases are selected at the boundary of the input ranges.

For eg: In the above example test cases for date field accepting dates between 01/01/2001 to 31/12/2010 using BVA will be as follows:

  1. Test cases with test data exactly as the input boundaries of input domain i.e. values 01/01/2001 and 31/12/2010.

  2. Test cases with test data with values just below the boundaries of input domains i.e. 31/12/2000 and 30/12/2010.

  3. Test cases with test data with values just above the boundaries of input domains i.e. 02/01/2001and 01/01/2011.

After determining the necessary test cases with equivalence partitioning and subsequent boundary value analysis, it is necessary to define the combinations of the test cases when there are multiple inputs to an application component.

No comments: