20. Three Rules of TDD
1. You can’t write any production code
unless is to make green a red test
2. You can’t add more code to a test than is
sufficient to make it red
3. You can’t write more production code than
is sufficient to make the test green
http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
Thursday, April 11, 13
21. Refactoring (def ):
improving design without
changing its observable behavior.
Thursday, April 11, 13
22. Refactoring (when)
make it
pass
write
•
another the Green
During
test
refactor
Thursday, April 11, 13
23. Simple Design
A design is simple when:
1. pass all tests
2. contains no duplication
3. express the intent
4. minimal, nothing superfluous
http://c2.com/cgi/wiki?XpSimplicityRules
Thursday, April 11, 13
24. What is not unit test?
A test is not a unit test if:
1. It talks to a database.
2. It communicates across a network.
3. It touches the file system.
4. Requires some manual set-up
Working Effectively with Legacy Code - Michael Feathers
Thursday, April 11, 13
29. THE GAME OF LIFE
IS A TWO
DIMENSIONAL GRID
OF SQUARE CELLS
EACH OF WHICH IS
IN ONE OF TWO
POSSIBLE STATES
ALIVE OR DEAD
http://www.slideshare.net/gabriele.lana/coderetreat
Thursday, April 11, 13
30. AT EACH STEP IN
TIME EVERY CELL
INTERACTS WITH
ITS 8 NEIGHBORS
FOLLOWING 3
RULES
http://www.slideshare.net/gabriele.lana/coderetreat
Thursday, April 11, 13
31. 1. ANY LIVE CELL WITH FEWER THAN 2
LIVE NEIGHBORS DIES OF LONELINESS
http://www.slideshare.net/gabriele.lana/coderetreat
Thursday, April 11, 13
32. 2. ANY LIVE CELL WITH MORE
THAN 3 LIVE NEIGHBORS
DIES OF OVERCROWDING
http://www.slideshare.net/gabriele.lana/coderetreat
Thursday, April 11, 13
33. 3. ANY DEAD CELL WITH
EXACTLY 3 LIVE NEIGHBORS
COMES TO LIFE OF WARMTH
http://www.slideshare.net/gabriele.lana/coderetreat
Thursday, April 11, 13
34. LIFE EVOLUTION
1 2 3
http://www.slideshare.net/gabriele.lana/coderetreat
Thursday, April 11, 13
35. LIFE EVOLUTION
1 2 3
http://www.slideshare.net/gabriele.lana/coderetreat
Thursday, April 11, 13
36. LIFE EVOLUTION
1 2 3
http://www.slideshare.net/gabriele.lana/coderetreat
Thursday, April 11, 13