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. 2.
  2. 7.
  3. 19.

    TEST DRIVEN DEVELOPMENT - how Red - Green - Refactor

    Image src: https://giphy.com/gifs/peteandpete-season-3-the-adventures-of-pete-and-3o7Z4tNIWOQWTlfGN2
  4. 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
  5. 22.

    DOG TRAINING SIMULATOR TASK Program to show others how to

    train a specific behavior to a dog.
  6. 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.
  7. 24.

    DOG TRAINING SIMULATOR INITIAL SITUATION aka: Requirements ‣no past no

    conditioning ‣rewarding, neutral and punishing consequences ‣visible reactions to consequences
  8. 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
  9. 28.
  10. 29.
  11. 30.
  12. 31.
  13. 32.
  14. 33.
  15. 35.
  16. 36.
  17. 37.
  18. 38.

    !"#

  19. 39.
  20. 40.
  21. 41.
  22. 42.
  23. 44.
  24. 45.
  25. 46.
  26. 47.
  27. 48.
  28. 49.
  29. 50.
  30. 51.
  31. 52.
  32. 53.
  33. 54.
  34. 55.
  35. 56.
  36. 57.

    !

  37. 58.
  38. 59.
  39. 60.
  40. 61.
  41. 62.
  42. 63.
  43. 64.
  44. 65.

    !

  45. 66.
  46. 67.
  47. 68.
  48. 69.
  49. 70.
  50. 71.
  51. 72.
  52. 73.
  53. 74.
  54. 75.
  55. 76.
  56. 77.
  57. 78.
  58. 79.
  59. 80.
  60. 81.
  61. 82.
  62. 83.
  63. 84.
  64. 85.
  65. 86.
  66. 87.
  67. 88.
  68. 89.
  69. 90.
  70. 91.
  71. 92.
  72. 93.
  73. 94.
  74. 95.
  75. 96.
  76. 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.
  77. 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
  78. 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