2. Agenda
1.What is equivalence partitioning (EP)?
2.Coals & idea of EP
3. When tests are equivalent?
4.Test case design by EP
5.Equivalence Partitioning Examples
6.Pluses & minuses of EP technique
2/14
3. Equivalence Partitions analysisEquivalence Partitions analysis
Equivalence partitioning (EP) – A black box
test design technique in which test cases
are designed to execute representatives
from equivalence partitions.
The equivalence partitions are usually derived from the
requirements specification for input attributes that influence the
processing of the test object.
Idea: Dividing the test input data into a range of values and
selecting one input value from each range
3/14
5. Equivalence Partitions analysisEquivalence Partitions analysis
Coals:
• To reduce the number of test cases to a necessary minimum
• To select the right test cases to cover all possible scenarios
(of course not to be absolutely sure);
• Maintaining acceptable test coverage.
Using this technique, the tester should be remembered that:
• Too many equivalence classes increases the likelihood that
multiple tests would be superfluous (excessive);
• Too few equivalence classes increases the likelihood that the
error will be skipped product.
5/14
6. Equivalence Partitions analysisEquivalence Partitions analysis
Two tests are considered equivalent if:
• They test the same thing (function module, part of the system).
• If one of the test catches an error, the other is also likely to
catch her;
• If one of them does not catch the error, then the other is also
likely will not catch.
6/14
7. Equivalence Partitions analysisEquivalence Partitions analysis
Test case design by EP proceeds into 2 steps:
• Identify equivalence classes;
• Choose one representative from each equivalence classes;
• Define the test cases.
7/14
9. Equivalence Partitions analysisEquivalence Partitions analysis
Define the test cases:
• Create a test case for each equivalence class.
• Assign a unique number to each equivalence class
• For valid case: until all valid equivalence classes have been
covered by test case, write a new test case covering as many
uncover valid equivalence classes as possible.
• For invalid case: until all invalid equivalence classes have
been covered by test case, write a new test case that cover one,
and only one, of the uncovered invalid equivalence classes.
9/14
10. Equivalence Partitions analysisEquivalence Partitions analysis
Example: Requirement for ‘Password’ field from “Add users modal
window” of Admins actions menu: password field can not be shorter than 4
and longer than 28 (including) characters (numeric and alphabetic)
Define and execute the test cases:
1. Password field contain 2 characters – Fail;
2. Password field contain 15 characters – Pass;
3. Password field contain 35 characters – Fail.
10/14
Equivalance classes
2 15 35
< 4 between 4 and 28 >28
invalid valid invalid
11. Equivalence Partitions analysisEquivalence Partitions analysis
Example: Requirement for ‘Count’ field from “Order page” of Manager:
Count field is numeric field, only integer number (0-255), not Alphabetic
(A - Z), (a-z) and special characters.
Define and execute the test cases:
1. Enter ‘-5’ into ‘Count’ field – Fail
2. Enter ‘50’ into ‘Count’ field– Pass
3. Enter ‘330’ into ‘Count’ field– Fail
4. Enter any word into ‘Count’ field – Fail
5. Enter ‘(!@#$%^&’ into ‘Count’ field – Fail
Equivalance classes Case
less than 0 invalid
beetwen 0 and 255 valid
more than 255 invalid
string invalid
illegal characters invalid
11/14
12. Equivalence Partitions analysisEquivalence Partitions analysis
Example: In a system designed for postal services' payment: Letters up to
100g are called as ‘light’.Postal rates for sending the light letters up to 10g are
$25. The next 40g should be played by $35. Each next 25g up to 100g should
be played by an extra $10. Partitions should be designed for “grams”.
Equivalance classes: Price
1) 0 – 10g: 25$
2) 11-50g: 35$
3) 51-75g: 45$
4) 76-100g: 55$
5) >100g -
Define and execute the test cases:
Letter has ‘-5’ g – Fail
Letter has ‘6’ g – Pass (25$)
Letter has ‘33’ g – Pass (35$)
Letter has ‘64’ g – Pass (+10$)
Letter has ‘88’ g – Pass (+10$)
Letter has ‘105’ g – Fail
12/14
13. Equivalence Partitions analysisEquivalence Partitions analysis
Pluses of EP technique:
• reducing the number of tests;
• reduction in testing time;
• improvement structured testing.
Minuses of EP technique:
• if misused technology we risk losing bugs.
Equivalence partitioning is no standalone method to determine
test cases. It has to be supplemented by boundary value analysis.
13/14