03 Equivalence Class Testing - skylerto/Software-Testing GitHub Wiki
Equivalence Class Testing
Boundary Value Testing derives test cases with massive redundancy and serious gaps. On the other hand, Equivalence Class Testing attempts to alleviate these problems by using two orthogonal dimensions:
- Robustness
- Single/Multiple Fault Assumption
To do this we partition the set of all test cases into mutually disjoint subsets whose union is the entire set then choose one test case from each subset. There are two important implications for testing:
- The fact that the entire set is represented provides a form of completeness
- The disjointness assures a form of non-redundancy
Equivalence Class Selection
- If the equivalence classes are chosen wisely, the potential redundancy among test cases is greatly reduced.
- The key point in equivalence class testing is the choice of the equivalence relation that determines the classes.
- We will differentiate below, between four different types of equivalence class testing (ECT).
- Weak normal ECT
- Strong normal ECT
- Weak robust ECT
- Strong robust ECT
Assumptions Regarding ECT
Equivalence Class Testing is appropriate when the system under test can be expressed as a function fo one or more variables, whose domains have well defined intervals. Input and/or output variables have well defined intervals. The entire set is represented by the union of the subsets. The disjointness of the sets assures a form of non-redundancy. We must choose only one test case from each subset.
Weak Normal
Limitations of ECT
Does not work well for booleans, or logical variables or when variables are not independent.
Guidelines and Observations
- Equivalence Class Testing is appropriate when input data is defined in terms of intervals and sets of discrete values.
- Equivalence Class Testing is strengthened when combined with Boundary Value Testing
- Strong equivalence takes the presumption that variables are independent. If that is not the case, redundant test cases may be generated
- e.g., February 30 and 31 for three different types of years can be redundant test cases
- Complex functions, such as the NextDate program, are well-suited for Equivalence Class Testing
- Several tries may be required before the “right” equivalence relation is discovered
- If the equivalence classes are chosen wisely, the potential redundancy among test cases is greatly reduced
- The key point in equivalence class testing is the choice of the equivalence relation that determines the classes