Equivalence Class Partitioning
ECP is a testcase design techniques that divides the input data into set of partitions of data from which test case can be derived. The thumb rule is that there should be at least one class for each of partitions. It is expected that each member of class will have same behavior in the system. In other way ECP method creates same set of Input/Output that are handled in the same way by the application.
This method helps to reduce number of test cases as we create classes for of test data & test them accordingly. The test that results from the representative value for a class is said to be "equivalent" to the other values in the same class. If no errors were found in the test of the representative value, it is reasoned that all the other "equivalent" values wouldn't identify any errors either.
There are 2 major steps we need to do in order to use equivalence class partitioning:
Identify the equivalence classes of input or output. Take each input's or output's condition that is described in the specification and derive at least 2 classes for it:
o If an input condition specifies a range of values (such as, program "accepts values from 10 to 100"), then one valid equivalence class (from 10 to 100) and two invalid equivalence classes are identified (less than 10 and greater than 100).
o If an input condition specifies a set of values (such as, "cloth can be many colors: RED, WHITE, BLACK, GREEN, BROWN "), then one valid equivalence class (the valid values) and one invalid equivalence class (all the other invalid values) are identified. Each value of the valid equivalence class should be handled distinctly.
o If the input condition is specified as a "must be" situation (such as, "the input string must be upper case"), then one valid equivalence class (uppercase characters) and one invalid equivalence (all the other input except uppercase characters) class are identified.
o Everything finished "long" before the task is done is an equivalence class. Everything done within some short time interval before the program is finished is another class. Everything done just before program starts another operation is another class.
o If a program is specified to work with memory size from 64M to 256M. Then this size range is an equivalence class. Any other memory size, which is greater than 256M or less than 64M, can be accepted.
o The partition of output event lies in the inputs of the program. Even though different input equivalence classes could have same type of output event, you should still treat the input equivalence classes distinctly.
Some Intresting ECP examples in next post. :)
This method helps to reduce number of test cases as we create classes for of test data & test them accordingly. The test that results from the representative value for a class is said to be "equivalent" to the other values in the same class. If no errors were found in the test of the representative value, it is reasoned that all the other "equivalent" values wouldn't identify any errors either.
For ex. lets have a systesm which takes 2 integer value & add them.As we know that sum of two integer will always be a positive Integer so if we have to test with 100 Values of same Integer class we can test with 2-3 values & based on result we can conclude that all values of that test data will produce same result.We need not to test all possible 100 x 100 Combinations each with different value.
Identify the equivalence classes of input or output. Take each input's or output's condition that is described in the specification and derive at least 2 classes for it:
- One class that satisfies the condition – Valid class.
- Second class that doesn't satisfy the condition – Invalid class.
Here are a set of guidelines to identify equivalence classes:
Comments
Post a Comment