Back

Equivalence Class Partitioning

Idealogic’s Glossary

Equivalence Class Partitioning is a black-box testing technique which assists testers in planning and prioritizing the test cases by dividing the input data into sets of equivalent values or classes. This is especially helpful in order to enhance the test coverage without having to invest a lot of effort to test a large number of inputs.

How Equivalence Class Partitioning Works

In equivalence class partitioning, input data is partitioned into classes which are expected to be processed in the same manner by the system. For instance, if an input field is to accept values from 1 to 100, one class of equivalents may contain all the values that fall within this range while the other class may contain all the values that are not within this range. The concept is that one can test just one value for every class and it will be enough to determine the outcome for the whole class instead of testing all the values possible.

For instance, let us assume that there is a software application that asks a user to enter his or her age which must be a number between 18 and 65. The equivalence classes might be:

  1. Valid inputs (18 to 65): A test case could use the value 30 for instance.
  2. Invalid inputs below the range (e. g. , less than 18): For instance, a test case could have the value of 15.
  3. Invalid inputs above the range (e. g. , greater than 65): Value 70 could be used in a test case.

When testing these representative values the tester will be able to confirm that the system works as expected for the entire set of valid and invalid inputs with out having to test for every single value.

Benefits of Equivalence Class Partitioning

Equivalence class partitioning offers several key benefits:

  • Efficiency: This technique decreases the number of test cases needed while at the same time guaranteeing that all possible inputs are tested for.
  • Improved Test Coverage: Although less number of test cases are used, the method makes it possible to test different types of input and thus help in identifying problems in a variety of situations.
  • Simplification: Dividing inputs into classes will help in the testing process as it will be easier to know where the main functions are.

Conclusion

Equivalence Class Partitioning is one of the black box testing techniques that can be used to maximize the testing efficiency by dividing the input data into classes which are expected to produce similar results. This approach greatly minimises the number of test cases that are required in testing while at the same time ensuring that good coverage is achieved. When testers think that if one value in a class is good all others will also work then they can concentrate on finding out the critical input ranges which has to be tested and validated and thus testing becomes more efficient and efficient.