Pro Yearly is on sale from $80 to $50! »

Treat yourself - a tale about dog training and test-driven develompent

6fe15a7e096eb9517a201a249e57aa80?s=47 Mirjam
October 23, 2019

Treat yourself - a tale about dog training and test-driven develompent

Slides to my talk at the FrankenJS uers group in Nuremburg.
You can find the code example on github: https://github.com/programmiri/examples-talk-tdd-dogtraining

6fe15a7e096eb9517a201a249e57aa80?s=128

Mirjam

October 23, 2019
Tweet

Transcript

  1. Treat yourself A TALE ABOUT DOG TRAINING AND TEST DRIVEN

    DEVELOPMENT
  2. HI! !

  3. I ! TESTING Image src: https://www.youtube.com/watch?v=dQw4w9WgXcQ

  4. MFW SOMEONE SAYS THEY don't like testing Image src: https://giphy.com/gifs/reaction-dogs-texting-RGK9jWz0t89Hy

  5. THE PERFECT JOB DOES NOT EXI—

  6. I WAS A DOG TRAINER

  7. None
  8. Image src: https://giphy.com/gifs/truthorange-dog-surprised-wtf-xThuW7icYBlQZxjnyg

  9. SO... HOW TO TRAIN A DOG, MIRJAM?

  10. SO... HOW TO TRAIN A DOG, MIRJAM? Original image: https://www.flickr.com/photos/lovine/5433988749

  11. Teach your dog WHAT TO DO Video src: https://giphy.com/gifs/cat-dog-trick-2J2XDIiYBFIu4

  12. Dogs do things when IT'S WORTH IT Image src: https://giphy.com/gifs/happiness-9fuvOqZ8tbZOU

  13. WORK WITH your dogs brain Video src: https://www.youtube.com/watch?v=EbJ5J5SE6ws

  14. Always have a POSITIVE GOAL Image src: https://giphy.com/gifs/cute-aww-eyebleach-2yqyKvK47qaea8IdnV

  15. Take the SMALLEST STEPS Image src: https://i.imgur.com/REevAsi.gifv

  16. BACK TO CODE Image src: https://i.imgur.com/REevAsi.gifv

  17. Test Driven DEVELOPMENT

  18. TEST DRIVEN DEVELOPMENT - what ‣Extreme Programming (XP) ‣Kent Beck,

    2003 ‣Tests first
  19. TEST DRIVEN DEVELOPMENT - how Red - Green - Refactor

    Image src: https://giphy.com/gifs/peteandpete-season-3-the-adventures-of-pete-and-3o7Z4tNIWOQWTlfGN2
  20. TDD CYCLE ‣ ❌ Write a test. ‣ ❌ That

    test fails - obviously ‣ ❌ Write code that makes the test pass ‣ ✅ Test pass! ‣ # Refactor Rinse and repeat! Image src: https://giphy.com/gifs/girl-yeah-wash-JS88XIgg7laNO
  21. LET'S WRITE SOME ✨ tests

  22. DOG TRAINING SIMULATOR TASK Program to show others how to

    train a specific behavior to a dog.
  23. DOG TRAINING SIMULATOR USER STORY I have a dog and

    I want to teach this dog the behavior "Touch", using positive reinforcement as a technique.
  24. DOG TRAINING SIMULATOR INITIAL SITUATION aka: Requirements ‣no past no

    conditioning ‣rewarding, neutral and punishing consequences ‣visible reactions to consequences
  25. DOG TRAINING SIMULATOR MY TRAINING WILL BE SUCCESSFUL WHEN... aka:

    Acceptance Criteria ‣When I say "Touch" ‣and hold two fingers so my dog can access them, ‣my dog comes immediately and with joyful body language to me ‣and presses its nose the two fingers shortly
  26. LET'S THINK ABOUT THIS Image src: https://giphy.com/gifs/dog-computer-ChpOyeacGmpQk

  27. ❌ RED ✅ GREEN ! REFACTOR

  28. None
  29. None
  30. None
  31. None
  32. None
  33. None
  34. That's the real Ruby helping with slides.

  35. None
  36. None
  37. None
  38. !"#

  39. None
  40. None
  41. None
  42. None
  43. TAKE LITTLE STEPS Image src: https://giphy.com/gifs/SignatureEntertainmentUK-cute-doggo-pick-of-the-litter- Ri2MFR3FVDX5hmNlqD

  44. None
  45. None
  46. None
  47. None
  48. None
  49. None
  50. None
  51. None
  52. None
  53. None
  54. None
  55. None
  56. None
  57. !

  58. None
  59. None
  60. None
  61. None
  62. None
  63. None
  64. None
  65. !

  66. None
  67. None
  68. None
  69. None
  70. None
  71. None
  72. None
  73. None
  74. None
  75. None
  76. None
  77. None
  78. Nice!

  79. None
  80. None
  81. None
  82. None
  83. None
  84. None
  85. None
  86. None
  87. None
  88. None
  89. None
  90. None
  91. None
  92. None
  93. None
  94. None
  95. None
  96. SUMMARY

  97. WHAT - imho - TDD IS ABOUT ‣TDD is not

    a strategy for tests, it's a strategy for design. ‣It helps to stay focused and keep things simple. ‣It makes changes easier and refactoring safer. ‣You can work in quick iterations and get in a very motivating feedback loop.
  98. GET INTO TDD HOW TO GET STARTED ‣ start with

    small problems ‣ be open and creative Image src: https://giphy.com/gifs/cute-aww-eyebleach-xFnAObsU5nMrUUC3HX
  99. GET INTO TDD HOW TO GET STARTED ‣ start with

    small problems ‣ be open and creative ‣ don't be dogmatic Image src: https://www.youtube.com/watch?v=dQw4w9WgXcQ
  100. THANKS A LawhoooooOT twitter: @mirjam_diala | github/gitlab: @programmiri