Piccolo coding dojo (milano xpug 2013-04-11)

758 views
698 views

Published on

Introduzione al TDD.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
758
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
1
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Piccolo coding dojo (milano xpug 2013-04-11)

  1. 1. Piccolo Coding Dojo XPUG Milano 10 aprile 2013 Andrea Francia http://andreafrancia.itThursday, April 11, 13
  2. 2. Timetable • A short review of TDD (1pom) • Practice with TDD (2pom) • Retrospective (1pom)Thursday, April 11, 13
  3. 3. Test Driven DevelopmentThursday, April 11, 13
  4. 4. The heart of TDD 1. write a test 2. watch it fail 3. make it pass 4. repeatThursday, April 11, 13
  5. 5. Example: calculatorThursday, April 11, 13
  6. 6. Thursday, April 11, 13
  7. 7. Thursday, April 11, 13
  8. 8. Thursday, April 11, 13
  9. 9. Thursday, April 11, 13
  10. 10. Thursday, April 11, 13
  11. 11. Thursday, April 11, 13
  12. 12. Thursday, April 11, 13
  13. 13. Thursday, April 11, 13
  14. 14. Thursday, April 11, 13
  15. 15. Example: file name extensionThursday, April 11, 13
  16. 16. Thursday, April 11, 13
  17. 17. Thursday, April 11, 13
  18. 18. Thursday, April 11, 13
  19. 19. Thursday, April 11, 13
  20. 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.TheThreeRulesOfTddThursday, April 11, 13
  21. 21. Refactoring (def ): improving design without changing its observable behavior.Thursday, April 11, 13
  22. 22. Refactoring (when) make it pass write • another the Green During test refactorThursday, April 11, 13
  23. 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?XpSimplicityRulesThursday, April 11, 13
  24. 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 FeathersThursday, April 11, 13
  25. 25. Thursday, April 11, 13
  26. 26. GrazieThursday, April 11, 13
  27. 27. Domande?Thursday, April 11, 13
  28. 28. Game of LifeThursday, April 11, 13
  29. 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/coderetreatThursday, April 11, 13
  30. 30. AT EACH STEP IN TIME EVERY CELL INTERACTS WITH ITS 8 NEIGHBORS FOLLOWING 3 RULES http://www.slideshare.net/gabriele.lana/coderetreatThursday, April 11, 13
  31. 31. 1. ANY LIVE CELL WITH FEWER THAN 2 LIVE NEIGHBORS DIES OF LONELINESS http://www.slideshare.net/gabriele.lana/coderetreatThursday, April 11, 13
  32. 32. 2. ANY LIVE CELL WITH MORE THAN 3 LIVE NEIGHBORS DIES OF OVERCROWDING http://www.slideshare.net/gabriele.lana/coderetreatThursday, April 11, 13
  33. 33. 3. ANY DEAD CELL WITH EXACTLY 3 LIVE NEIGHBORS COMES TO LIFE OF WARMTH http://www.slideshare.net/gabriele.lana/coderetreatThursday, April 11, 13
  34. 34. LIFE EVOLUTION 1 2 3 http://www.slideshare.net/gabriele.lana/coderetreatThursday, April 11, 13
  35. 35. LIFE EVOLUTION 1 2 3 http://www.slideshare.net/gabriele.lana/coderetreatThursday, April 11, 13
  36. 36. LIFE EVOLUTION 1 2 3 http://www.slideshare.net/gabriele.lana/coderetreatThursday, April 11, 13

×