Monday, July 2, 2012

Boundary value analysis and Equivalence partitioning.

Equivalence partitioning
  • Equivalence partitioning is a black box testing technique that divides the input data of a software unit into partitions of data from which test cases can be derived.
Example:
  • Assume that you have to test an input box that accepts numbers from 1 to 100. It is not possible to write test cases for all 100 valid data and other test cases for invalid data.
  • By using Equivalence Partitioning method, the above test cases can be divided into three sets of input data called as classes.
Test cases for input box which accepts numbers between 1 and 100 using Equivalence Partitioning:

  1. Take a single value from range 1 to 100 as a valid test case. If you select any other values between 1 and 100 the result will be same. So one test case for valid input data should be sufficient.
  2. Test any value below the lower limit. ie, any value below 1, as invalid data test case.
  3. Input data with any value greater than 100 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.
  • Equivalence partitioning uses fewest test cases to cover maximum requirements.
Boundary value analysis
  • Boundary value analysis is a black box testing technique in which tests are designed to include representatives of boundary values.
  • Values on the minimum and maximum edges of an equivalence partition are tested.
  • Boundary value analysis testing technique is used to identify errors at boundaries rather than finding those exist in center of input domain.
Test cases for input box which accepts numbers between 1 and 100 using Boundary value analysis:
  1. Test cases with test data exactly as the input boundaries of input domain i.e. values 1 and 100 in our case.
  2. Test data with values just below the extreme edges of input domains i.e. values 0 and 99.
  3. Test data with values just above the extreme edges of input domain i.e. values 2 and 101.
  • Boundary value analysis is often called as a part of stress and negative testing.

No comments:

Post a Comment