Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Treat yourself - a tale about dog training and ...

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

Slides to my talk at RuhrJS 2019.
You can find the code example on github: https://github.com/programmiri/examples-talk-tdd-dogtraining

Mirjam Aulbach

October 05, 2019
Tweet

More Decks by Mirjam Aulbach

Other Decks in Programming

Transcript

  1. TEST DRIVEN DEVELOPMENT - how Red - Green - Refactor

    Image src: https://giphy.com/gifs/peteandpete-season-3-the-adventures-of-pete-and-3o7Z4tNIWOQWTlfGN2
  2. 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
  3. DOG TRAINING SIMULATOR TASK Program to show others how to

    train a specific behavior to a dog.
  4. 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.
  5. DOG TRAINING SIMULATOR INITIAL SITUATION aka: Requirements ‣no past no

    conditioning ‣rewarding, neutral and punishing consequences ‣visible reactions to consequences
  6. 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
  7. !"#

  8. !

  9. !

  10. 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.
  11. 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
  12. 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