際際滷

際際滷Share a Scribd company logo
Test Driven Development
Aim loosely
@pedromsantos
Fail to succeed
Red, Green, Refactor
The TDD mantra
Laws
 You are not allowed to write any production code
unless it is to make a failing unit test pass.
 You are not allowed to write any more of a unit
test than is suf鍖cient to fail; and compilation
failures are failures.
 You are not allowed to write any more production
code than is suf鍖cient to pass the one failing unit
test.
Bene鍖ts
 Debugging
 Courage
 Documentation
 Design
 Professionalism
Qualities of a Good Unit Test
 Atomic
 Isolated
 Repeatable
 Revealing
 Easy to Setup
 Fast
Inside a test
 Arrange  all necessary preconditions and
inputs
 Act  on the object or method under test
 Assert  that the expected results have occurred
 Assert First?
Strategies
 Use Obvious Implementation
 Fake it
 Triangulate
Practice
 Code Kata
 Community
 London Software Craftsmanship Community
Demo
SoCraTes UK 2014
International Software Craftsmanship gathering
12th  15th June, Farncombe Estate
!
http://socratesuk.org/
References
 http://www.amazon.com/exec/obidos/ASIN/
0321146530/ambysoftinc
References
 https://leanpub.com/socra
References
 http://www.meetup.com/london-software-
craftsmanship/
 http://codingdojo.org/cgi-bin/index.pl?
KataCatalogue
 http://cyber-dojo.org/
 http://programmer.97things.oreilly.com/wiki/
index.php/The_Three_Laws_of_Test-
Driven_Development
Thank you!
@pedromsantos

More Related Content

Intro TDD Portuguese developers meetup London 16/04/2014