Equivalence Class Testing
Equivalence Class Testing, which is also known as Equivalence Class
Partitioning (ECP) and Equivalence Partitioning, is an important software
testing technique used by the team of testers for grouping and partitioning of
the test input data, which is then used for the purpose of testing the software
product into a number of different classes.
These different classes resemble 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.
Equivalence Class Testing Example
Let us further clear the concept of equivalence class testing with the assistance of
the following example:
Consider a software application, which takes not less than two digit number and
not more than 3 digit number, for its execution. Given below is the huge amount of
input to test and validate the functioning of the software application.
1,2,3,.................1498,1499,1500.
Now, as per the requirement specifications, these inputs are grouped
together to form some classes. Now, instead of testing 1500 inputs, we have
formed 4 classes and are accordingly dividing the inputs into a category of
valid and invalid inputs, which reduces the work of the test case preparation.
A single element, chosen from each class, as a test input, represents the
whole class. For example, 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 work well
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.
Equivalence Class Testing Types:
The equivalence class testing can be categorized into four different types,
which are integral part of testing and cater to different data set. These types of
equivalence class testing are:
1. Weak Normal Equivalence Class Testing: In this first type of equivalence
class testing, one variable from each equivalence class is tested by the team.
Moreover, the values are identified in a systematic manner. Weak normal
equivalence class testing is also known as single fault assumption.
2. Strong Normal Equivalence Class Testing: Termed as multiple fault
assumption, in strong normal equivalence class testing the team selects test
cases from each element of the Cartesian product of the equivalence. This
ensures the notion of completeness in testing, as it covers all equivalence
classes and offers the team one of each possible combinations of inputs.
3. Weak Robust Equivalence Class Testing: Like weak normal equivalence,
weak robust testing too tests one variable from each equivalence class.
However, unlike the former method, it is also focused on testing test cases
for invalid values.
4. Strong Robust Equivalence Class Testing: Another type of equivalence
class testing, strong robust testing produces test cases for all valid and
invalid elements of the product of the equivalence class. However, it is
incapable of reducing the redundancy in testing.
Advantages:
Equivalence class testing helps reduce the number of test cases, without
compromising the test coverage.
Reduces the overall test execution time as it minimizes the set of test data.
It can be applied to all levels of testing, such as unit testing, integration
testing, system testing, etc.
Enables the testers to focus on smaller data sets, which increases the
probability to uncovering more defects in the software product.
It is used in cases where performing exhaustive testing is difficult but at the
same time maintaining good coverage is required.
Disadvantages:
It does not consider the conditions for boundary value.
The identification of equivalence classes relies heavily on the expertise of
testers.
Testers might assume that the output for all input data set are correct, which
can become a great hurdle in testing.