7. fit -...
TRANSCRIPT
Faku
ltät I
nfor
mat
ik, I
nstit
ut fü
r Sof
twar
e- u
nd M
ultim
edia
tech
nik,
Leh
rstu
hl fü
r Sof
twar
etec
hnol
ogie
11
. V
alid
atio
n
Prof
. D
r. U
. Aß
man
n Te
chni
sche
Uni
vers
ität
Dre
sden
In
stitu
t fü
r So
ftw
are-
und
Mul
timed
iate
chni
k G
rupp
e So
ftw
aret
echn
olog
ie
Vers
ion
WS1
2-0.
1, 2
6.10
.12
http
://s
t.in
f.tu
-dre
sden
.de
1.
Def
ensi
ve P
rog
ram
min
g
1.
Co
ntr
acts
2
. R
evie
ws
2.
Tes
ts 1.
Tes
t P
roce
sses
2
. R
egre
ssio
n T
ests
3
. Ju
nit
4
. FI
T
5.
Acc
epta
nce
Tes
ts
6.
Mo
del
-Bas
ed T
ests
7
. E
clip
se-B
ased
Tes
t T
oo
ls
Obl
igat
ory
Rea
ding
►
Alte
rnat
ivel
y ►
Mac
iasz
ek C
hapt
er 1
2 (i
s no
t en
ough
) ►
Zus
er K
apite
l 5,
9, 1
2 ►
Brü
gge
Kap
. 11
►
Adr
ion,
W.
R.,
Bra
nsta
d, M
. A.,
and
Che
rnia
vsky
, J.
C.
1982
. Val
idat
ion,
Ver
ifica
tion,
and
Tes
ting
of C
ompu
ter
Sof
twar
e. A
CM
Com
put.
Sur
v. 1
4, 2
(Ju
n. 1
982)
, 15
9-19
2. D
OI=
htt
p://
doi.a
cm.o
rg/1
0.11
45/3
5687
6.35
6879
►
SW
EBO
K 2
004
►
Kap
. 5
Test
en
http
://w
ww
.com
pute
r.or
g/po
rtal
/web
/sw
ebok
/htm
l/co
nten
tsch
5#ch
5 ►
Kap
. 11
Qua
lity
http
://w
ww
.com
pute
r.or
g/po
rtal
/web
/sw
ebok
/htm
l/ch
11
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
2
Rec
omm
ende
d Rea
ding
►
Uw
e Vig
ensc
how
. O
bjek
torien
tiert
es T
este
n un
d Te
stau
tom
atis
ieru
ng in
der
Pra
xis.
Kon
zept
e, T
echn
iken
und
Ver
fahr
en.
dpun
kt-V
erla
g H
eide
lber
g, 2
005
Ver
y go
od p
ract
ical
bo
ok o
n te
stin
g. R
ecom
men
ded!
►
Axe
l Sto
llfuß
und
Chr
isto
ph G
ies.
Rau
s au
s de
m T
al d
er T
räne
n.
Hya
des:
Ecl
ipse
als
Aut
omat
ed S
oftw
are
Qua
lity
Plat
tfor
m.
Eclip
se
Mag
azin
2/0
5. w
ww
.ecl
ipse
-mag
azin
.de
►
Ber
nhar
d Rum
pe.
Agi
le M
odel
lieru
ng m
it U
ML.
Spr
inge
r, 2
004.
Cha
pter
5 G
rund
lage
n de
s Te
sten
s, C
hapt
er 6
Mod
ellb
asie
rte
Test
s ►
Rob
ert
Bin
der.
Tes
ting
Obj
ect-
Orien
ted
Sys
tem
s. A
WL.
►
Fran
k W
estp
hal.
Uni
t Te
stin
g m
it JU
nit
und
FIT.
Dpu
nkt
2005
. ►
Ligg
esm
eyer
P.,
Sof
twar
e-Q
ualit
ät,
Hei
delb
erg:
Spe
ktru
m-V
erla
g 20
02,
523
S.,
ISBN
3-8
274-
1118
-1
►
http
://w
ww
.ope
nsou
rcet
estin
g.or
g/
►
http
://w
ww
.jun
it.or
g ►
http
://d
e.w
ikip
edia
.org
/wik
i/Li
ste_
von_
Mod
ulte
st-S
oftw
are
►
Kom
mer
ziel
le T
ools
htt
p://
ww
w.im
bus.
de/e
nglis
h/te
st-t
ool-
list/
►
Web
Tes
t To
ols
http
://w
ww
.sof
twar
eqat
est.
com
/qat
web
1.ht
ml
TU
Dre
sden
, P
rof.
U.
Aß
man
n
Valid
atio
n 3
Ver
ifica
tion
and
Val
idat
ion
Ø V
erif
icat
ion
of co
rrec
tnes
s:
• Pr
oof th
at t
he im
plem
enta
tion
conf
orm
s to
the
spe
cific
atio
n (c
orre
ctne
ss p
roof
) •
With
out
spec
ifica
tion
no p
roof
•
“bui
ldin
g th
e pr
oduc
t righ
t”
• Fo
rmal
ver
ific
atio
n:
Mat
hem
atic
al p
roof
•
Form
al M
eth
od:
a so
ftw
are
deve
lopm
ent
met
hod
that
ena
bles
for
mal
ve
rific
atio
n
Ø V
alid
atio
n:
• Pl
ausi
bilit
y ch
ecks
abo
ut c
orre
ct b
ehav
ior
(def
ensi
ve p
rogr
amm
ing,
suc
h as
re
view
ing,
tes
ts,
Cod
e Cov
erag
e Ana
lysi
s)
Ø T
est:
•
Val
idat
ion
of r
uns
of t
he s
yste
m u
nder
tes
t (S
UT)
und
er w
ell-
know
n co
nditi
ons,
w
ith t
he g
oal t
o fin
d bu
gs
Ø D
efen
sive
Pro
gra
mm
ing
: •
Prog
ram
min
g su
ch t
hat
less
err
ors
occu
r
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
4
Test
ing
show
s th
e pr
esen
ce o
f bug
s, b
ut n
ever
thei
r abs
ence
(Dijk
stra
)
Erro
r Rat
e an
d G
row
th o
f Com
plex
ity
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
1977
1994
Anz
ahl F
ehle
r auf
100
0 LO
C
20
0,2
1977
1994
Pro
gram
mgr
öße
(100
0 LO
C)
10
800
1977
1994
Res
ultie
rend
e ab
solu
te F
ehle
ranz
ahl
200
160
Echt
e Q
ualit
ätsv
erbe
sser
unge
n si
nd n
ur m
öglic
h, w
enn
die
Ste
iger
ung
der
Prog
ram
mko
mpl
exitä
t ü
ber
kom
pen
sier
t w
ird
!
5
Kat
egor
isie
rung
der
QS-M
aßna
hmen
Maß
nahm
en d
er S
oftw
are-
Qua
lität
ssic
heru
ng w
erde
n di
ffere
nzie
rt na
ch:
kons
truk
tiven
Qua
lität
ssic
heru
ngsm
aßna
hmen
anal
ytis
chen
Qua
lität
ssic
heru
ngsm
aßna
hmen
Fehl
erfin
dung
sstr
ateg
ien
Management der QS
Test
vorb
er.,
stat
isch
es u
nd d
ynam
isch
es T
este
n
Ana
lyse
D
esig
n Im
plem
en-
tieru
ng
Test
Fehl
erve
rmei
dung
sstr
ateg
ien
Met
hode
n-,
Wer
kzeu
g-,
Mod
ell-A
nwen
dung
Beg
utac
htun
g S
tichp
robe
B
ewei
s
Ver
ifika
tions
- un
d Val
idat
ions
-Tec
hnik
en
Abs
trak
tions
grad
VH
L
HL
LL
Valid
atio
ns-F
orm
alis
ieru
ng
ML
n. a
lg.
algo
r.
Que
lle: H
esse
, W.:
Met
hode
n un
d W
erkz
euge
zur
Sof
twar
e-E
ntw
ickl
ung:
E
inor
dnun
g un
d Ü
berb
lick;
Info
rmat
ik-F
achb
eric
hte
Bd.
43
Spr
inge
r Ver
lag
1981
axio
m.
Sem
antik
(H
OA
RE
)
PS
- Ve
rifik
. sy
stem
Programmsynthese
CD
R-
Verfa
hren
HD
M-
Verif
ik.
Interaktive Verifikations-Systeme
sym
bol.
Aus
führ
.
Test
fall-
G
ener
ator
en
Test
- E
rg.
Verg
l.
Test
- da
ten-
G
en.
(Um
gebu
ngs-
) S
imul
atio
n
Sta
t. Fl
uss-
an
alys
e
Programmzustands- Monitore (“Tracer”)
Fehlerbehebungs- hilfen
Dum
p
Walk- through
Code- Inspekt.
Verif
ikat
ion
Test
Sim
ulat
ion
Insp
ektio
n
Mod
el
chec
king
Test
- ab
deck
ungs
- M
onito
re
Inspektion höherer Bausteine
Verm
utun
g
Abs
tract
in
terp
reta
tion
11
.1 D
EFEN
SIV
E P
RO
GR
AM
MIN
G
Con
stru
ctiv
e qu
ality
man
agem
ent:
Red
uce
erro
rs b
y sa
fer
prog
ram
min
g...
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
8
11.1
.1 C
ontr
act
Che
ckin
g w
ith L
ayer
s Aro
und
Proc
edur
es
Ø A
sser
tions
in p
roce
dure
s ca
n be
use
d to
spe
cify
tes
ts (
cont
ract
ch
ecks
). U
sual
ly,
thes
e ar
e la
yere
d ar
ound
the
cor
e fu
nctio
nalit
y of
th
e pr
oced
ure
Ø P
rogr
amm
ing
styl
e of
“an
alys
e-an
d-st
op”:
ana
lyze
the
arg
umen
ts,
the
surr
ound
ing
of t
he a
rgum
ents
, an
d st
op p
roce
ssin
g w
ith e
xcep
tion
if er
ror
occu
rs
Ø S
ome
prog
ram
min
g la
ngua
ges,
e.g
., E
iffel
, pr
ovid
e co
ntra
ct c
heck
s in
the
la
ngua
ge
Ø V
alid
atin
g pr
econ
ditio
ns (
assu
mpt
ions
):
Ø S
ingl
e pa
ram
eter
con
trac
t ch
ecks
Ø P
olym
orph
ism
laye
r: a
naly
sis
of fin
er t
ypes
Ø N
ull c
heck
, Ex
cept
ion
valu
e ch
eck
Ø R
ange
che
cks
on in
tege
r an
d re
al v
alue
s Ø S
tate
ana
lysi
s: w
hich
sta
te s
houl
d w
e be
in?
Ø C
ondi
tion
anal
ysis
: in
varian
ts ful
fille
d?
Ø C
ross
-rel
atio
n of
par
amet
ers
Ø O
bjec
t w
eb c
heck
s (n
ull c
heck
s in
nei
ghbo
rs)
Ø I
nvar
iant
che
cks
Ø P
ostc
ondi
tion
chec
ks (
guar
ante
e)
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
9
Exam
ple:
Con
trac
t La
ngua
ge in
Eiff
el
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
10
Inva
rian
t Che
cks:
Ex.
: Tr
iang
le I
nvar
iant
Ø I
n a
tria
ngle
, th
e su
m o
f tw
o si
des
mus
t be
larg
er t
han
the
third
[Vig
ensc
how
]
Ø I
n a
tria
ngle
-man
ipul
atin
g pr
ogra
m,
this
is a
n in
varian
t:
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
public void paintTriangle(Triangle t) {
// preconditions
assertTrue(t != null);
assertTrue(t->s1 > 0 && t->s2 > 0 && t->s3 > 0);
// invariant check
assertTrue(isTriangle(t->s1, t->s2, t->s3));
// now paint.
....
// invariant check again
assertTrue(isTriangle(t->s1, t->s2, t->s3));
.. postconditions...
}
public boolean isTriangle(double s1, double s2, double s3){
return ((a+b > c) && (a+c > b) && b+c > a));
}
11
Impl
emen
tatio
n Pa
tter
n: C
ontr
act
Laye
rs
Ø C
ontr
act
chec
ks s
houl
d be
pro
gram
med
in s
peci
al c
heck
-pro
cedu
res
so t
hat
they
can
be
reus
ed a
s co
ntra
ct la
yers
Ø A
dvan
tage
: en
try
laye
rs c
an c
heck
con
trac
ts o
nce,
oth
er in
tern
al
laye
rs n
eed
no lo
nger
che
ck
pain
t()
mov
e()
scal
e()
pain
t()
mov
e()
scal
e()
isTr
iang
le()
is
Rec
tang
le()
isFi
gure
()
Con
tract
laye
r
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
12
Func
tiona
l lay
er
(priv
ate)
Wra
pper
, E
ntry
lay
er
(pub
lic)
Mod
el-B
ased
Con
trac
ts
Ø A
re s
peci
fied
in O
CL
(obj
ect
cons
trai
nt la
ngua
ge),
ref
erring
to
an
UM
L cl
ass
diag
ram
:
Ø M
ore
in C
hapt
er “
Val
idat
ion
with
OCL”
Ø T
hese
con
trac
ts c
an b
e ge
nera
ted
to c
ontr
act
code
for
met
hods
(c
ontr
act
inst
rum
enta
tion)
Ø C
ontr
act
chec
ker
gene
ratio
n is
tas
k of
Mod
el-d
rive
n te
stin
g (M
DT)
Ø M
ore
in s
peci
al le
ctur
e
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
context Person.paySalary(String name)
pre P1: salary >= 0 &&
exists Company company: company.enrolled.name == name
post P2: salary = salary@pre + 100 &&
exists Company company:
company.enrolled.name == name &&
company.budget = company.budget@pre - 100
13
11
.1.2
VA
LID
ATI
ON
WIT
H
INS
PEC
TIO
N A
ND
R
EVIE
WS
Con
stru
ctiv
e Q
M w
ith s
peci
fic d
evel
opm
ent
proc
esse
s
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
14
Che
cklis
ts
Ø P
roje
ct m
anag
ers
shou
ld p
ut u
p a
bunc
h of
che
cklis
ts for
the
mos
t im
port
ant
task
s of
the
ir p
roje
ct m
embe
rs a
nd t
hem
selv
es
Ø [
Pilo
ts u
se c
heck
lists
to
star
t th
eir
airp
lane
s]
Ø Q
uest
ion
lists
are
a s
peci
fic for
m o
f ch
eckl
ists
to
help
dur
ing
brai
nsto
rmin
g an
d qu
ality
ass
uran
ce
Ø h
ttp:
//w
ww
.rsp
a.co
m/s
pi/c
hkls
t.ht
ml#
Anc
hor-
4957
5
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
15
GU
I Fo
rm C
heck
list
Exam
ple
from
Baz
man
htt
p://
bazm
an.t
ripo
d.co
m/
1. D
oes
a fa
ilure
of va
lidat
ion
on e
very
fie
ld c
ause
a s
ensi
ble
user
err
or
mes
sage
? 2. I
s th
e us
er r
equi
red
to fix
ent
ries
whi
ch h
ave
faile
d va
lidat
ion
test
s?
3. H
ave
any
field
s go
t m
ultip
le v
alid
atio
n ru
les
and
if so
are
all
rule
s be
ing
appl
ied?
4. I
f th
e us
er e
nter
s an
inva
lid v
alue
and
clic
ks o
n th
e O
K b
utto
n (i
.e.
does
not
TAB o
ff t
he fie
ld)
is t
he in
valid
ent
ry id
entif
ied
and
high
light
ed c
orre
ctly
with
an
erro
r m
essa
ge.?
5. I
s va
lidat
ion
cons
iste
ntly
app
lied
at s
cree
n le
vel u
nles
s sp
ecifi
cally
re
quired
at
field
leve
l?
6. F
or a
ll nu
mer
ic fie
lds
chec
k w
heth
er n
egat
ive
num
bers
can
and
sho
uld
be a
ble
to b
e en
tere
d.
7. F
or a
ll nu
mer
ic fie
lds
chec
k th
e m
inim
um a
nd m
axim
um v
alue
s an
d al
so s
ome
mid
-ran
ge v
alue
s al
low
able
? 8. F
or a
ll ch
arac
ter/
alph
anum
eric
fie
lds
chec
k th
e fie
ld t
o en
sure
tha
t th
ere
is a
cha
ract
er li
mit
spec
ified
and
tha
t th
is li
mit
is e
xact
ly c
orre
ct
for
the
spec
ified
dat
abas
e si
ze?
9. …
……
.
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
16
Inte
rnal
Rev
iew
s
Ø I
nsp
ecti
on:
A c
olle
ague
rea
ds t
he p
rogr
amm
er’s
cod
e •
Insp
ectio
n ac
cord
ing
to a
pre
defin
ed c
heck
list
• Pr
ogra
mm
er e
xpla
ins
the
code
:
• Che
ck p
rogr
amm
ing
conv
entio
ns,
clar
ity o
f co
de,
use
of d
esig
n pa
tter
ns
• D
etec
t pr
oble
ms,
but
don
't so
lve
them
•
Oft
en n
eeds
a m
oder
ator
Ø W
alkt
hro
ug
h:
goin
g th
roug
h th
e co
de w
ith t
est
data
and
sim
ulat
e it
by h
and
• A p
roje
ct le
ader
sho
uld
grou
p he
r pe
ople
to
wal
kthr
ough
or
insp
ect
in p
airs
Ø R
evie
w fro
m a
noth
er g
roup
•
Mor
e fo
rmal
, W
ith e
xplic
it re
view
mee
ting,
dur
atio
n: 3
0-90
min
utes
•
Prot
ocol
: Em
ail o
r fo
rmal
doc
umen
t §
Part
icip
ants
, tim
e, d
urat
ion
§ N
ame,
ver
sion
, va
rian
t of
cod
e so
urce
s in
spec
ted
§ Rev
iew
issu
e lis
t §
Act
ions
det
erm
ined
•
A r
evie
w is
sue
data
base
is a
lso
nice
(si
mila
r to
a b
ug t
rack
ing
or r
equi
rem
ents
m
anag
emen
t sy
stem
) •
Bug
Tra
ckin
g D
atab
ase
http
://w
ww
.man
tisbt
.org
/
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
17
Pai
r pro
gram
min
g is
per
man
ent i
nspe
ctio
n
Pair P
rogr
amm
ing:
Per
man
ent
insp
ectio
n
Ø P
rogr
amm
ing
in p
airs
Ø A
pro
gram
mer
Ø A
n in
spec
tor
(rev
iew
er)
Ø C
hang
e ro
les
afte
r so
me
time
Ø P
sych
olog
y: N
ot e
very
body
like
s to
pro
gram
in p
airs
Ø E
gole
ss p
rogr
amm
ing
is d
esired
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
18
Rev
iew
s co
ntrib
ute
to q
ualit
y
Exte
rnal
Rev
iew
s
Ø M
ore
form
al:
• An
unre
late
d co
lleag
ue fro
m a
noth
er d
epar
tmen
t, o
r an
unr
elat
ed t
eam
rev
iew
s th
e co
de
Ø S
peci
al r
evie
w m
eetin
g Ø P
repa
re m
eetin
g by
dis
trib
utin
g al
l rel
evan
t do
cum
ents
Ø A
rev
iew
lead
er (
mod
erat
or)
guid
es t
hrou
gh t
he m
eetin
g
Ø F
orm
al p
roto
col:
Ø R
evie
w for
m is
oft
en s
tand
ardi
zed
for
a co
mpa
ny
Ø S
peci
ficat
ions
can
als
o be
rev
iew
ed (
requ
irem
ents
spe
cs,
desi
gn
spec
s)
Ø F
ind
out
inco
nsis
tenc
ies
with
sou
rce
code
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
19
Aud
its
Ø M
ost
form
al k
ind
of e
xter
nal r
evie
w
Ø P
rofe
ssio
nal a
udito
rs (
qual
ity a
ssur
ance
per
sone
l) fro
m Q
A
depa
rtm
ents
, or
eve
n ex
tern
al c
ompa
nies
•
Prod
ucer
may
be
abse
nt,
audi
ting
can
be d
one
from
doc
umen
ts a
lone
Ø A
udits
tak
e lo
nger
tha
n re
view
s •
Plan
ning
pha
se
• Aud
its c
onta
in s
ever
al r
evie
ws
Ø A
udits
can
als
o ch
eck
the
•
finan
cial
bud
gets
: Aud
itors
che
ck h
ow t
he m
oney
was
spe
nt (
time
shee
ts,
trav
el,
labo
r co
st,
...)
•
plan
ning
•
conf
orm
ance
to
law
(co
mpl
ianc
e)
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
20
A G
ener
al H
eurist
ic:
Tigh
t Fe
edba
ck L
oops
Ø S
oftw
are
proc
esse
s ar
e hi
ghly
dyn
amic
. It
is h
ard
to p
re-p
lan
them
. Ø I
nsta
ll pr
oces
s gu
idel
ines
tha
t le
ad t
o tig
ht fee
dbac
k lo
ops:
Ø F
eedb
ack
early,
oft
en,
freq
uent
ly.
Ø B
ette
r ea
rly
light
fee
dbac
k th
an la
te t
horo
ugh
feed
back
Ø F
or r
evie
ws,
thi
s m
eans
: re
view
ear
ly,
revi
ew o
ften
.
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
21
11
.2.
VA
LID
ATI
ON
WIT
H
TES
TS
Ana
lytic
QM
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
22
The
Prob
lem
Ø P
rogr
amm
ers
prog
ram
und
er t
ime
pres
sure
(on
-dem
and)
Ø P
rogr
amm
ers
prog
ram
on-
dem
and,
bec
ause
pro
gram
min
g is
har
d Ø D
omai
n pr
oble
ms
Ø S
peci
al c
ases
are
for
gott
en
Ø T
he e
ffec
t of
use
rs is
und
eres
timat
ed
Ø [
The
dem
o ef
fect
] Ø A
write
r ne
ver
finds
his
ow
n bu
gs (
Bet
rieb
sblin
dhei
t)
Ø T
ests
hav
e de
stru
ctiv
e, n
egat
ive
natu
re
Ø I
t is
not
eas
y to
con
vinc
e on
esel
f to
be
nega
tive!
Ø Q
ualit
y as
sura
nce
peop
le c
an e
nsur
e th
is,
ensu
ring
a r
easo
nabl
e so
ftw
are
proc
ess
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
23
Wie
viel
sie
ht d
er T
est
vom
SU
T?
Ø S
tati
sch
e P
rog
ram
man
alys
e, o
hne
dass
das
Pro
gram
m
ausg
efüh
rt w
ird
Ø D
ynam
isch
e P
rog
ram
man
alys
e du
rch
Aus
führ
ung
(ode
r Sim
ulat
ion)
in e
iner
gee
igne
ten
Test
umge
bung
mit
ausg
esuc
hten
Te
stda
ten
“Bla
ck-B
ox”
Test
“G
rey-
Box
” Te
st
“W
hite
-Box
” Te
st
Funk
tions
abde
ckun
g “B
ack-
to-B
ack”
-Tes
t S
truk
tura
bdec
kung
Ä
quiv
alen
zkla
ssen
anal
yse
Tes
t spe
ziel
ler W
erte
Cod
eübe
rdec
kung
G
renz
wer
tana
lyse
zus
tand
sbas
ierte
r Tes
t A
nwei
sung
sübe
rdec
kg.
intu
itive
Tes
tfalle
rmitt
lung
Zw
eigü
berd
ecku
ng
Zufa
llste
st E
ntsc
heid
ungs
über
d.
Fehl
erer
war
tung
Weg
-Übe
rdec
kung
Prüf
tech
nike
n im
(dy
nam
isch
en)
Test
►
Str
ukt
uro
rien
tier
ter
Test
(m
eist
Gre
ybox
ode
r W
hite
box)
n
Kon
trol
lflus
sorien
tiert
(M
aß für
die
Übe
rdec
kung
des
Kon
trol
lflus
ses)
n
Anw
eisu
ngs-
, Zw
eig-
, Bed
ingu
ngs-
und
Pfa
dübe
rdec
kung
stes
ts
n
Dat
enflu
ssor
ient
iert
(M
aß für
die
Übe
rdec
kung
des
Dat
enflu
sses
) n
Def
s-/U
ses
Krite
rien
, Req
uire
d k-
Tupe
ls-T
est,
Dat
enko
ntex
t-Ü
berd
ecku
ng
►
Fun
ktio
nso
rien
tier
ter
Test
(Te
st g
egen
ein
e Spe
zifik
atio
n, m
eist
Bla
ckbo
x)
n
Äqu
ival
enzk
lass
enbi
ldun
g, Z
usta
ndsb
asie
rter
Tes
t, U
rsac
he-W
irku
ng-A
naly
se z
. B.
mitt
els
Urs
ache
-Wirku
ngs-
Dia
gram
m,
Tran
sakt
ions
fluss
basi
erte
r Te
st,
Test
au
f Bas
is v
on E
ntsc
heid
ungs
tabe
llen
►
Div
ersi
fizi
eren
der
Tes
t (V
ergl
eich
der
Tes
terg
ebni
sse
meh
rere
r Ver
sion
en)
n
Reg
ress
ions
test
, Bac
k-To
-Bac
k-Te
st,
Mut
atio
nen-
Test
►
Son
stig
e M
isch
form
en
n
Ber
eich
stes
t bz
w.
Dom
ain
Test
ing
(Ver
allg
emei
neru
ng d
er
Äqu
ival
enzk
lass
enbi
ldun
g),
Erro
r gu
essi
ng,
Gre
nzw
erta
naly
se,
Zus
iche
rung
stec
hnik
en
[Lig
gesm
eyer
] ht
tp://
de.w
ikip
edia
.org
/wik
i/Sof
twar
etes
t
Test
ing
wen
det
den
“Pol
ya C
ycle
” an
►
Geo
rge
Poly
a. H
ow t
o Sol
ve I
t (1
945)
.
PLA
N
DO
C
HE
CK
AN
ALY
ZE
„Und
erst
and
the
prob
lem
“
Test
-Man
agem
ent
Que
lle: M
ülle
rbur
g, M
. u.a
.(Hrs
g.):
Test
, Ana
lyse
und
Ver
ifika
tion
von
Sof
twar
e; G
MD
-Ber
icht
Nr.
260,
R
. Old
enbo
urg
Verla
g 19
96 S
.115
Testorganisation
Testdokumentation Fu
nktio
nale
S
pezi
fikat
ion/
Ve
rträg
e P
rogr
amm
Test
fall-
er
mitt
lung
Test
date
n-
gene
rieru
ng
Test
- du
rchf
ühru
ng
Test
- au
swer
tung
Mon
itorin
g (D
ebug
ging
)
Sol
lwer
t- be
stim
mun
g
(Tes
tpla
nung
) (T
este
ntw
urf,
-spe
zfik
atio
n)
(Tes
tübe
rwac
hung
)
PLA N
2.2
.1 T
EST
PR
OC
ESS
ES
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
28
Sta
ndar
d Te
st P
roce
ss a
s Rig
ht W
ing
of t
he V
Mod
el
Ø T
ests
sho
uld
be d
one
bott
om-u
p
Ø D
efen
sive
pro
gram
min
g (c
ontr
acts
) Ø T
hen
unit
test
s (c
lass
tes
ts)
Ø T
hen
com
pone
nt t
ests
(EJ
B,
JSP
etc)
Ø T
hen
the
syst
em
Ø T
hen
the
beta
tes
t Ø T
hen
acce
ptan
ce t
est
Ana
lysi
s Arc
hite
ctur
al
desi
gn
Det
. Des
ign
Impl
emen
tiatio
n
Inst
alla
tion,
be
ta te
st
Sys
tem
test
s
Com
pone
nt te
sts
in
tegr
atio
n te
sts
Con
tract
s, c
lass
te
sts
Test
ca
ses
Acc
epta
nce
test
Test
ca
ses
Test
ca
ses
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
29
The
Cle
anro
om M
etho
d
Ø T
he C
lean
room
met
hod
divi
des
the
proj
ect
mem
bers
into
pr
ogra
mm
ers
and
test
ers.
Ø D
evel
oper
mus
t de
liver
a r
esul
t al
mos
t w
ithou
t bu
gs
Ø T
estin
g fo
rbid
den!
Ø I
ncre
men
tal p
roce
ss
Ø E
xper
ienc
e w
ith C
lean
room
Met
hod
Ø S
elby
tes
ted
Cle
anRoo
m w
ith 1
5 Stu
dent
Tea
ms,
10
Cle
anro
om/5
non
-Cle
anro
om
Ø C
lean
room
-Tea
ms
prod
uce
sim
pler
cod
e w
ith m
ore
com
men
ts
Ø 8
1% w
ant
to u
se it
aga
in
Ø A
ll Cle
anro
om t
eam
s m
anag
e m
ilest
ones
, 3
of 5
non-
Cle
anro
om t
eam
s no
t.
Ø B
ut:
prog
ram
mer
s do
not
hav
e th
e sa
tisfa
ctio
n to
run
the
ir c
ode
them
selv
es
Ø O
nly
the
prob
lem
s w
ith for
mal
spe
cific
atio
n
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
30
Cle
anRoo
m in
the
NASA
Ø I
n 19
87,
the
NASA d
evel
oped
a 40
KLO
C c
ontr
ol p
rogr
am for
sa
telli
tes
with
Cle
anro
om
Ø D
istr
ibut
ion
of p
roje
ct t
ime:
Ø 4
% Tr
aini
ng s
taff in
Cle
anro
om,
Ø 3
3% d
esig
n Ø 1
8% I
mpl
emen
tatio
n (
45%
writin
g, 5
5% r
evie
win
g),
Ø 2
7% T
estin
g,
Ø 2
2% O
ther
thi
ngs
(e.g
., m
eetin
gs)
Ø I
ncre
ase
in p
rodu
ctiv
ity 6
9%.
Ø R
educ
tion
of e
rror
rat
e 45
%.
Ø R
esou
rce
redu
ctio
n 6
0-80
%.
Ø D
evel
oper
s, p
rohi
bite
d to
tes
t th
eir
code
, re
ad in
tens
ivel
y. T
his
catc
hes
man
y bu
gs (
~30
bug
s fo
r 1K
LOC).
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
31
Mic
roso
ft's
Sof
twar
e Pr
oces
s “S
ynch
roni
ze a
nd S
tabi
lize”
Ø .
. is
a C
lean
Roo
m p
roce
ss:
Ø M
icro
soft
bui
lds
soft
war
e un
til 1
2:00
(sy
nchr
oniz
atio
n)
Ø I
n th
e af
tern
oon,
tes
t su
ites
are
run
by t
he t
est
team
s, i.
e.,
sepa
ratio
n of
pro
gram
mer
and
tes
ter
Ø P
rogr
amm
ers
get
feed
back
the
nex
t da
y Ø [
IBM
tes
ts in
Chi
na]
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
32
11
.2.2
REG
RES
SIO
N T
ESTS
How
to
be s
ure
that
a c
hang
e di
d no
t in
trod
uce
erro
rs..
. D
iver
sify
ing
test
s
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
33
Tim
e
Reg
ress
ion
Test
s as
Diff
s on
Out
puts
of Sub
sequ
ent
Ver
sion
s
Ø R
egre
ssio
n te
sts
are
oper
ator
s th
at c
heck
sem
antic
iden
tity
betw
een
vers
ions
tha
t ha
ve s
imila
r in
put/
outp
ut r
elat
ion
Ø E
nhan
cem
ent
test
s te
st e
nhan
ced
func
tiona
lity
Reg
ress
ion
Test
R
egre
ssio
n Te
st
Enha
ncem
ent
Test
Inpu
t
Out
put
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
34
diff
A P
oor
Man
's R
egre
ssio
n Te
stin
g En
viro
nmen
t
Ø
The
UN
IX t
ool d
iff is
abl
e to
tex
tual
ly c
ompa
re file
s an
d di
rect
orie
s (r
ecur
sive
ly)
Sto
re in
sub
dir 1
.1
subd
ir 0.
9 S
ubdi
r 1.1
Syst
em u
nder
te
st (
sut)
diff
subd
ir1.0
su
t.out
put1
sut.o
utpu
t2
sut.o
utpu
t2
sut.
outp
ut1
sut.
outp
ut2
sut.
outp
ut3
sut.
outp
ut1
sut.
outp
ut2
sut.
outp
ut3
sut.o
utpu
t1
sut.o
utpu
t2
sut.o
utpu
t3
sut.i
nput
1
sut.i
nput
2
sut.i
nput
3
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
35
Diff
Lis
tings
for
Reg
ress
ion
Test
s
Ø D
iff s
how
s lin
es t
hat
have
bee
n re
mov
ed fro
m first
file
(<
) “w
ent
out”
and
add
ed t
o th
e se
cond
(>
) “c
ame
in”
Ø D
iff in
voca
tions
are
wired
tog
ethe
r fo
r te
st s
uite
s w
ith s
hell
script
s or
mak
efile
s Ø O
n w
indo
ws,
use
cyg
win
she
ll (w
ww
.cyg
win
.org
)
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
diff file~1.1 file~1.0
< if (threshold < 0.9) stopPowerPlant();
> if (threshold > 0.9) stopPowerPlant();
-- compares entire directory to subdirectory
1.0
diff -rq . 1.0
./subdir/f.c:
< if (threshold < 0.9) stopPowerPlant();
> if (threshold > 0.9) stopPowerPlant();
36
Var
iant
s of
Reg
ress
ion
Test
s
Ø [
Bin
der]
dis
tingu
ishe
s 5
cove
rage
pat
tern
s fo
r re
gres
sion
tes
ts:
Ø A
ll (e
xhau
stiv
e):
best
Ø R
isky
use
cas
es
Ø R
e-te
st p
rofil
e: p
rofil
e co
de a
nd r
e ex
ecut
e te
sts
on m
ost
exec
uted
co
de
Ø C
hang
ed c
ode
(cod
e th
at c
hang
ed b
etw
een
vers
ions
) Ø C
hang
ed c
ode
and
all d
epen
dent
cod
e
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
37
Impo
rtan
ce o
f Reg
ress
ion
test
s
Ø R
egre
ssio
n te
sts
are
the
mos
t im
port
ant
mec
hani
sm t
o en
sure
qu
ality
if a
pro
duct
app
ears
in s
ubse
quen
t ve
rsio
ns
Ø W
ithou
t re
gres
sion
tes
t, n
o qu
ality
Ø C
ompa
nies
sel
l tes
t da
ta s
uite
s fo
r re
gres
sion
tes
ts
Ø V
alid
atio
n su
ites
for
com
pile
rs (
e.g.
, Ada
or
XM
L)
Ø V
alid
atio
n su
ites
for
data
base
s Ø T
est
data
gen
erat
ors
that
gen
erat
e te
st d
ata
suite
s fr
om g
ram
mar
s Ø T
est
case
gen
erat
ors
Ø T
he m
ore
elab
orat
ed y
our
regr
essi
on t
est
met
hod
is,
the
bett
er
your
pro
duct
will
be
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
38
GU
I Reg
ress
ion
Test
with
Cap
ture
/Rep
lay
Tool
s
Ø A
cap
ture
too
l al
low
s fo
r re
cord
ing
user
act
ions
at
a G
UI
Ø R
ecor
ding
in m
acro
s or
scr
ipts
Ø A
rep
lay
tool
rea
ds t
he s
crip
ts a
nd g
ener
ates
eve
nts
that
are
fed
in
to t
he s
yste
m
Ø T
he r
epla
y to
ol c
an b
e st
arte
d in
bat
ch,
i.e.,
can
be
inte
grat
ed in
to a
reg
ress
ion
test
sui
te
Ø H
ence
, th
e G
UI
can
be r
egre
ssio
n te
sted
Ø C
aptu
re/r
epla
y to
ols
can
reco
rd t
he m
ost
impo
rtan
t w
orkf
low
s ho
w
syst
ems
are
used
Ø O
peni
ng d
ocum
ents
, cl
osin
g, s
avin
g Ø E
xcep
tion
situ
atio
ns
Ø E
ven
big
offic
e su
ites
seem
not
to
be t
este
d w
ith c
aptu
re/r
epla
y to
ols
Ø E
xam
ples
: Ø M
ercu
ry I
nter
activ
e W
inRun
ner
ww
w.m
ercu
ryin
tera
ctiv
e.de
Ø R
atio
nal R
obot
ww
w-3
06.ib
m.c
om/s
oftw
are/
ratio
nal
Ø A
bbot
- h
ttp:
//ab
bot.
sour
cefo
rge.
net/
doc/
over
view
.sht
ml
Ø J
elly
tool
s is
a J
Uni
t-de
riva
tive
for
test
of Sw
ing-
GU
I Ø w
eb2t
est
from
Lei
pzig
htt
p://
ww
w.s
axxe
ss.c
om/c
onte
nt/1
4615
.htm
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
39
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
40
11
.2.3
TH
E JU
NIT
R
EGR
ESS
ION
-TES
T FR
AM
EWO
RK
(Rep
etiti
on fro
m S
oftw
aret
echn
olog
ie)
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
41
The
JU
nit
Reg
ress
ion-
Test
Fra
mew
ork
Ø J
Uni
t w
ww
.JU
nit.
org
is a
sim
ple
fram
ewor
k fo
r re
gres
sion
tes
ts o
f cl
asse
s an
d co
mpo
nent
s
Ø R
un t
est
case
s an
d te
st s
uite
s
Ø P
lugi
ns for
ID
E av
aila
ble
(Ecl
ipse
, JB
uild
er,
..)
Ø A
vaila
ble
for
seve
ral l
angu
ages
Ø N
unit
for
.NET
Ø C
ppU
nit
for
C+
+
Ø T
est
resu
lt cl
assi
ficat
ion:
Ø F
ailu
re (
Zus
iche
rung
wird
zur
Lauf
zeit
verlet
zt)
Ø E
rror
(U
nvor
herg
eseh
enes
Ere
igni
s, z
.B.
Abs
turz
) Ø O
k
Ø J
Uni
t su
ppor
ts p
erm
anen
t re
gres
sion
tes
ting
during
dev
elop
men
t:
Ø A
ll te
st c
ases
are
col
lect
ed a
nd r
epea
ted
over
and
ove
r ag
ain
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
42
JUni
t Fr
amew
ork
run(
Test
Res
ult)
Test
run(
Test
Res
ult)
runT
est()
se
tUp(
) te
arD
own(
)
Test
Cas
e
Stri
ng n
ame
run(
Test
Res
ult)
add(
) Test
Sui
te
Com
posi
te Com
posi
te
Leaf
Com
pone
nt
Test
Res
ult
setU
p();
runT
est()
; te
arD
own(
);
MyT
estC
ase
.. in
it of
test
dat
a ru
nTes
t()
setU
p()
tear
Dow
n()
Text
Test
Res
ult UIT
estR
esul
t
... re
ason
why
faile
d ...
test
dat
a Te
mpl
ate
Met
hod
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
43
Exam
ple:
Tes
t of
Dat
es
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
// A class for standard representation of dates.
public class Date {
public int day; public int month; public int
year;
public Date(String date) {
day = parseDay(date);
month = parseMonth(date);
year = parseYear(date);
}
public int equals(Date d) {
return day == d.day &&
year == d.year &&
month == d.month;
}
}
44
New
Tes
tCas
e
Ø T
estC
ases
are
met
hods
, st
art
with
pre
fix “t
est”
Ø T
est
case
s co
ntai
n te
st d
ata
in a
fix
ture
Ø P
robl
em:
test
dat
a is
inte
grat
ed w
ith t
est
case
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
public class DateTestCase extends TestCase {
Date d1;
Date d2;
Date d3;
int length = 42;
protected int setUp() {
d1 = new Date(„1. Januar 2006“);
d2 = new Date(„01/01/2006“);
d3 = new Date(„January 1st, 2006“);
}
public int testDate1() {
assert(d1.equals(d2));
assert(d2.equals(d3));
assert(d3.equals(d1));
.... more to say here ....
}
public int testDate2() {
.... more to say here ....
}
}
45
Exam
ple:
Tes
t Cas
e in
Nun
it (.
Net
) an
d JU
nit
4.0
Ø T
ags
are
used
to
indi
cate
tes
t ca
se c
lass
es,
set
up,
tear
dow
n m
etho
ds
Ø T
he t
ags
are
met
adat
a th
at c
onve
y ad
ditio
nal s
eman
tics
for
the
item
s
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
46
Use
of Te
st C
ase
Cla
sses
Ø A
tes
t ca
se is
cre
ated
by
calli
ng t
he c
onst
ruct
or
Ø T
he c
onst
ruct
or fin
ds t
he m
etho
d of
the
giv
en m
etho
d na
me
and
prep
ares
it for
cal
l (re
flect
ion)
Ø T
he r
un()
met
hod
star
ts t
he t
est
case
with
the
fix
ture
and
ret
urns
a
test
res
ult
Ø I
n ca
se o
f a
failu
re,
an e
xcep
tion
is r
aise
d
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
public class TestApplication {
...
TestCase tc = new DateTestCase(„testDate1“);
TestResult tr = tc.run();
}
47
Test
Sui
tes
Ø A
tes
t su
ite is
a c
olle
ctio
n of
tes
t ca
ses
(pat
tern
Com
posi
te)
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
public class TestApplication {
...
TestCase tc = new DateTestCase(„testDate1“);
TestCase tc2 = new DateTestCase(„testDate2“);
TestSuite suite = new TestSuite();
suite.addTest(tc);
suite.addTest(tc2);
TestResult tr = suite.run();
// Nested test suites
TestSuite subsuite = new TestSuite();
... fill subsuite ...
suite.addTest(subsuite);
TestResult tr = suite.run();
}
48
Test
Run
ner
GU
I
Ø T
he c
lass
es JU
nit.
awtu
i.Tes
tRun
ner,
JU
nit.
swin
gui.T
estR
unne
r ar
e si
mpl
e G
UIs
to
pres
ent
test
res
ults
Ø T
est
suite
s ca
n be
giv
en t
he c
lass
obj
ect
of a
tes
t ca
se,
and
it fin
ds
the
test
cas
e m
etho
ds o
n its
ow
n (r
efle
ctio
n)
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
public class TestApplication {
public static Test doSuite() {
// Abbreviation to create all TestCase objects
// in a suite
TestSuite suite = new TestSuite(DateTestCase.class);
}
// Starte the GUI with the doSuite suite
public static main () {
JUnit.awtui.TestRunner.run(doSuite());
}
}
49
11.2
.4 F
IT T
estin
g Fr
amew
ork
Ø F
IT is
an
acce
ptan
ce a
nd r
egre
ssio
n te
stin
g fr
amew
ork
Ø A
sof
twar
e te
stin
g to
ol d
esig
ned
for
cust
omer
s w
ith li
mite
d IT
kn
owle
dge
Ø T
est
case
s ca
n be
spe
cifie
d in
tab
les
• W
iki
• Ex
cel
• H
TML
• D
OC
• …
.
Ø F
it te
st t
able
s ar
e ea
sy t
o be
rea
d an
d w
ritt
en b
y cu
stom
er
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
50
FIT
Test
ing
Fram
ewor
k
Ø S
tory
-bas
ed t
ests
•
Sto
red
in t
est
tabl
es
Ø P
arse
inpu
t an
d in
voke
met
hods
th
roug
ht r
efle
ctio
n
Ø F
itRun
ner
to s
tart
the
tes
t
(Com
man
d lin
e)
Ø C
an b
e co
mbi
ned
with
GU
I ro
bots
like
Abb
ot
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
51
11.2
.5 A
ccep
tanc
e Te
sts
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
Dom
ain
Ana
lysi
s (D
omai
n co
ncep
ts)
Prob
lem
Ana
lysi
s
Goa
l Ana
lysi
s
Func
tion
Ana
lysi
s
Proj
ect
Task
Pla
nnin
g
Sta
keho
lder
Ana
lysi
s (B
etei
ligte
nana
lyse
)
Qua
lity
Ana
lysi
s (N
on-f
unct
iona
l Req
s) O
ther
Ana
lysi
s
Acc
epta
nce
Crite
ria
Ana
lysi
s Acc
epta
nce
Test
“rea
l” re
quire
men
ts a
naly
sis
Feas
ibili
ty S
tudy
(L
aste
nhef
t)
52
Acc
epta
nce
Test
Ø A
ccep
tanc
e te
st c
ases
are
par
t of
the
SRS
Ø A
re c
heck
ed b
y th
e cu
stom
er for
ful
fillm
ent
of t
he c
ontr
act
Ø W
ithou
t pa
ssin
g, n
o m
oney
!
Ø A
ccep
tanc
e te
sts
are
syst
em t
ests
Ø R
un a
fter
sys
tem
dep
loym
ent
Ø T
est
entir
e sy
stem
und
er lo
ad
Ø T
est
also
non
-fun
ctio
nal q
ualit
ies
Ø A
fter
eve
ry e
volu
tion
step
, al
l acc
epta
nce
test
cas
es h
ave
to b
e re
peat
ed
Ø R
egre
ssio
n te
st:
Ø S
houl
d-Be-
outp
uts
are
com
pare
d w
ith a
ctua
l out
puts
Ø C
onsi
sts
of a
set
of te
st c
ases
(a
test
sui
te)
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
53
Der
ivin
g Te
st C
ases
fro
m F
unct
iona
l Spe
cific
atio
ns
Ø M
ost
ofte
n, a
ccep
tanc
e te
sts
are
derive
d fr
om u
se c
ases
, fu
nctio
n tr
ees,
or
busi
ness
mod
els
Ø E
very
use
cas
e yi
elds
at
leas
t on
e ac
cept
ance
tes
t ca
se
Ø F
or e
very
tes
t ca
se,
a te
st d
rive
r is
writt
en
Org
anis
ator
Team
m
embe
r
Find
out
ab
out u
nuse
d ro
oms
Roo
m
man
ager
Mov
e m
eetin
g
Pla
n pe
rson
al d
ate
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
Term
inve
rwal
tung
Org
aniz
e m
eetin
g
54
Test
s an
d Tu
torial
s
Ø S
ome
test
cas
es c
an b
e w
ritt
en in
a u
ser-
frie
ndly
sty
le (
tuto
rial
tes
t ca
ses)
.
Ø I
f th
ey a
re e
nric
hed
with
exp
lana
tions
, tu
torial
thr
eads
res
ult
Ø H
ence
, so
rt o
ut s
ome
test
cas
es for
tut
oria
l tes
t ca
ses
Ø [
Java
doc
umen
tatio
n]
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
55
Test
-First
Dev
elop
men
t (T
est-
Drive
n D
evel
opm
ent)
Ø I
tera
te:
Ø F
irst
, fix
the
inte
rfac
e of
a m
etho
d Ø S
econ
d, w
rite
a t
est
case
aga
inst
the
inte
rfac
e Ø T
hird
, pr
ogra
m m
etho
d.
Ø F
ourt
h, R
un t
est
case
. If
tes
t ca
se w
orks
, ad
d it
to t
he c
urre
nt t
est
suite
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion Add
a t
est
Run
tes
ts
-> s
ee
failu
re
Write
som
e co
de
Run
the
te
sts
->
see
all p
ass
Refa
ctor
56
Test
-First
Dev
elop
men
t (T
est-
Drive
n D
evel
opm
ent)
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
Ø A
dvan
tage
s Ø P
erm
anen
t re
gres
sion
tes
t (t
est
data
inte
grat
ed)
Ø S
tabl
e ex
tens
ion
of t
he c
ode:
no
big
bang
tes
t, c
olle
ctio
n of
tes
t ca
ses
alw
ays
runn
ing
Ø F
unct
iona
lity
so far
can
alw
ays
be d
emon
stra
ted
Ø T
DD
is li
ke a
utom
atin
g th
e re
view
er:
the
test
cas
e pl
ays
the
role
of
the
criti
cizi
ng c
olle
ague
!
57
Cla
ssifi
catio
n of
Tes
t Cas
es
Ø G
iven
a fun
ctio
n f un
der
test
with
y
= f(x
).
Ø x
and
y c
an b
e va
lues
or
obje
ct g
raph
s [R
umpe
04].
Po
ssib
le p
atte
rns
for
test
cas
es:
Ø E
qual
ity t
ests
x =
= y
Ø D
iffer
ence
pre
dica
te:
Pre
dica
te(x
, f(
x))
Ø F
eatu
re t
ests
:
Pre
dica
te(f
(x))
Ø E
quiv
alen
ce c
lass
tes
t:
f(x
) =
==
e fro
m e
quiv
alen
ce c
lass
Ø A
bstr
actio
n te
st:
A
bstr
actio
n(f(
x))
= A
bstr
actio
n(z)
with
a
fix z
Ø I
dent
ity t
est:
f
-1(f
(x))
= x
Ø O
racl
e fu
nctio
n:
f(x
) =
ora
cle(
x)
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
58
Sep
arat
ion
of T
est
Dat
a an
d Te
st C
ases
Ø I
nste
ad o
f fix
ing
the
test
dat
a in
a fix
ture
, th
e te
st d
ata
can
be
sepa
rate
d fr
om t
he a
pplic
atio
n.
Ø A
dvan
tage
s:
Ø T
est
data
can
be
spec
ified
sym
bolic
ally
, in
stea
d of
usi
ng c
onst
ruct
or e
xpre
ssio
ns
Ø T
est
data
can
be
pers
iste
nt in
file
s or
in d
atab
ases
Ø T
est
data
can
be
shar
ed w
ith o
ther
pro
duct
s in
the
pro
duct
line
Ø D
isad
vant
ages
: Ø D
atab
ase
mus
t be
mai
ntai
ned
toge
ther
with
cod
e (v
ersi
onin
g)
Ø E
xam
ple:
Ø B
ig c
ompi
ler
test
sui
tes
(e.g
., A
da)
Ø D
atab
ase
test
sui
tes
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
59
Stu
bs a
nd C
o
Ø S
tub:
Empt
y im
plem
enta
tions
beh
ind
the
inte
rfac
e
Ø D
um
my:
Sim
ple,
res
tric
ted
sim
ulat
ion
of t
he in
terf
ace
func
tiona
lity
Ø M
ock:
D
umm
y th
at a
lso
chec
ks t
he p
roto
col o
f th
e cl
ass-
unde
r-te
st (
to m
ock,
„et
was
vor
täus
chen
“)
• O
ften
sta
tech
arts
(Ste
ueru
ngsm
asch
inen
)
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
60
http
://de
.wik
iped
ia.o
rg/w
iki/M
ock-
Obj
ekt
Mod
ality
of Cla
sses
Ø N
on-m
odal
cla
ss (
stat
eles
s)
• no
cal
l pro
toco
l ove
r m
etho
d se
t
Ø U
ni-
mod
al c
lass
(st
atef
ul)
•
call
prot
ocol
exi
sts
(des
crib
ed b
y a
Cho
msk
y la
ngua
ge:
stat
e ch
art,
con
text
fre
e la
ngua
ge,
cont
ext-
sens
itive
, Tu
ring
-com
plet
e)
Ø Q
uas
i-m
odal
cla
ss (
stat
efu
l wit
h r
estr
icti
ons)
•
The
clas
s ha
s ad
ditio
nal s
eman
tic r
estr
ictio
ns (
e.g.
, lim
ited
buffer
siz
e)
Ø M
odal
cla
ss
• bu
sine
ss r
ules
des
crib
e th
e ca
ll pr
otoc
ol.
For
inst
ance
, so
me
acc
ount
s ca
nnot
be
ove
rcha
rged
, ot
hers
unt
il a
cert
ain
cred
it lim
it
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
61
Moc
k O
bjec
t fo
r (U
ni-)
Mod
al C
lass
es
Ø A
moc
k ob
ject
sim
ulat
es a
mod
al c
lass
-und
er-t
est,
impl
emen
ting
the
life-
cycl
e pr
otoc
ol
Ø I
f th
e CU
T is
a u
nim
odal
cla
ss,
with
an
unde
rlyi
ng s
tate
cha
rt,
the
test
drive
r sh
ould
tes
t al
l pat
hs in
the
sta
te c
hart
Ø T
he m
ock
mus
t ch
eck
whe
ther
all
stat
e tr
ansi
tions
are
don
e righ
t
<<m
ock>
> pl
ane
Ø T
est c
ase
test
s:
Ø P
ath
1: p
arki
ng->
star
ting-
> fly
ing-
>lan
ding
->pa
rkin
g Ø P
ath
2: p
arki
ng->
star
ting-
> la
ndin
g->p
arki
ng (e
mer
genc
y pa
th)
Ø D
river
che
cks
that
afte
r eac
h m
etho
d th
at is
cal
led
for a
tra
nsiti
on, t
he ri
ght s
tate
is
reac
hed
Ø M
ock
obje
ct im
plem
ents
sta
te
trans
ition
s
GO
/rollo
ut
Whe
elsO
ff/
take
Off(
)
Exc
eptio
n /s
top(
) Per
mitT
oLan
d /la
nd()
halt
/hal
t()
park
ing
land
ing
flyin
g
star
ting
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
62
Moc
k O
bjec
t
plan
e GO
/rollo
ut
Whe
elsO
ff/ ta
keO
ff()
Exc
eptio
n /s
top(
)
Per
mitT
oLan
d /la
nd()
halt
/hal
t()
park
ing
land
ing
flyin
g
star
ting
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
Public class PlaneMock extends MockObject {
int state;
public enum { parking, starting, flying, landing };
public PlaneMock() {
state = parking;
}
public class PlaneTestCase extends TestCase {
pMock = new PlaneMock();
public void setUp() { .. }
public void tearDown() { .. }
public void testPath1(){
pMock.rollout();
assertEquals(pMock.starting,pMock.getState());
pMock.takeOff();
assertEquals(pMock.flying,pMock.getState());
pMock.land();
assertEquals(pMock.landing,pMock.getState());
pMock.halt();
assertEquals(pMock.parking,pMock.getState());
public void testPath2() {..}
}
63
Fram
ewor
k Ea
syM
ock
Ø h
ttp:
//de
.wik
iped
ia.o
rg/w
iki/
Easy
moc
k Ø h
ttp:
//w
ww
.eas
ymoc
k.or
g
Ø E
asyM
ock
auto
mat
es t
he c
reat
ion
of m
ock
obje
cts
by g
ener
atin
g m
ock
obje
cts
as p
roxy
obj
ects
Ø A
n ea
sym
ock
obje
ct is
a p
roxy
to
an e
mpt
y re
al o
bjec
t, w
ith t
wo
mod
es:
• Rec
ordi
ng m
ode:
In
this
mod
e, t
he e
asym
ock
lear
ns h
ow it
sho
uld
be u
sed
• Rep
lay
mod
e: I
n th
is m
ode,
it t
ests
whe
ther
it h
as b
een
used
cor
rect
ly
Ø A
str
ict
easy
moc
k le
arns
als
o th
e or
der
of c
alls
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
64
11
.2.6
MO
DEL
-BA
SED
TE
STI
NG
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
65
The
UM
L Te
stin
g Pr
ofile
UTP
Ø P
. Bak
er e
t. A
l. Th
e U
ML
2.0
Test
ing
Prof
ile (
2008
)
• ht
tp:/
/en.
scie
ntifi
ccom
mon
s.or
g/43
3081
84
Ø T
he c
once
pts
of J
Uni
t ca
n be
mod
eled
in a
cla
ss d
iagr
am
Ø T
he O
MG
has
sta
ndar
dize
d a
UM
L pr
ofile
(an
ext
ensi
on o
f th
e U
ML
met
amod
el)
prov
idin
g th
e co
ncep
ts o
f JU
nit
• U
TP is
a c
olle
ctio
n of
ste
reot
ypes
tha
t ca
n m
ark
up c
lass
dia
gram
s
• <
<SU
T>>
, <
<Te
xtCom
pone
nt>
>,
<<
Test
Con
text
>>
•
and
of t
agge
d va
lues
(T
agge
d va
lues
are
the
sam
e co
ncep
t as
C#
att
ribu
tes
or
Java
Xdo
clet
s)
• <
<st
artT
estC
ase>
>,
<<
finis
hTes
tCas
e>>
, <
<cr
eate
Test
Com
pone
nt>
>
Ø U
TP t
ags
are
tran
slat
ed t
o ta
rget
pro
gram
min
g la
ngua
ges
• Te
sts
are
plat
form
-ind
epen
dent
Ø T
est
case
s an
d su
ites
can
be s
peci
fied
whi
le m
odel
ling
•
Cod
e of
tes
t ca
ses
can
be g
ener
ated
fro
m a
CASE
tool
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
66
UTP
Pro
file
(Met
amod
el)
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
67
UTP
Ø R
ealiz
ed t
estin
g pr
ofile
as:
•
UM
L 2.
0 m
eta
mod
el
• M
OF
(Met
a O
bjec
t Fa
cilit
y) m
eta
mod
el
Ø
Map
ping
to
exis
ting
test
infr
astr
uctu
res
• Te
st C
ontr
ol N
otat
ion
TTCN
-3
• JU
nit
Ø
Usa
ge in
MD
A S
tack
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
PIM
PSM
Cod
e Le
vel
• Te
st C
ases
•
Cod
e
68
11
.2.7
EC
LIP
SE-
BA
SED
TE
ST
PLA
TFO
RM
S
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
69
Eclip
se S
uppo
rts
Man
y Te
st P
latf
orm
Plu
gins
Ø H
yade
s w
ww
.ecl
ipse
.org
/tes
t-an
d-pe
rfor
man
ce
Ø T
est
Cap
ture
-Rep
lay
fram
ewor
k fo
r w
eb a
nd o
ther
app
licat
ions
Ø H
ttp
requ
ests
can
be
reco
rded
, ge
nera
ted
into
JU
nit
test
cas
e cl
asse
s,
afte
rwar
ds r
epla
yed
Ø U
ses
UTP
to
spec
ify t
est
case
s Ø A
Rem
ove-
Acc
ess-
Con
trol
ler
med
iate
s be
twee
n Ec
lipse
and
the
SU
T Ø T
est
data
can
be
stor
ed in
dat
a po
ols
Ø L
og-f
ile a
naly
sis
base
d on
the
Com
mon
-Bas
e-Ev
ent
form
at o
f IB
M
Ø S
olex
htt
p pr
oxy
logg
er w
ww
.sf.
net/
proj
ects
/sol
ex
Ø S
capa
str
ess
test
ww
w.s
capa
tech
.com
Ø H
ttpU
nit,
htm
lUni
t ex
tens
ions
of JU
nit
for
test
of w
eb a
pplic
atio
ns
Ø h
ttpu
nit.
sf.n
et
Ø h
tmlu
nit.
sf.n
et
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
70
TPTP
Ø T
PTP
Plat
form
Pro
ject
htt
p://
ww
w.e
clip
se.o
rg/t
ptp/
•
Cov
ers
the
com
mon
infr
astr
uctu
re in
the
are
as o
f us
er in
terf
ace,
EM
F ba
sed
data
mod
els,
dat
a co
llect
ion
and
com
mun
icat
ions
con
trol
, re
mot
e ex
ecut
ion
envi
ronm
ents
and
ext
ensi
on p
oint
s
Ø T
PTP
Mon
itoring
Too
ls P
roje
ct
• Col
lect
s, a
naly
zes,
agg
rega
tes
and
visu
aliz
es d
ata
that
can
be
capt
ured
in t
he
log
and
stat
istic
al m
odel
s
Ø T
PTP
Test
ing
Tool
s Pr
ojec
t •
Prov
ides
spe
cial
izat
ions
of th
e pl
atfo
rm for
tes
ting
and
exte
nsib
le t
ools
for
sp
ecifi
c te
stin
g en
viro
nmen
ts
• 3
test
env
iron
men
ts:
JUni
t, m
anua
l and
URL
test
ing
Ø T
PTP
Trac
ing
and
Prof
iling
Too
ls P
roje
ct
• Ex
tend
s th
e pl
atfo
rm w
ith s
peci
fic d
ata
colle
ctio
n fo
r Ja
va a
nd d
istr
ibut
ed
appl
icat
ions
tha
t po
pula
te t
he c
omm
on t
race
mod
e, a
lso
view
ers
and
anal
ysis
se
rvic
es
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
71
TPTP
Pro
filin
g To
ol
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
72
Wha
t H
ave
We
Lear
ned?
Ø S
epar
atio
n of
rev
iew
er a
nd p
rodu
cer
is im
port
ant
Ø D
efen
sive
pro
gram
min
g is
goo
d Ø T
est-
first
dev
elop
men
t pr
oduc
es s
tabl
e pr
oduc
ts
Ø W
ithou
t re
gres
sion
tes
ts,
no q
ualit
y Ø M
ock
clas
ses
sim
ulat
e cl
asse
s-un
der-
test
, re
aliz
ing
thei
r lif
e-cy
cle
prot
ocol
Ø T
est
tool
s, e
.g.,
on
the
Eclip
se p
latf
orm
, he
lp t
o au
tom
ate
test
ing
of
appl
icat
ions
, al
so w
eb a
pplic
atio
ns
TU D
resd
en,
Pro
f. U
. A
ßm
ann
Va
lidat
ion
73