Top Banner
TDD by example Why shall we test ? What is TDD (Test Driven Development) ? Let’s practice it together doing a kata... Pierre-Emmanuel DAUTREPPE – October 26th 2012
11

TDD by example

Feb 24, 2016

Download

Documents

kacy

TDD by example. Pierre-Emmanuel DAUTREPPE – October 26th 2012. Why shall we test ? What is TDD (Test Driven Development ) ? Let’s practice it together doing a kata. Pierre-Emmanuel DAUTREPPE. « .NET Architect » and « XP Coach » Founder of User Group «  DotNetHub  » - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: TDD by  example

TDD by example

Why shall we test ?What is TDD (Test Driven Development) ?Let’s practice it together doing a kata...

Pierre-Emmanuel DAUTREPPE – October 26th 2012

Page 2: TDD by  example

2

« .NET Architect » and « XP Coach »

Founder of

User Group « DotNetHub »

« La Journée Agile »/« Agile Tour Namur »

Me contacter via :

[email protected]

http://www.pedautreppe.com

http://www.dotnethub.be

@pedautreppe

Pierre-Emmanuel DAUTREPPE

Page 3: TDD by  example

3

Our developer life

We are genious ! (generally misunderstood)

We = developers

That functionality you implemented, you have ? No, that’s useless ! It’s trivial ! … … … doesn’t work … ????

n00b

documented itcommented it

tested it

Turk et De Groot

Page 4: TDD by  example

4

Our developer life

Page 5: TDD by  example

5

Our developer life

Pinder CircusJust use a safety net !

Page 6: TDD by  example

6

Tests are a validation tool…

Page 7: TDD by  example

7

…but also a documentation tool…

Here is a pretty clear user manual

It’s written « Sort out your own

problems ! »

Page 8: TDD by  example

8

…and a design tool

Page 9: TDD by  example

9

The « Test Driven Development » Cycle

Refactoring

Test passes

Implement Test compiles but fail

Write needed API

It does not compile

Write a testRefa

ctorin

g

of tes

tsRefa

ctorin

g

of co

de

Page 10: TDD by  example

13

Page 11: TDD by  example

14

Conclusion

TDD let you use tests as A validation tool A documentation tool A design tool

Follow the TDD rules Be iterative: split your work in small (requirement)

increments Always start by writing a test Then implement untill the test passes And Cleanup! (refactor)