Equivalence Class Testing
Equivalence Class Testing
-200 to -100
-101 to 0
1 to 100
101 to 200
30
20
10
Y
1
10
15
20
For ( x, y )
we have:
(24, 2)
(15, 8 )
( 4, 13)
(23, 17)
20
10
Y
1
10
15
20
We have covered
everyone of the 5
equivalence classes
for input X.
20
10
Y
1
10
15
20
20
10
Y
1
10
15
20
Is it a triangle?
Is it an isosceles?
Is it a scalene?
Is it an equilateral?
inputs
output
Not triangle
35
10
Equilateral
35
35
35
Isosceles
24
24
18
24
Isosceles
Scalene
Scalene
35
Valid Inputs
<1, 1, 1>
Equilateral
Not
Triangle
Isosceles
Scalene
201 >
50 >
201 >
50 >
b) There will be 7 more invalids when we consider the other corner , <1,1,1 >:
< 0, 0, 0 >
< 0, 0, 5 >
< 0, 10, 0 >
< 0, 8, 10>
<7, 0, 9 >
<8, 0, 0 >
<8, 9, 0 >
Day: 1 through 28
Day :29
Day: 30
Day: 31
4 partitions of days
3 partitions
of months
2 partitions
of years
What about the Strong Normal case where we consider all the
permutations of the previously partitioned 3 inputs?
We should have (2 years x 3 months x 4 days) = 24 test cases
(leap year, 10, 5)
(leap year, 10, 30)
(leap year, 10, 31)
(leap year, 10, 29)
(leap year, 6, 5)
(leap year, 6, 30)
(leap year, 6, 31)
(leap year, 6,29)
(non-leap year, 6, 5)
(non-leap year, 6, 30)
(non-leap year, 6, 31)
(non-leap year, 6, 29)
(leap year, 2, 5)
(leap year, 2, 30)
(leap year, 2, 31)
(leap year, 2, 29)
(non-leap year, 2, 5)
(non-leap year, 2, 30)
(non-leap year, 2, 31)
(non-leap year, 2, 29)
A little better
than previous?
31 < days
< 1
12 < months < 1
3000 < year
< 0001
( 0000, -2, 0)
( 0000, -2, 15)
( 0000, 4 , 0)
( 0000, 4, 10)
( 2000, -2, 0)
( 2000, -2, 10)
( 2000, 4, 0)
Cont.
If destination country code < 500 then add
1.00 JD to the call charge else add 0.50 JD to
the call charge.
If the receiving company code = 1 or 2 or 3
then add only 0.30 JD to the call charge else
add 2.00 JD.
Call duration of seconds are rounded up to
the next larger minute.
No call lasts more than 3 hours.
Cont.
Apply the following Equivalence Class
based testing techniques for this billing
function:
Weak normal equivalence class testing
Strong normal equivalence class testing
Weak robust equivalence class testing
Strong robust equivalence class testing
Valid relations
R1 = { Call Duration : 0.1 =< cd <= 180.0 }
R2 = { Destination Country : 1 =< dest <= 499}
R3 = { Destination Country : 500 =< dest <=
999 }
R4 = { Phone Company : 0.1 =< comp <=
180.0 }
R5 = { Call Time : 0.0 =< ct <= 10.00 }
R6 = { Call Time : 10.01 =< ct <= 17.00 }
R7 = { Call Time : 17.01 =< ct <= 23.59 }
Invalid relations
cd
dest
comp
ct
Expected Output
WN1
90.0
250
5.00
WN2
90.0
750
102
13.30
WN3
90.0
750
102
20.30