Professional Documents
Culture Documents
Software Engineering
LECTURER: SYED HASNAIN ABBAS BUKHARI
Testing Strategies
S y e d
H a s n a i n
A b b a s
B u k h a r i
Black Box Testing
S y e d
H a s n a i n
A b b a s
B u k h a r i
Test
Data
Genera+on
q Given
constraints
on
6me
and
cost,
the
key
issue
of
tes6ng
becomes:
What
subset
of
all
possible
test
cases
has
the
highest
probability
of
detec4ng
the
most
errors?
S y e d
H a s n a i n
A b b a s
B u k h a r i
Test
Data
Genera+on
q Exhaus6ve
black-‐box
and
white-‐box
tes6ng
are,
in
general,
impossible,
but
suggested
that
a
reasonable
tes6ng
strategy
might
be
elements
of
both.
S y e d
H a s n a i n
A b b a s
B u k h a r i
Black Box Testing
q Equivalence
Par++oning
q A
good
test
case
is
one
that
has
a
reasonable
probability
of
finding
an
error,
and
the
fact
is
that
an
exhaus6ve-‐input
tes6ng
of
a
program
is
impossible.
S y e d
H a s n a i n
A b b a s
B u k h a r i
Equivalence Partitioning
q Conversely,
if
a
test
case
did
not
detect
an
error,
we
would
expect
that
no
other
test
cases
in
the
equivalence
class
would
fall
within
another
equivalence
class,
since
equivalence
classes
may
overlap
one
another.
S y e d
H a s n a i n
A b b a s
B u k h a r i
Equivalence Partitioning
S y e d
H a s n a i n
A b b a s
B u k h a r i
Equivalence Class Partitioning
Following
are
the
guidelines
for
iden6fying
the
equivalence
classes
1. If
an
input
condi6on
specifies
a
range
of
values
(for
example,
“the
item
count
can
be
from
1
to
999”),
iden6fy
valid
equivalence
class
(1
<
item
count
<
999)
and
invalid
equivalence
classes
(item
count
<
1
and
item
count
>
999).i.e.
Test
Data
◦
Valid
class=
1
<
item
count
<
999
◦ In valid class= item count < 1 and item count > 999
2. If
an
input
condi6on
specifies
the
number
of
values
(for
example,
“one
through
six
owners
can
be
listed
for
the
automobile”),
iden6fy
valid
equivalence
class
and
invalid
equivalence
classes
(no
owners
and
more
than
six
owners).
S y e d
H a s n a i n
A b b a s
B u k h a r i
Equivalence Class Partitioning
3. If
an
input
condi6on
specifies
a
set
of
input
values
and
there
is
reason
to
believe
that
the
program
handles
each
differently
(e.g.
“type
of
vehicle
must
be
BUS,
TRUCK,
TAXICAB,
PASSENGER,
or
MOTORCYCLE”),
iden6fy
a
valid
equivalence
class
for
each
and
one
invalid
equivalence
class
(“TRAILER,”
for
example).
Test
Data
◦ Valid
class=
BUS,
TRUCK,
TAXICAB,
PASSENGER,
or
MOTORCYCLE
◦ In
valid
class=
Outside
Valid
Class….e.g.
(Trailer)
S y e d
H a s n a i n
A b b a s
B u k h a r i
Test Case (Important Things To Know)
2. Input
NOTE: None of the above should be missing in any test case
S y e d
H a s n a i n
A b b a s
B u k h a r i
Example
Equivalence Class Partitioning
S y e d
H a s n a i n
A b b a s
B u k h a r i
Equivalence Class Partitioning
q Inputs:
Accommoda6on
Expense
q Par++on
the
Input
Values:
q Test
Data
Valid
{0,…9}
11
digits
InValid
Outside
Valid
S y e d
H a s n a i n
A b b a s
B u k h a r i
Equivalence Class Partitioning
Test
Case
1
2
3
Input
(Expenses)
2000
350
3500
P.
tested
0<Expense<3000
0<Expense<3000
Expense>3000
Exp-‐output
OK
OK
Error
Message
S y e d H a s n a i n A b b a s B u k h a r i