Monday 22 July 2013

Equivalence Class Testing Technique Examples

Equivalence class Testing:
Equivalence class or Equivalence Partition is the act of dividing the given input set by a relation into groups or classes which is treated the same by the module or which should produce the same result. Any data value within a class is equivalent in terms of testing, to any other value.

Equivalence partitioning is a software testing design technique that involves identifying a small set of representative input values that produce as many different output conditions as possible. One representative sample from each partition is picked up for testing since all the values produce equal and same output. This technique tries to define test case that uncovers classes of errors, thereby reducing the total number of test cases that must be developed.

The step for using equivalence class testing are:
  1. Identify the Equivalence class from the given requirements or scenario.
  2. Create a test case for each equivalence class.
  3. From the results obtained for one member in an equivalence class extrapolate results for all values in that partition.
Examples:
The electricity bill computed by the service provider has a fixed component as well as a running component. All customers are charged at a rate of $40 flat as a fixed component. In addition to this, they would be changed a running component and/ or a fine, depending upon their amount of consumption or usage.

The rules for this are given below:
  • If the number of units consumed by the consumer is less than 10 units, then the running cost is not charged for the consumer.
  • If the nimber of units is between 11 and 20, then the running cost is charged at $1 per unit.
  • If the number of units is between 21 and 40, then the running cost is charged at $2 per unit.
  • If the number of units exceeds 40, then the running cost is charged at $5 per unit.
  • Use equivalence class partitioning to decide on the test cases to be designed.

0 comments :

Post a Comment