equivalence partitions analysis

14
Equivalence Partitions Equivalence Partitions analysis:Goals, Examples analysis:Goals, Examples Vadym Muliavka June 2014

Upload: vadym-muliavka

Post on 15-Apr-2017

251 views

Category:

Software


6 download

TRANSCRIPT

Page 1: Equivalence partitions analysis

Equivalence Partitions Equivalence Partitions analysis:Goals, Examplesanalysis:Goals, Examples

Vadym MuliavkaJune2014

Page 2: Equivalence partitions analysis

Agenda1.What is equivalence partitioning (EP)?2.Coals & idea of EP3. When tests are equivalent?4.Test case design by EP5.Equivalence Partitioning Examples6.Pluses & minuses of EP technique

2/14

Page 3: Equivalence partitions analysis

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 therequirements specification for input attributes that influence theprocessing of the test object.

Idea: Dividing the test input data into a range of values andselecting one input value from each range

3/14

Page 4: Equivalence partitions analysis

Equivalence Partitions analysisEquivalence Partitions analysis

Equivalence classes

Boundary values

4/14

Input, output values

Page 5: Equivalence partitions analysis

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

Page 6: Equivalence partitions analysis

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

Page 7: Equivalence partitions analysis

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

Page 8: Equivalence partitions analysis

Equivalence Partitions analysisEquivalence Partitions analysis

Identify equivalence classes:• Input, output: clue from requirement;• Valid classes: legal input values; • Invalid classes: illegal or unacceptable input values;

8/14

Page 9: Equivalence partitions analysis

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

Page 10: Equivalence partitions analysis

Equivalence Partitions analysisEquivalence Partitions analysis

Example: Requirement for ‘Password’ field from “Add users modalwindow” of Admins actions menu: password field can not be shorter than 4and 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 >28invalid valid invalid

Page 11: Equivalence partitions analysis

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 – Fail2. Enter ‘50’ into ‘Count’ field– Pass3. Enter ‘330’ into ‘Count’ field– Fail4. Enter any word into ‘Count’ field – Fail5. Enter ‘(!@#$%^&’ into ‘Count’ field – Fail

Equivalance classes Case

less than 0 invalidbeetwen 0 and 255 validmore than 255 invalidstring invalidillegal characters invalid

11/14

Page 12: Equivalence partitions analysis

Equivalence Partitions analysisEquivalence Partitions analysis

Example: In a system designed for postal services' payment: Letters up to100g 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 shouldbe 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 – FailLetter 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

Page 13: Equivalence partitions analysis

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 determinetest cases. It has to be supplemented by boundary value analysis.

13/14

Page 14: Equivalence partitions analysis

Thank you for your attention!

14/14