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

Treat yourself - A tale about dogtraining and test driven development

Treat yourself - A tale about dogtraining and test driven development

Slides to my keynote at European Testing Conference 2020 in Amsterdam.
You can find the code example on github:
https://github.com/programmiri/examples-talk-tdd-dogtraining

Mirjam Aulbach

February 06, 2020
Tweet

More Decks by Mirjam Aulbach

Other Decks in Programming

Transcript

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  4. THE PERFECT JOB DOES NOT EXI—

    View full-size slide

  5. I WAS A DOG
    TRAINER

    View full-size slide

  6. Image src: https://giphy.com/gifs/truthorange-dog-surprised-wtf-xThuW7icYBlQZxjnyg

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  14. Test Driven
    DEVELOPMENT

    View full-size slide

  15. TEST DRIVEN DEVELOPMENT
    Tests first

    View full-size slide

  16. TEST DRIVEN DEVELOPMENT - how
    Red - Green - Refactor
    Image src: https://giphy.com/gifs/peteandpete-season-3-the-adventures-of-pete-and-3o7Z4tNIWOQWTlfGN2

    View full-size slide

  17. 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

    View full-size slide

  18. Image src: https://martinfowler.com/bliki/TestPyramid.html

    View full-size slide

  19. LET'S WRITE SOME

    tests

    View full-size slide

  20. DOG TRAINING SIMULATOR
    TASK
    Program to show others how to train a specific behavior to a dog.

    View full-size slide

  21. 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.

    View full-size slide

  22. DOG TRAINING SIMULATOR
    INITIAL SITUATION
    - no past no conditioning
    - rewarding, neutral and punishing consequences
    - visible reactions to consequences

    View full-size slide

  23. DOG TRAINING SIMULATOR
    My training will be successful when...
    - I say "Touch"
    - and hold two fingers so my dog can access them,
    - my dog comes immediately and
    - with a joyful body language to me and
    - presses its nose at the two fingers shortly.

    View full-size slide

  24. LET'S THINK ABOUT THIS

    View full-size slide

  25. RED
    GREEN
    REFACTOR

    View full-size slide

  26. Take
    little
    steps!

    View full-size slide

  27. WHAT - imho - TDD IS ABOUT
    TDD is not only 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.

    View full-size slide

  28. TESTER
    !
    DEVELOPER
    How it brings us together
    - help developers to refine tests
    - build a balanced testing pyramid together
    Image src: https://giphy.com/gifs/dog-hug-sX755wvr2Q6gE

    View full-size slide

  29. THANKS A
    LawhoooooOT

    View full-size slide