what is test-driven development? and why do i care? a primer for managers karl scotland dave

18
What is test-driven development? and why do I care? a primer for managers Karl Scotland http:// availagility.wordpress.com http://www.conchango.com Dave Nicolette http://www.davenicolette.net/agile http://www.valtech.com

Upload: piers-wilkerson

Post on 18-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development? and why do I care?

a primer for managers

Karl Scotlandhttp://availagility.wordpress.comhttp://www.conchango.com

Dave Nicolettehttp://www.davenicolette.net/agilehttp://www.valtech.com

Page 2: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?First, a taste

Excel workshop

Page 3: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?What’s design?

Is it a document that describes the design

- or -

Is it the living expression of design in the code?

Page 4: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?To change people, do you change this…

Page 5: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?…or this?

Page 6: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?To change software do you change this…

Design Document

Page 7: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?…or this?

if (confirm("Are you old enough to read about beer\n" + "according to your local community standards?")) { for (i = 99 ; i > 0 ; i--) { j = i - 1; if (i != 1) { icase = "bottles"; } else { icase = "bottle"; } if (j != 1) { jcase = "bottles"; } else { jcase = "bottle"; } document.writeln(i + " " + icase + " of beer on the wall,"); document.writeln(i + " " + icase + " of beer,"); document.writeln("Take 1 down, pass it around,"); if (j != 0) { document.writeln(j + " " + jcase + " of beer on the wall."); } else { document.writeln("No more bottles of beer on the wall!"); } document.writeln(); } } else { document.write("You might want think about moving to another community.") }

Page 8: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?What’s design debt?

Cost of change: C Cost of change: C + n Cost of change: C x n

n

??

Cost of change: Cn

Cost of change: Cn

Page 9: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?Installment payments for design debt

Starting code baseCost of change: C

1

Tests fornew features

2

Changes implementedCost of change: C + n

3

Tests fornew features

4

Code cleaned upCost of change: C

5

Page 10: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?Effect of design debt on development cost during a project

design debt

cost

per

fea

ture

C

C + n

C x n

C n

C nn

less

more

more

acce

ptab

le

Page 11: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?Effect of design debt on team productivity during a project

design debt

feat

ures

per

iter

atio

n (v

eloc

ity)

less

more

more

Page 12: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?Effect of design debt on the defect rate during a project

design debt

defe

cts

per

feat

ure

less

more

more

Page 13: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?Effect of design debt on time available for testing during a project

design debt

how

dev

elop

men

t tim

e is

spe

nt

less more

testing &new code

defects &extra timefor analysisand coding

Page 14: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?Effect of design debt over the life of a product

design debt

support cost

enhancement cost

plan

ned

prod

uctiv

e lif

etim

e of

pro

duct

less more

effe

ctiv

e de

ath

of p

rodu

ct $$ loss $$(untenable)

more

Page 15: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?Why people continue to incur design debt

Ouch!I know it’s

bad for me, but…

I feel better now

I feel much worse later

Page 16: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?What can I do about it?

As a manager, I…

…barely understand this myself

…can’t tell technical professionals how to do their jobs

…don’t have an answer for their technical rationalizations

…need to give them “space” to work effectively

Page 17: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?How can I influence things at this level without damaging morale?

As a manager, I can…

…attend daily stand-up meetings and ask questions

…visit the work area and observe the process

…ask team members about TDD and how they use it

…track the defect curve closely and raise issues

Page 18: What is test-driven development? and why do I care? a primer for managers Karl Scotland   Dave

What is test-driven development and why do I care?Design debt and test-driven development

Design debt compounds interest just like financial debt

It’s easier to pay off interest in small installments than to let it accumulate

TDD pays design debt as it is incurred, like paying off a credit card account in full every month

You care because it’s your money

You can influence the team indirectly

$

$

$

$

$