Lecture-3
Lecture-3
Ayesha
Kanwal
Lecture No. 3
Review of Previous Lecture
2
G
i 1
i S
Valid Invalid
Equivalence Partitioning
Partition valid and invalid test cases into
equivalence classes
Equivalence Partitioning
Create a test case for at least one value from
each equivalence class
Example I (1)
Consider an application that takes an
integer as input
Let us suppose that the only legal
values are in the range [1..100]
Which input value(s) will you use to
test this application?
Example I (2)
The set of input values can be divided into
A set of expected, or legal, inputs (E) containing all
integers in the range [1..100]
A set of unexpected, or illegal, inputs (U ) containing
the remaining integers
All integers
U: Other integers
E: [1..100]
Example I (3)
Assume that the application is required to
process all values in the range [1..50] in
accordance with requirement R1 and those in the
range [51..100] according to requirement R2.
E is divided into two regions depending on the
expected behavior.
Also assume that all invalid inputs less than 1
are to be treated in one way while all greater
than 100 are to be treated differently.
This leads to a subdivision of U into two categories.
All integers
<1
[51..100] >100
[1..50]
Example I (4)
How many input values should we
use for testing the application?
Equivalence Partitioning
Test selection using equivalence partitioning
allows a tester to divide the input domain into a
relatively small number of sub-domains.
The sub-domains are disjoint.
Each subset is known as an equivalence class.
The four subsets shown in (a) constitute a partition
of the input domain while the subsets in (b) are
not.
What if there is more than one
input variable?
Unidimensional Partitioning
One way to partition the input domain is to
consider one input variable at a time. Thus each
input variable leads to a partition of the input
domain.
Task: Drive all valid and invalid classes and fill the below
table
Expected
# Test Data Classes Covered
Outcome
Any test data e.g. Name of your
1 T
xy,1 classes
A ticketing system where children under
age 6 are allowed to travel for free, people
under 18 as well as senior people older
than 64 pay $10 while adults need to pay
$20. For testing this system, we can use
equivalence class partitioning to design our
tests.
Derive equivalence classes for this system
Think of the boundaries while deriving the
classes
Boundary value analysis and equivalence
classes
Boundary Value Analysis
When choosing values from an equivalence class to test, use
the values that are most likely to cause the program to fail