24
ARE YOU NOT USING TDD ?! while ( TDD === false ) { bugs ++; }

Introduction to TDD (PHPunit examples)

Embed Size (px)

Citation preview

Page 1: Introduction to TDD (PHPunit examples)

ARE YOU NOT USING TDD ?!

while ( TDD === false ) { bugs ++;}

Page 2: Introduction to TDD (PHPunit examples)
Page 3: Introduction to TDD (PHPunit examples)
Page 4: Introduction to TDD (PHPunit examples)

T.D.D ?

Page 5: Introduction to TDD (PHPunit examples)

TEST

DRIVEN

DEVELOPMENT

Page 6: Introduction to TDD (PHPunit examples)
Page 7: Introduction to TDD (PHPunit examples)
Page 8: Introduction to TDD (PHPunit examples)

TEST FIRST

Page 9: Introduction to TDD (PHPunit examples)

MAKE IT PASS AS SIMPLE AS POSSIBLE

Page 10: Introduction to TDD (PHPunit examples)

REFACTOR

Page 11: Introduction to TDD (PHPunit examples)

The web service offered by the government returns the value of the barcode with 44 characters.

A barcode with 48 characters

Our goal

What we have

Page 12: Introduction to TDD (PHPunit examples)
Page 13: Introduction to TDD (PHPunit examples)
Page 14: Introduction to TDD (PHPunit examples)
Page 15: Introduction to TDD (PHPunit examples)
Page 16: Introduction to TDD (PHPunit examples)
Page 17: Introduction to TDD (PHPunit examples)
Page 18: Introduction to TDD (PHPunit examples)

BRING IT ON !

What if we change the code bar to a new one ?

What if we provide a code bar with less than 44 characters ?

Page 19: Introduction to TDD (PHPunit examples)
Page 20: Introduction to TDD (PHPunit examples)
Page 21: Introduction to TDD (PHPunit examples)
Page 22: Introduction to TDD (PHPunit examples)
Page 23: Introduction to TDD (PHPunit examples)
Page 24: Introduction to TDD (PHPunit examples)