White Box Testing
Test your code
   Home      EquivalencePartitioningAndBVA
 

Equivalence Partitioning

Equivalence partitioning is software testing technique in which test input data divided into valid and invalid ranges. These valid and invalid ranges are called equivalence partitions or equivalence classes which uncover classes of errors and helps in reducing the indefinite test cases to finite numbers of testable test cases. In principal test cases should be taken from each class. The equivalence partitions derived from requirement specification document.
 
For an example any bank has different charges depending on the transaction done.
 
            1)     5%  of the amount for transaction less than or equal to 1000 bucks
 
            2)     6%  of the amount for transaction more than 1000  and less than or equal to 2000 bucks
 
            3)     7%  of the amount for transaction more than 2000 bucks
 
We will have following equivalence class partition for the above example


To test that function of bank application properly we should have test cases from all the partitions. In the above example transaction less than 0 is invalid partition. Test data for invalid partitions ensure the behaviour of function for invalid data.

 
In theories more or all the test data from any partition is equivalent it is sufficient to have one test case per partition.  More test cases from a partition will not discover new fault in the function.
 
To select more effective minimum number test cases for a partition boundary value analysis should be applied along with equivalence class partitioning.
 
 

Boundary Value Analysis

 
Boundary value analysis is software testing technique in which test cases designed for the edges of equivalence class. As it is widely known the boundaries are most vulnerable for faults in any software application
 
Boundary value test cases are selected on and around the partition edges. For any boundary there will be at least three test cases. If the value on any boundary is n there would be following boundary value test cases for that boundary.
  • n – smallest decrement
  • n
  • n + smallest increment

For the above bank example in equivalence class partitioning the boundary value test cases will be as follows


 

External References