Equivalence Class Testing

What is meant by the Equivalence Class Testing?

It's a technique of grouping and partitioning the test input data, which is being used for the purpose of testing the software product into a number of different classes. These different classes, resembles the specified requirements and common behaviour or attribute(s) of the aggregated inputs.

Thereafter, the test cases are designed and created based on each class attribute(s) and one element or input is used from each class for the test execution to validate the software functioning, and simultaneously validates the similar working of the software product for all the other inputs present in their respective classes.


If you haven't understood the working of the equivalence class testing, then let's go through an example to clear the concept.

Consider a software application, which takes not less than two digit number and not more than 3 digit number, for its execution.

Below given is the huge amount of input, to test and validate the functioning of the software application.


Now, as per the requirement specifications, we now group these inputs, to form some classes.

Now, instead of testing the whole 1500 inputs, we have form 4 classes, and accordingly divided them in the category of valid inputs and invalid inputs. This reduces the work of the test case preparation, as we may have to prepare only 4 test cases for 4 different classes.

A single element, chosen from each class, as a test input, represents the whole class. For an example, a number 121 is used from the class "three digit numbers" as the test input. On using 121, it was found that software application functions properly and passes the test. Therefore, it is assumed that all the other numbers of the class "three digit number" will works wells for the software application. And if the software fails the test, then it is assumed, that all the three digit numbers will generate error in the software application.

Similarly, a number 7 is used from the class "single digit numbers", i.e. invalid input. It is expected by the software application, to generate error, on using number 7, and if does then the software is functioning appropriately, and it is also assumed that the remaining single digit number will also produces error(s), in the software application.

Key Points

  • It is a black box testing technique which restricts the testers to examine the software product, externally.
  • Also known by the name of equivalence class partitioning, it is used to form groups of test inputs of similar behaviour or nature.
  • Based on the approach, if one member works well in the family then the whole family is considered to function well and if one members fails, whole family is rejected.
  • Test cases are based on classes, not on every input, thereby reduces the time and efforts required to build large number of test cases.
  • It may be used at any level of testing i.e. unit, integration, system & acceptance.
  • It is good to go for the ECT, when the input data is available in terms of intervals and sets of discrete values.
  • However, there is no such specific rule to use only input from each class. Based on the experience and need, a tester may opt for more than one input.
  • It may results into good amount of decrease in the redundant test cases, if implemented properly.
  • It may not work well with the boolean or logical types variables.
  • A mixed combination of Equivalence class testing and boundary value testing produces effective results.