On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence...

28
On the Influence of Test-Driven Development on Software Design on Software Design by Sze Chern Tan School of Informatics University of Edinburgh 12 February 2009

Transcript of On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence...

Page 1: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

ev

elo

pm

en

t

on

So

ftw

are

De

sig

no

n S

oft

wa

re D

esi

gn

by

Sze

Ch

ern

Tan

Sch

oo

l of

Info

rma

tics

Un

ive

rsit

y o

f E

din

bu

rgh

12

Fe

bru

ary

20

09

Page 2: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Ag

en

da

�In

tro

du

ctio

n

�O

verv

iew

of

pa

pe

r

�E

xpe

rim

en

tal d

esi

gn

�R

esu

lts

�R

ela

ted

an

d f

utu

re w

ork

�R

ela

ted

an

d f

utu

re w

ork

�C

on

clu

sio

n

�R

efe

ren

ces

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n2

Page 3: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

�A

de

velo

pm

en

t te

chn

iqu

e w

he

re y

ou

mu

st f

irst

wri

te a

te

st

tha

t fa

ils

be

fore

yo

u w

rite

ne

w f

un

ctio

na

l co

de

1.

Wri

te j

ust

en

ou

gh

co

de

to

fa

il

2.

Ru

n t

he

te

st t

o e

nsu

re t

he

ne

w t

est

do

es

in f

act

fa

il

3.

Up

da

te fu

nct

ion

al co

de

to

ma

ke i

t p

ass

th

e n

ew

te

st

Wh

at

is T

est

-Dri

ve

n D

ev

elo

pm

en

t (T

DD

)?

3.

Up

da

te fu

nct

ion

al co

de

to

ma

ke i

t p

ass

th

e n

ew

te

st

4.

Ru

n t

est

ag

ain

a)

If f

ail

, g

o b

ack

to

ste

p 3

b)

If p

ass

; re

pe

at

for

ne

xt f

un

ctio

n

�R

eq

uir

es

pro

gra

mm

er

to c

rea

te a

uto

ma

ted

un

it t

est

s th

at

de

fin

e c

od

e r

eq

uir

em

en

ts b

efo

re w

riti

ng

th

e c

od

e i

tse

lf

12

Fe

bru

ary

20

09

3O

n t

he

In

flu

en

ce o

f Te

st-D

rive

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n

Page 4: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Co

mp

ari

son

of

TD

D a

ga

inst

No

n-T

DD

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n4

Sourc

e: O

n the E

ffectiveness o

f th

e T

est-First A

ppro

ach to P

rogra

mm

ing (E

rdogm

us 2

005)

Page 5: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

TD

D a

nd

Ag

ile

�A

gil

e m

eth

od

s re

ject

co

mp

reh

en

sive

de

sig

n p

ha

se p

rece

din

g

pro

gra

mm

ing

in f

avo

r o

f a

sm

all

arc

hit

ect

ura

l ske

tch

fo

llo

we

d

qu

ick

ly b

y p

rog

ram

min

g

�S

oft

wa

re d

esi

gn

an

d a

rch

ite

ctu

re a

llo

we

d t

o ‘e

me

rge

�T

DD

is

see

n a

s e

sse

nti

al

stra

teg

y in

su

ch a

pro

cess

�T

DD

is

see

n a

s e

sse

nti

al

stra

teg

y in

su

ch a

pro

cess

�“f

orc

es”

th

e p

rog

ram

me

r to

ca

refu

lly

co

nsi

de

r d

esi

gn

de

cisi

on

s su

ch a

s

soft

wa

re in

terf

ace

an

d b

eh

avio

r b

efo

re c

om

mit

tin

g t

o c

od

e

�D

esi

gn

ca

n b

e c

lea

ne

r a

nd

cle

are

r th

an

is

oft

en

ach

ieve

d b

y o

the

r

me

tho

ds

[Be

ck]

�“

Test

-fir

st c

od

e t

en

ds

to b

e m

ore

co

he

sive

an

d l

ess

co

up

led

tha

n c

od

e i

n w

hic

h t

est

ing

isn

’t a

pa

rt o

f th

e i

nti

ma

te c

od

ing

cycl

e”

(Be

ck,

20

03

)

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n5

Page 6: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

TD

D a

nd

So

ftw

are

Qu

ali

ty

�R

ese

arc

h h

ave

mo

stly

co

nce

ntr

ate

d o

n e

xte

rna

l qu

ali

ty r

ath

er

tha

n in

tern

al q

ua

lity

�E

xte

rna

l q

ua

lity

ch

ara

cte

rist

ics

are

th

ose

pa

rts

of

a p

rod

uct

th

at

face

it

s u

sers

. E

.g.

de

fect

s

�In

tern

al q

ua

lity

ch

ara

cte

rist

ics

are

th

ose

th

at

do

no

t. E

.g.

cou

pli

ng

, co

he

sio

n,

cod

e c

om

ple

xity

coh

esi

on

, co

de

co

mp

lexi

ty

�G

eo

rge

an

d W

illi

am

s h

ave

pre

sen

ted

se

vera

l st

ud

ies

tha

t co

ncl

ud

e t

ha

t T

DD

im

pro

ves

ext

ern

al q

ua

lity

of

soft

wa

re in

in

du

stry

(G

eo

rge

, 2

00

3)

�M

ull

er

ha

s p

rese

nte

d s

tud

ies

on

th

e e

ffe

cts

of

TD

D o

n i

nte

rna

l q

ua

lity

by

usi

ng

op

en

-so

urc

e p

roje

cts

as

da

ta s

ou

rce

, co

ncl

ud

ing

th

at

TD

D h

as

no

eff

ect

on

in

tern

al q

ua

lity

(M

üll

er,

2

00

6).

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n6

Page 7: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Ov

erv

iew

of

pa

pe

r

�A

n e

mp

iric

al s

tud

y o

n:

�th

e e

ffe

cts

of

TD

D o

n p

rog

ram

me

r p

rod

uct

ivit

y a

nd

in

tern

al

soft

wa

re

de

sig

n q

ua

lity

�e

xam

ine

s e

ffe

cts

of

test

co

vera

ge

on

so

ftw

are

qu

ali

ty w

he

n u

sin

g T

DD

�S

urv

eys

pro

gra

mm

er

pe

rce

pti

on

s re

ga

rdin

g T

DD

�B

ase

d o

n f

ind

ing

s fr

om

a c

on

tro

lle

d e

xpe

rim

en

t co

nd

uct

ed

in

an

aca

de

mic

se

ttin

g

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n7

Page 8: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Ex

pe

rim

en

tal

de

sig

n -

Ob

ject

ive

s

�To

exa

min

e r

ela

tio

nsh

ip o

f T

DD

wit

h s

oft

wa

re q

ua

lity

an

d

pro

gra

mm

er

pro

du

ctiv

ity

�To

de

mo

nst

rate

fe

asi

bil

ity

of

usi

ng

TD

D w

ith

tra

dit

ion

al

de

velo

pm

en

t m

eth

od

s (i

.e.

no

t A

gil

e)

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n8

Page 9: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Ex

pe

rim

en

tal

de

sig

n -

Pa

rtic

ipa

nts

�C

on

du

cte

d w

ith

up

pe

r-le

vel

un

de

rgra

du

ate

stu

de

nts

in

a

soft

wa

re e

ng

ine

eri

ng

co

urs

e

�Ju

nio

r a

nd

se

nio

r le

vel

stu

de

nts

wh

o h

ad

co

mp

lete

d a

t le

ast

tw

o p

revio

us

pro

gra

mm

ing

co

urs

es

�A

ll s

tud

en

ts w

ere

ta

ug

ht:

All

stu

de

nts

we

re t

au

gh

t:

�si

mp

lifi

ed

Un

ifie

d P

roce

ss,

�a

uto

ma

ted

te

stin

g u

sin

g J

Un

itfr

am

ew

ork

�h

ow

to

wri

te s

oft

wa

re i

n T

est

-Fir

st a

nd

Te

st-L

ast

ma

nn

er

�S

tud

en

ts w

ere

div

ide

d i

nto

3 p

roje

ct g

rou

ps:

�Tw

o g

rou

ps

to u

se a

Te

st-F

irst

ap

pro

ach

, o

ne

gro

up

to

use

Te

st-L

ast

.

�Te

am

s w

ere

se

lf-s

ele

cte

d b

ut

ea

ch t

ea

m m

ust

ha

ve a

t le

ast

on

e

me

mb

er

wit

h p

revio

us

Java

exp

eri

en

ce.

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n9

Page 10: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Ex

pe

rim

en

tal

de

sig

n –

Task

�Ta

sk:

�D

esi

gn

an

d b

uil

d a

n H

TM

L p

rett

y p

rin

t sy

ste

m

�Ta

ke a

n H

TM

L fi

le a

s in

pu

t a

nd

tra

nsf

orm

fil

e i

nto

hu

ma

n r

ea

da

ble

fo

rma

t

�P

roje

ct d

ivid

ed

in

to t

wo

ite

rati

on

s

�It

era

tio

n 1

:

text

-ba

se U

I a

nd

pa

rtia

l se

t o

f fe

atu

res

�It

era

tio

n 2

:

GU

I a

nd

ad

dit

ion

al

fea

ture

s

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n1

0

Page 11: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Ex

pe

rim

en

tal

De

sig

n:

Hy

po

the

ses

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n1

1

Table

1. Form

aliz

ed H

ypoth

eses

Page 12: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Ex

pe

rim

en

t R

esu

lts

�O

f th

e t

hre

e g

rou

ps:

�Te

st-F

irst

:

�O

nly

on

e o

f th

e t

wo

Te

st-F

irst

te

am

s a

ctu

all

y c

om

pli

ed

to

TD

D a

pp

roa

ch

�C

om

ple

ted

a G

UI

an

d i

mp

lem

en

ted

ab

ou

t tw

ice

as

ma

ny

fe

atu

res

as

the

oth

er

tea

ms

�S

imil

ar

nu

mb

er

of

de

fect

s�

Sim

ila

r n

um

be

r o

f d

efe

cts

�Te

st-L

ast

:

�T

he

oth

er

Test

-Fir

st t

ea

m a

ctu

all

y w

rote

au

tom

ate

d t

est

s A

FT

ER

wri

tin

g

fun

ctio

na

l co

de

�N

o-T

est

s:

�R

em

ain

ing

te

am

(o

rig

ina

lly

Te

st-L

ast

) d

id n

ot

wri

te a

ny

au

tom

ate

d t

est

s

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n1

2

Page 13: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Da

ta A

na

lysi

s -

Pro

du

ctiv

ity

Table

2. E

ffort in m

inute

s

�Te

st-F

irst

sp

en

t le

ast

am

ou

nt

of

de

velo

pm

en

t e

ffo

rt y

et

de

live

red

th

e m

ost

fu

nct

ion

ali

ty

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n1

3

De

fin

itio

ns:

�To

tal e

ffo

rt:

tim

e s

pe

nt

on

all

act

ivit

ies,

in

clu

din

g m

ee

tin

gs

& r

ese

arc

h

�D

ev e

ffo

rt:

an

aly

sis,

de

sig

n,

cod

e,

test

, fi

x, r

evie

w

Page 14: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Da

ta A

na

lysi

s –

Co

de

Siz

e

�Te

st-F

irst

imp

lem

en

ted

mo

re c

od

e (

incl

ud

ing

te

st a

nd

GU

I)

Table

3. C

ode S

ize M

etric

s

�Te

st-F

irst

imp

lem

en

ted

mo

re c

od

e (

incl

ud

ing

te

st a

nd

GU

I)

tha

n o

the

r tw

o

�Te

st-F

irst

an

d T

est

-La

st h

ave

a r

ea

son

ab

le a

vera

ge

me

tho

d

size

an

d L

OC

/fe

atu

re

�N

o-T

est

s w

rote

lo

ng

me

tho

ds

an

d e

xce

ssiv

e a

mo

un

t o

f co

de

for

the

pro

vid

ed

fu

nct

ion

ali

ty

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n1

4

Page 15: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Da

ta A

na

lysi

s –

Test

De

nsi

ty

Table

4. Test D

ensity a

nd C

overa

ge M

etric

s

�C

alc

ula

ted

usi

ng

ST

RE

W E

clip

se p

lug

-in

�Te

st-F

irst

wro

te t

wic

e a

s m

an

y a

sse

rtio

ns/

SLO

C a

s Te

st-L

ast

�S

tate

me

nt

cove

rag

e b

etw

ee

n T

est

-Fir

st a

nd

Te

st-L

ast

no

t

sig

nif

ica

ntl

y d

iffe

ren

t, b

ut

�B

ran

ch c

ove

rag

e o

f Te

st-F

irst

is

86

% h

igh

er

tha

n T

est

-La

st

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n1

5

Page 16: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Da

ta A

na

lysi

s –

Inte

rna

l Q

ua

lity

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n1

6

Table

5. In

tern

al Q

ualit

y M

etric

s w

ith W

arn

ings

De

fin

itio

ns:

�N

est

ed

Blo

ck D

ep

th =

th

e d

ep

th o

f n

est

ed

blo

cks

of

cod

e

�C

ycl

om

ati

cC

om

ple

xit

y =

nu

mb

er

of

flo

ws

thro

ug

h a

n in

div

idu

al m

eth

od

�P

ara

me

ters

= t

ota

l n

um

be

r o

f p

ara

me

ters

in

se

lect

ed

sco

pe

�C

BO

=

Co

up

lin

g B

etw

ee

n O

bje

cts

=

the

nu

mb

er

of

con

ne

ctio

ns

be

twe

en

ob

ject

s

�IF

=

In

form

ati

on

Flo

w =

me

asu

res

the

in

tera

ctio

ns

be

twe

en

su

bro

uti

ne

s o

f th

e s

yste

m

Page 17: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Inte

rna

l Q

ua

lity

(co

nt.

)

�G

ath

ere

d t

we

nty

-fiv

e s

tru

ctu

ral a

nd

ob

ject

-ori

en

ted

me

tric

s

usi

ng

fre

ely

ava

ila

ble

to

ols

.

�N

o-T

est

s a

nd

Te

st-L

ast

wro

te c

od

e t

ha

t is

pro

ced

ura

l in

na

ture

�N

o-T

est

s h

ad

cla

sse

s w

ith

ve

rb n

am

es

an

d m

an

y lo

ng

, co

mp

lex

loo

ps.

�Te

st-L

ast

wro

te a

ll f

un

ctio

na

lity

in

th

ree

cla

sse

s b

esi

de

s m

ain

(),

an

d

�Te

st-L

ast

wro

te a

ll f

un

ctio

na

lity

in

th

ree

cla

sse

s b

esi

de

s m

ain

(),

an

d

ma

in()

co

nta

ine

d p

rim

ary

pro

gra

m lo

gic

.

�Te

st-L

ast

pro

du

ced

be

tte

r “s

core

s” t

ha

n T

est

-Fir

st!

�Te

st-L

ast

use

d j

ava

.uti

l.re

ge

x li

bra

ry t

o a

chie

ve m

ore

fu

nct

ion

ali

ty w

ith

less

co

de

.

�G

UI

imp

lem

en

tati

on

ne

ga

tive

ly a

ffe

cts

me

asu

rem

en

t a

s G

UI

cod

e w

as

no

t co

vere

d b

y a

ny

au

tom

ate

d u

nit

te

sts

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n1

7

Page 18: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Da

ta A

na

lysi

s –

Test

-Fir

st M

icro

-ev

alu

ati

on

Table

6. M

etric

s o

n T

este

d a

nd U

nte

ste

d C

ode o

f Test-First P

roje

ct

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n1

8

De

fin

itio

ns:

�W

MC

= W

eig

hte

d M

eth

od

s C

om

ple

xit

y =

su

m o

f cy

clo

ma

tic

com

ple

xiti

es

for

all

me

tho

ds

in a

cla

ss

�C

BO

=

Co

up

lin

g B

etw

ee

n O

bje

cts

= t

he

nu

mb

er

of

con

ne

ctio

ns

be

twe

en

ob

ject

s

�N

BD

= N

est

ed

Blo

ck D

ep

th =

th

e d

ep

th o

f n

est

ed

blo

cks

of

cod

e

�C

om

ple

xit

y =

nu

mb

er

of

flo

ws

thro

ug

h a

n in

div

idu

al m

eth

od

�P

ara

me

ters

=

tota

l n

um

be

r o

f p

ara

me

ters

in

se

lect

ed

sco

pe

Page 19: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Test

-Fir

st M

icro

-ev

alu

ati

on

(co

nt.

)

�M

ea

sure

s q

ua

lity

of

cod

e c

ove

red

by

au

tom

ate

d u

nit

te

sts

com

pa

red

to

co

de

no

t co

vere

d b

y a

ny

te

sts

�Te

ste

d m

eth

od

s 4

3%

lo

we

r in

ave

rag

e c

om

ple

xity

�Te

ste

d c

lass

es

ha

d 1

04

% lo

we

r co

up

lin

g m

ea

sure

s

�Lo

we

r q

ua

lity

of

un

test

ed

co

de

mig

ht

be

du

e t

o e

ith

er:

�Lo

we

r q

ua

lity

of

un

test

ed

co

de

mig

ht

be

du

e t

o e

ith

er:

1.

Ab

sen

ce o

f te

sts

wh

ich

lea

ds

to p

oo

r q

ua

lity

, O

R

2.

Ind

ica

tes

pro

gra

mm

er

spe

nt

less

eff

ort

on

un

test

ed

se

gm

en

ts o

f

cod

e

�La

ck o

f te

st c

ove

rag

e m

igh

t b

e i

nd

ica

tor

of

inte

rna

l q

ua

lity

issu

es

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n1

9

Page 20: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Da

ta A

na

lysi

s –

Pro

gra

mm

er

Pe

rce

pti

on

Table

7. P

rogra

mm

er P

erc

eption o

f Test-First and T

est-Last (0

to 4

scale

)

�Q

ue

stio

nn

air

e a

dm

inis

tere

d p

re a

nd

po

st-e

xpe

rim

en

t

�A

ll t

hre

e t

ea

ms

pe

rce

ive

Te

st-F

irst

mo

re p

osi

tive

ly a

fte

r th

e

exp

eri

me

nt,

an

d i

nve

rse

ly p

erc

eiv

ed

Te

st-L

ast

mo

re n

ega

tive

ly

�8

9%

th

ou

gh

t Te

st-F

irst

pro

du

ced

sim

ple

r d

esi

gn

�7

0%

th

ou

gh

t Te

st-F

irst

pro

du

ced

co

de

wit

h f

ew

er

de

fect

s

�7

5%

th

ou

gh

t Te

st-F

irst

wa

s b

est

ap

pro

ach

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n2

0

Page 21: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Da

ta A

na

lysi

s –

Pro

gra

mm

er

Pe

rce

pti

on

(co

nt.

)

�Te

st-F

irst

te

am

:

�1

00

% o

f te

am

pre

ferr

ed

to

use

Te

st-F

irst

ove

r Te

st-L

ast

in

fu

ture

pro

ject

s

�R

ep

ort

ed

hig

he

r co

nfi

de

nce

in a

bil

ity

to

ma

ke f

utu

re c

ha

ng

es

to t

he

ir

soft

wa

re

Test

-La

st t

ea

m:

50

:50

sp

lit

am

on

g T

est

-La

stte

am

�Te

st-L

ast

te

am

: 5

0:5

0 s

pli

t a

mo

ng

Te

st-L

ast

tea

m

�N

o-T

est

te

am

: 1

00

% o

f te

am

pre

ferr

ed

to

use

Te

st-L

ast

aga

in

�M

ore

co

mfo

rta

ble

wit

h a

pp

roa

ch t

ha

t th

ey

alr

ea

dy

kn

ow

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n2

1

Page 22: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Th

rea

ts t

o V

ali

dit

y (

Ca

ve

ats

)

�E

xpe

rim

en

t w

as

con

du

cte

d w

ith

on

ly 1

0 s

tud

en

ts

�A

sin

gle

pro

gra

mm

er

on

ea

ch o

f th

e t

hre

e t

ea

ms

imp

lem

en

ted

ma

jori

ty o

f th

e c

ore

fu

nct

ion

ali

ty

�D

iffe

ren

ces

in q

ua

lity

an

d p

rod

uct

ivit

y c

ou

ld b

e a

ttri

bu

ted

to

ind

ivid

ua

l sk

ill le

vels

of

on

ly t

hre

e p

rog

ram

me

rsin

div

idu

al sk

ill le

vels

of

on

ly t

hre

e p

rog

ram

me

rs

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n2

2

Page 23: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Co

ncl

usi

on

�Te

st-F

irst

ap

pro

ach

ma

y h

ave

po

siti

ve c

orr

ela

tio

n w

ith

pro

gra

mm

er

pro

du

ctiv

ity

�Te

st-F

irst

wa

s n

ot

sho

wn

to

pro

du

ce b

ett

er

qu

ali

ty s

oft

wa

re

tha

n T

est

-La

st

�In

tern

al q

ua

lity

iss

ue

s m

ay

ari

se w

he

n T

est

-Fir

st p

roce

ss

�In

tern

al q

ua

lity

iss

ue

s m

ay

ari

se w

he

n T

est

-Fir

st p

roce

ss

bre

aks

do

wn

an

d t

est

s a

re n

ot

wri

tte

n

�P

rog

ram

me

rs p

erc

eiv

e T

DD

mo

re p

osi

tive

ly a

fte

r e

xpo

sure

to

it,

an

d m

ore

lik

ely

to

ad

op

t T

DD

aft

er

try

ing

it

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n2

3

Page 24: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Re

late

d W

ork

�Fo

r co

mp

ari

son

stu

die

s o

f T

DD

in

in

du

stry

:

�G

eo

rge

an

d W

illi

am

s p

rese

nte

d a

stu

dy

of

24

XP

pro

gra

mm

ers

, a

nd

re

po

rte

d q

ua

lity

im

pro

vem

en

t b

ut

wit

h d

ecl

ine

in

pro

du

ctiv

ity

(G

eo

rge

, 2

00

4).

�N

ag

ap

pa

ne

t a

l p

rese

nte

d a

sim

ila

r st

ud

y c

on

du

cte

d a

t M

icro

soft

an

d

IBM

, co

ncl

ud

ing

th

at

TD

D le

d t

o im

pro

ved

qu

ali

ty b

ut

incr

ea

se i

n

IBM

, co

ncl

ud

ing

th

at

TD

D le

d t

o im

pro

ved

qu

ali

ty b

ut

incr

ea

se i

n

de

velo

pm

en

t ti

me

(N

ag

ap

pa

n,

20

08

).

�Fo

r st

ud

ies

on

ad

op

tio

n o

f T

DD

in

in

du

stry

:

�M

axi

mil

iea

na

nd

Wil

lia

ms

pre

sen

t a

n e

xpe

rie

nce

pa

pe

r o

n T

DD

a

do

pti

on

at

IBM

(M

axi

mil

iea

n,

20

03

).

�K

au

fma

n a

nd

Ja

nze

n p

rese

nte

d a

n e

xpe

rie

nce

pa

pe

r o

n T

DD

ad

op

tio

n

at

Su

n M

icro

syst

em

s (K

au

fma

n 2

00

3).

�R

en

de

ll p

rop

ose

d a

pra

gm

ati

c a

pp

roa

ch t

o T

DD

ad

op

tio

n b

ase

d o

n h

is

exp

eri

en

ce a

t T

-Mo

bil

e (

Re

nd

ell

, 2

00

8).

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n2

4

Page 25: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Re

late

d W

ork

(co

nt.

)

�Fo

r co

mp

ari

son

stu

die

s o

f T

DD

in

aca

de

mia

:

�E

dw

ard

s p

rese

nte

d a

co

mp

ari

son

stu

dy

of

ext

ern

al

qu

ali

ty

imp

rove

me

nt

wit

h 5

9 u

nd

erg

rad

ua

te s

tud

en

ts a

nd

co

ncl

ud

es

tha

t

soft

wa

re p

rod

uce

d b

y s

tud

en

ts u

sin

g T

DD

ha

d le

ss d

efe

cts.

(E

dw

ard

s,

20

02

)

�M

üll

er

an

d H

ag

ne

r co

nd

uct

ed

a s

imil

ar

stu

dy

wit

h C

S g

rad

ua

te

�M

üll

er

an

d H

ag

ne

r co

nd

uct

ed

a s

imil

ar

stu

dy

wit

h C

S g

rad

ua

te

stu

de

nts

, b

ut

usi

ng

XP.

Stu

dy

fo

un

d t

ha

t p

rog

ram

me

r p

rod

uct

ivit

y d

id

no

t im

pro

ve,

an

d p

rog

ram

re

lia

bil

ity

on

ly in

cre

ase

d s

lig

htl

y. (

lle

r,

20

02

)

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n2

5

Page 26: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Fu

ture

Wo

rk

�S

tud

y o

n w

he

the

r T

DD

wit

h p

rop

er

test

co

vera

ge

ca

n r

ed

uce

com

ple

xity

an

d c

ou

pli

ng

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n2

6

Page 27: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Re

fere

nce

s

1.

Be

ck,

K.

Test

Dri

ven

De

velo

pm

en

t b

y E

xam

ple

, A

dd

iso

n W

esl

ey,

20

03

2.

Ed

wa

rds,

S.

(20

02

). U

sin

g T

est

-Dri

ven

De

velo

pm

en

t in

th

e C

lass

roo

m.

Vir

gin

ia T

ech

.

3.

Erd

og

mu

s, H

., M

ori

sio

, M

., &

To

rch

ian

o,

M.

(20

05

). O

n t

he

eff

ect

ive

ne

ss

of

the

te

st-f

irst

ap

pro

ach

to

pro

gra

mm

ing

. IE

EE

Tra

nsa

ctio

ns

on

So

ftw

are

E

ng

ine

eri

ng

, 3

1 (

3),

22

6-2

37

.

4.

Ge

org

e,

B.,

& W

illi

am

s, L

. (2

00

3).

An

in

itia

l in

vest

iga

tio

n o

f te

st d

rive

n

de

velo

pm

en

t in

in

du

stry

. In

SA

C '0

3:

Pro

cee

din

gs

of

the

20

03

AC

M

sym

po

siu

m o

n A

pp

lie

d c

om

pu

tin

g ,

(p

p.

11

35

-11

39

).

5.

Ge

org

e,

B.,

& W

illi

am

s, L

. (2

00

4).

A s

tru

ctu

red

exp

eri

me

nt

of

test

-dri

ven

d

eve

lop

me

nt.

In

In

form

ati

on

an

d S

oft

wa

re T

ech

no

log

y ,

46

(5

), 3

37

-34

2.

6.

Ka

ufm

an

n,

R.,

& J

an

zen

, D

. (2

00

3).

Im

pli

cati

on

s o

f te

st-d

rive

n

de

velo

pm

en

t: a

pil

ot

stu

dy.

In

OO

PS

LA '0

3:

Co

mp

an

ion

of

the

18

th a

nn

ua

l A

CM

SIG

PLA

N c

on

fere

nce

on

Ob

ject

-ori

en

ted

pro

gra

mm

ing

, sy

ste

ms,

la

ng

ua

ge

s, a

nd

ap

pli

cati

on

s ,

(pp

. 2

98

-29

9).

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n2

7

Page 28: On the Influence of Test-Driven Development on Software Design · 2009. 2. 16. · On the Influence of Test-Driven Development on Soft ware Design 23. Related Work For comparison

Re

fere

nce

s

7.

Ma

xim

ilie

n,

E.

& W

illi

am

s, L

. (2

00

3).

`A

sse

ssin

g t

est

-dri

ven

de

velo

pm

en

t a

t IB

M'.

In

So

ftw

are

En

gin

ee

rin

g, 2

00

3.

Pro

cee

din

gs.

25

th I

nte

rna

tio

na

l C

on

fere

nce

on

, p

p.

56

4-5

69

.

8.

lle

r, M

. (2

00

6).

Th

e e

ffe

ct o

f te

st-d

rive

n d

eve

lop

me

nt

on

pro

gra

m

cod

e.

In 7

th I

nte

rna

tio

na

l C

on

fere

nce

on

Ext

rem

e P

rog

ram

min

g a

nd

Ag

ile

P

roce

sse

s in

So

ftw

are

En

gin

ee

rin

g,

XP

20

06

9.

lle

r, M

., &

Ha

gn

er,

O.

(20

02

). E

xpe

rim

en

t a

bo

ut

test

-fir

st

9.

lle

r, M

., &

Ha

gn

er,

O.

(20

02

). E

xpe

rim

en

t a

bo

ut

test

-fir

st

pro

gra

mm

ing

. S

oft

wa

re,

IEE

Pro

cee

din

gs,

14

9 (

5),

13

1-1

36

.

10

.N

ag

ap

pa

n,

N.,

Ma

xim

ilie

n,

E.,

Bh

at,

T.,

& W

illi

am

s, L

. (2

00

8).

Re

ali

zin

g

qu

ali

ty im

pro

vem

en

t th

rou

gh

te

st d

rive

n d

eve

lop

me

nt:

re

sult

s a

nd

e

xpe

rie

nce

s o

f fo

ur

ind

ust

ria

l te

am

s. E

mp

iric

al

So

ftw

are

En

gin

ee

rin

g ,

13

(3

), 2

89

-30

2.

11

.R

en

de

ll,

A.

(20

08

). E

ffe

ctiv

e a

nd

pra

gm

ati

c te

st d

rive

n d

eve

lop

me

nt.

A

gil

e,

20

08

. A

GIL

E '0

8 C

on

fere

nce

4-8

Au

g.

20

08

Pa

ge

(s):

29

8 -

30

3

12

Fe

bru

ary

20

09

On

th

e I

nfl

ue

nce

of

Test

-Dri

ve

n D

eve

lop

me

nt

on

So

ftw

are

De

sig

n2

8