| Equivalence partitioning is a software testing technique | | | | this example this would be: |
| to optimize the number of permutation and combination | | | | …. -2 -1 0 1 ….. 6 7 ….. 12 13 14 15 ….. |
| of input data. In equivalence partitioning, data is selected | | | | -----|---|----|------invalid partition 1 P1 P2 invalid partition 2 |
| in a way such that with minimal set of data it may give | | | | TC1 TC2 TC3 TC4valid partitions |
| many output. | | | | To check for the expected results you would need to |
| For a set of value if the software behaves in an | | | | evaluate some internal intermediate values rather than |
| identical way then the set can be termed as | | | | the output interface. |
| equivalence class or partition. The software can | | | | Types |
| assume as, it will work the same way for the different | | | | Continuous classes, or ranges of values, run from one |
| values in the given equivalence class or partition. The | | | | point to another, with no clear separations of value, like |
| input data is analyzed and divided as per the different | | | | temperature range. |
| output it is producing which is named as equivalence | | | | Discrete classes have clear separation of values. |
| partitioning. Whatever things the software expects can | | | | Discrete classes are sets, or enumerations. Boolean |
| be a representative of all the input values in this | | | | classes are either true or false. |
| partitioning class. For a specific equivalence classes, it | | | | Boolean classes only have two values, either true or |
| can be assumed that software will behave in similarly | | | | false, on or off, yes or no. |
| for any data value from that partition. | | | | Use |
| Theory | | | | Equivalence partitioning will radically cuts down the |
| The testing theory of equivalence partitioning suggests | | | | number of test cases required to test a system |
| that only one test case is needed to evaluate the | | | | reasonably. This is an attempt to get a good ‘hit |
| behaviour of the program for the related partition. In | | | | rate', to find the most errors with the smallest number |
| other words it is sufficient to select one test case out | | | | of test cases. |
| of each partition to check the behaviour of the | | | | To use equivalence partitioning, you will need to |
| program. By using more or all the test cases of the | | | | perform two steps |
| partition it will not find new faults in the program. The | | | | Identify the equivalence classes |
| values within one partition are considered to be | | | | Design test cases |
| "equivalent." Thus the number of test cases can be | | | | Take each input condition described in the specification |
| reduced considerably. | | | | and derive at least two equivalence classes for it. One |
| Another effect by applying the equivalence partitioning | | | | class represents the set of cases which satisfy the |
| technique is that it is able to find out the "dirty" test | | | | condition (the valid class) and one represents cases |
| cases. An inexperienced tester may be tempted to | | | | which do not (the invalid class).a) If the requirements |
| use as test cases the input data 1 to 12 for the month | | | | state that a numeric value is input to the system and |
| and forget to select some out of the invalid partitions. | | | | must be within a range of values, identify one valid |
| This would lead to a huge number of unnecessary test | | | | class inputs which are within the valid range and two |
| cases on the one hand, and a lack of test cases for | | | | invalid equivalence classes inputs which are too low |
| the dirty ranges on the other hand. | | | | and inputs which are too high.b) If the requirements |
| Black Box vs. White Box | | | | state that the number of items input by the system at |
| The main tendency is that the equivalence partitioning | | | | some point must lie within a certain range, specify one |
| is always related to black box testing which is strictly | | | | valid class where the number of inputs is within the |
| checking a software component at its interface | | | | valid range, one invalid class where there are too few |
| without any consideration about its internal logics. But | | | | inputs and one invalid class where there are, too many |
| there are various cases where we can apply the | | | | inputs.c) If the requirements state that a particular input |
| equivalence test in white box testing also. | | | | item match one of a set of values and each case will |
| Let us consider an interface is having a valid range | | | | be dealt with the same way, identify a valid class for |
| from 1 to 12. Internal structure is like that for 1 to 6, it | | | | values in the set and one invalid class representing |
| has a particular logic and for 7 to 12, has a different | | | | values outside of the set.d) If the requirements state |
| logic. Depending on the input value the software | | | | that a particular input item match one of a set of |
| internally will run through different paths to perform | | | | values and each case will be dealt with differently, |
| slightly different actions. | | | | identify a valid equivalence class for each element and |
| Regarding the input and output interfaces to the | | | | only one invalid class for values outside the set.e) If |
| component this difference will not be noticed, however | | | | you think any elements of an equivalence class will be |
| in your white-box testing you would like to make sure | | | | handled differently than the others, divide the |
| that both paths are examined. To achieve this it is | | | | equivalence class to create an equivalence class with |
| necessary to introduce additional equivalence partitions | | | | only these elements and an equivalence class with |
| which would not be needed for black-box testing. For | | | | none of these elements. |