Tdd For Tekna

31
Why Test Driven Development has little to do with testing by Espen Dalløkken. October 23 2008, Tekna, Oslo, Norway http://www.flickr.com/photos/nathan_adams/2401072076

Transcript of Tdd For Tekna

Page 1: Tdd For Tekna

Why Test Driven Development has little to do with testingby Espen Dalløkken. October 23 2008, Tekna, Oslo, Norway

http://www.flickr.com/photos/nathan_adams/2401072076

Page 2: Tdd For Tekna

Ab o u t m e

● Espen Dalløkken, 13.11.1976● Graduate of Molde College● Software Developer since 1998● Started with TDD in 2004

Page 3: Tdd For Tekna

Ag e nd a

● Why TDD has little to do with testing

● Myths About TDD● Three Benefits Of TDD● How you introduce TDD in your

organization

Page 4: Tdd For Tekna

H o w I W a s In t ro d uc e d To TDD

Page 5: Tdd For Tekna

Te s t ing is fun !

http://www.flickr.com/photos/azlijamil01/469730066/

Page 6: Tdd For Tekna

? ? ?

Page 7: Tdd For Tekna

Te s t ing is fun !!

http://www.flickr.com/photos/azlijamil01/469730066/

Page 8: Tdd For Tekna

#$ %!

Page 9: Tdd For Tekna

The o ry Ab o u t Te s t ing

Page 10: Tdd For Tekna

Ph ilo s o p hy

● Testing is to prevent defects from occurring, not finding them

● Do it right the first time(use TDD and continuous integration)

● QA staff should build quality into code, rather than test

Page 11: Tdd For Tekna

B u ild ing Qua lit y In

● Involve testers in writing tests up front to provide an executable specification

● Mistake-proof your process by automating testing as much as possible

● Stop the line and fail fast

Page 12: Tdd For Tekna

C o s t O f Fix ing De fe c ts

Source: IBM Systems Sciences Institute

Page 13: Tdd For Tekna

Te s t D r ive n De ve lo p m e n t

Page 14: Tdd For Tekna

W hy TDD ha s lit t le to d o w ith te s t ing

● Puts focus on requirements● Encourages simplicity in design● Enforces loosely coupled

components● Encourages good Object Oriented

Design

Page 15: Tdd For Tekna

W hy TDD ha s lit t le to d o w ith te s t ing

● Makes your code-base fit for handling change

● A safety net when refactoring code

● Enforces technology which is testable

Page 16: Tdd For Tekna

Thre e B e ne fit s O f TDD

Page 17: Tdd For Tekna

TDD p ro v id e s c o n t inuo us

im p ro ve m e nts , w h ic h g ra d ua lly

im p ro ve s the q ua lit y o f yo u r c o d e b a s e

Page 18: Tdd For Tekna

TDD m a ke s yo u fa il fa s t , w h ic h

he lp re d uc e te s t ing c o s ts

Page 19: Tdd For Tekna

TDD re q u ire s lo o s e ly c o up le d c o m p o ne n ts , w h ic h a re a ne c e s s it y

fo r a n e vo lv ing a rc h ite c tu re

Page 20: Tdd For Tekna

The M yths o f TDD

Page 21: Tdd For Tekna

N o N e e d To C ha ng e The W a y W e W o rk

Page 22: Tdd For Tekna

W e N e e d C ha ng e B e c a us e ..

● Too much time is spent on acceptance testing in projects

● Defects keeps on reoccurring● Developers don't take enough

responsibility for testability of their application

Page 23: Tdd For Tekna

TDD is s lo w

Page 24: Tdd For Tekna

TDD Is Fa s t B e a c a us e ..

● You go faster by not having to go back

● You write only code you need● It helps prevent reoccurring

defects● Tests document how

requirements is implemented

Page 25: Tdd For Tekna

In t ro d uc ing TDD to a d e ve lo p m e n t

te a m

Page 26: Tdd For Tekna

Pro b le m s yo u w ill e nc o un te r

● People in general don't like change, but developers tends to hate it

● No developer likes the word “testing”

● Realizing the value of TDD takes time and practice

Page 27: Tdd For Tekna

H o w To In t ro d uc e TDD

● Lead by example● Follow up all developers● Focus upon development benefits● Automate the build and test

process

Page 28: Tdd For Tekna

De ve lo p e r B e ne fit s

● Have a Continuous Integration stack set up

● TDD on bug fixing, means fixing bugs once

● Refactoring can be performed any time in the project life cycle

Page 29: Tdd For Tekna

W r it ing Te s t Up Fro n t ...

● Helps you write only required code

● Helps you create a loosely coupled design from day 1

● Helps you document your application

● Help putting focus on requirements

Page 30: Tdd For Tekna

H o w Yo u Fe e l Ab o u t TDD?

http://www.flickr.com/photos/zilliontrillion1/276600545

Page 31: Tdd For Tekna

Thanks for your time!

Questions or abuse?

[email protected]://dallokken.com/espen