Overview
Equivalence partitioning is a method for deriving test cases. In this
method, classes of input conditions called equivalence classes are
identified such that each member of the class causes the same kind of
processing and output to occur.
In this method, the tester identifies various equivalence classes for partitioning. A class
is a set of input conditions that are is likely to be handled the same way
by the system. If the system were to handle one case in the class
erroneously, it would handle all cases erroneously.
Contents:
- http://www.onestoptesting.com/equivalence-partitioning/definition.asp - Definition
- http://www.onestoptesting.com/equivalence-partitioning/theory.asp - The Theory
- http://www.onestoptesting.com/equivalence-partitioning/black-box-white-box.asp - Black Box vs. White Box
- http://www.onestoptesting.com/equivalence-partitioning/types.asp - Types of Equivalence Classes
- http://www.onestoptesting.com/equivalence-partitioning/why.asp - Why Learn Equivalence Partitioning?
- http://www.onestoptesting.com/equivalence-partitioning/designing.asp - Designing Test Cases Using Equivalence Partitioning
Definition
Equivalence partitioning is a software testing technique to minimize
number of permutation and combination of input data. In equivalence
partitioning, data is selected in such a way that it gives as many
different out put as possible with the minimal set of data.
If software behaves in an identical way for a set of value, then
the set is termed as equivalence class or a partition. It can be
assumed safely that functionality of the software will be same for
any data value from the equivalence class or partition. In
equivalence partitioning, input data is analyzed and divided into
equivalence classes which produces different output.
Now, data from these classes can be representative of all the input values that
your software expect. For equivalence classes, it can be assumed that software
will behave in exactly same way for any data value from the same partition. The Theory
The testing theory related to equivalence partitioning says that only
one test case of each partition is needed to evaluate the http://www.onestoptesting.com/equivalence-partitioning/theory.asp# - - behaviour of
the program for the related partition. In other words it is sufficient
to select one test case out of each partition to check the behaviour of
the program. To use more or even all test cases of a partition will not
find new faults in the program. The values within one partition are
considered to be "equivalent." Thus the number of test cases can be
reduced considerably.
An additional effect by applying this technique is that you also find
the so called "dirty" test cases. An inexperienced tester may be tempted
to use as test cases the input data 1 to 12 for the month and forget to
select some out of the invalid partitions. This would lead to a huge
number of unnecessary test cases on the one hand, and a lack of test
cases for the dirty ranges on the other hand. Types of Equivalence Classes
- Continuous classes, or ranges of values, run from one point to
another, with no clear separations of values. An example is a
temperature range.
- Discrete classes have clear separation of values. Discrete
classes are sets, or enumerations.
- Boolean classes are either true or false. Boolean classes only
have two values, either true or false, on or off, yes or no. An
example is whether a checkbox is checked or unchecked.
Why Learn Equivalence Partitioning?
Equivalence partitioning drastically cuts down the number of test cases
required to test a system reasonably.
It is an attempt to get a good
'hit rate', to find the most errors with the smallest number
of test cases.
Designing Test Cases Using Equivalence Partitioning
To use equivalence partitioning, you will need to perform two steps
Identify the equivalence classes
Design test cases
STEP 1: IDENTIFY EQUIVALENCE CLASSES
Take each
input condition described in the specification and derive at least two
equivalence classes for it. One class represents the set of cases which
satisfy the condition (the valid class) and one represents cases which
do not (the invalid class ) Following are some general guidelines for
identifying equivalence classes:
alue is input to the system and must be within a range of
values, identify one valid class inputs which are within the valid range
and two invalid equivalence classes inputs which are too low and inputs
which are too high. For example, if an item in inventory can have a
quantity of - 9999 to + 9999, identify the following classes: 1. one
valid class: (QTY is greater than or equal to -9999 and is less than or
equal to 9999). This is written as (- 9999 < = QTY < = 9999) 2. the
invalid class (QTY is less than -9999), also written as (QTY < -9999) 3.
the invalid class (QTY is greater than 9999) , also written as (QTY
>9999)
b) If the requirements state that the number of items input by
the system at some point must lie within a certain range, specify one
valid class where the number of inputs is within the valid range, one
invalid class where there are too few inputs and one invalid class where
there are, too many inputs. For example, specifications state that a
maximum of 4 purchase orders can be registered against anyone product.
The equivalence classes are : the valid equivalence class: (number of
purchase orders is greater than or equal to 1 and less than or equal to
4 , also written as (1 < = no. of purchase orders < = 4) the invalid
class (no. of purchase orders> 4) the invalid class (no. of purchase
orders < 1)
c) If the requirements state that a particular input item
match one of a set of values and each case will be dealt with the same
way, identify a valid class for values in the set and one invalid class
representing values outside of the set. For example, if the requirements
state that a valid province code is ON, QU, and NB, then identify : the
valid class code is one of ON, QU, NB the invalid class code is not one
of ON, QU, NB
d) If the requirements state that a particular input item
match one of a set of values and each case will be dealt with
differently, identify a valid equivalence class for each element and
only one invalid class for values outside the set. For example, if a
http://www.onestoptesting.com/equivalence-partitioning/designing.asp# - - discount
|