Professional Documents
Culture Documents
Model Based Testing
Model Based Testing
Featuress
Testable e
Identifyy
Ge
ne se
Sp rate t- Ca
s s
ec T
ific es Te ion
a t t -C a te icat
r if
ion as ne ec
s e Ge Sp
Test Cases
Generate
Instantiate
Tests
t by req
st a tation
…to a finite
up e [US pho uest return
pick u
req nce s y) n
nt (co or EU e or w
na ntr
or by expresss courier
inte warra act resid eb
maintenancce station
a
number)
m (no num en
state
be t]
requesst at
r)
1 2
3
(contract n
Wait
W it for
f Maintenance
M i t Wait for
machine…
returning (no warranty) pick up
in
co val
nu tra id
n
esttimate
re
osts
m ct
up
je
be
pick
ct
co
r
e
st
im
at
e
4 5 Repair 6
Wait for accept
(maintenance repair completed Repaired
acceptance estimate
station)
a)
un or
(U
t( ir
pa
ab EU
S
n e
ne r
le
l
po s fu
to resi
m component s
re de
co e
cc
pa nt
ck arrives (a) su
ir )
la
ir
pa
re
7 8 Repair
l
sfu
Wait for
lack component (b) (regional
es
component
headquarters)
cc
su
component
arrives (b)
unable to
lac repair
unable to repair kc
om
(not US or EU resident) po
ne
component
p n t (c
arrives (c) )
9 Repair
(main
(c) 2007 Mauro Pezzè & Michal Young headquarters) Ch 14, slide 7
…to
to a test suite
TC2 0 5 2 4 5 6 0
TC3 0 3 5 9 6 0
TC4 0 3 5 7 5 8 7 8 9 6 0
Some specifications
p are structured as
decision tables, decision trees, or flow
charts. We can exercise these as if
they were program source code.
EduAc T F T -
BusAc - - - T
C.1b can be merged
CP > CT1 - - - F with an existing
YP > YT1 - - - F column (C
(C.10)
10) in the
spec
CP > CT2 - - - -
YP > YT2 - - - -
SP > Sc F F T T Outcome of
SP > T1 - - - - generated columns
must differ from
SP > T2 - - - - source column
out Edu * * SP
(c) 2007 Mauro Pezzè & Michal Young Ch 14, slide 17
Flowgraph based testing
If the specification
p or model has both
decisions and sequential logic, we can
cover it like p
program
g source code.
fl
flowgraph
h international
no
individual customer no
no no
yes
method of payement
yyes
credit card
no
abort order? payement
y status = valid
enter order
prepare receipt
yes
invalid order
(c) 2007 Mauro Pezzè & Michal Young Ch 14, slide 22
...from
from the flow graph to test cases
Branch testing: cover all branches
Too Ship Ship Cust Pay Same
Case Small Where Method Type Method Address CC valid
TC 1
TC-1 No Int Air Bus CC No Yes
TC-2 No Dom Land - - - -
TC-3 Yes - - - - - -
TC-4 No Dom Air - - - -
TC-5 No Int Land - - - -
TC-6 No - - Edu Inv - -
TC-7 No - - - CC Yes -
TC 8
TC-8 No - - - CC - No (abort)
No (no
TC-9 No - - - CC - abort)
Complex
p input
p is ((or can)) often be
described by a context-free grammar
• The Check-configuration
Check configuration function checks the
validity of a computer configuration.
• The
Th parameterst off check-configuration
h k fi ti are:
– Model
– Set of components