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

Testing: It's a Horrible Idea

Testing: It's a Horrible Idea

The ruby community likes tests. And that's a good thing. But sometimes rubyists go a bit too far with this. Can there be too much testing? Is that considered harmful?

This presentation goes over the problems of "too much testing", and those of a natural consequence of having too many tests: irrelevant/bad tests. It then moves onwards to a few things I've picked up during the last few years that have helped me in keeping my test suites under control.

Nicolás Sanguinetti

November 09, 2011
Tweet

More Decks by Nicolás Sanguinetti

Other Decks in Programming

Transcript

  1. Testing
    It’s a Horrible Idea

    View Slide

  2. Nicolas
    Sanguinetti
    @godfoca
    github.com/foca

    View Slide

  3. Nicolas
    Sanguinetti
    @godfoca
    github.com/foca

    View Slide

  4. TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TES
    TES
    TEST
    TEST
    TE
    EST

    View Slide

  5. TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TES
    TES
    TEST
    TEST
    TE
    EST
    Quickly Find
    Regressions

    View Slide

  6. TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TES
    TES
    TEST
    TEST
    TE
    EST
    Repeatable
    Test Process

    View Slide

  7. TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TES
    TES
    TEST
    TEST
    TE
    EST
    Better OOP
    Design

    View Slide

  8. TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TES
    TES
    TEST
    TEST
    TE
    EST
    Documentation

    View Slide

  9. TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TES
    TES
    TEST
    TEST
    TE
    EST
    Software
    Without
    Errors

    View Slide

  10. TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TEST
    TES
    TES
    TEST
    TEST
    TE
    EST
    Peace of
    Mind for You

    View Slide

  11. This is
    True

    View Slide

  12. Tests are
    GOOD

    View Slide

  13. But
    if you
    Abuse
    them,

    View Slide

  14. http://www.flickr.com/photos/katiesnape/5165365743
    They
    Will
    Harm
    You.

    View Slide

  15. http://xkcd.com/303/
    Time to Run
    http://www.flickr.com/photos/darrentunnicliff/4469318003

    View Slide

  16. http://xkcd.com/303/
    Time to Run

    View Slide

  17. http://en.wikipedia.org/wiki/File:Oiled_bird_3.jpg
    Maintenance
    http://en.wikipedia.org/wiki/File:Deepwater_Horizon_offshore_drilling_unit_on_fire_2010.jpg

    View Slide

  18. http://en.wikipedia.org/wiki/File:Oiled_bird_3.jpg
    Maintenance

    View Slide

  19. Difficult to Understand
    http://www.flickr.com/photos/mscolly/145052885

    View Slide

  20. False Sense of Security
    http://www.flickr.com/photos/glowbird/4927122391

    View Slide

  21. We Need
    Solutions

    View Slide

  22. Less
    Tests

    View Slide

  23. Simpler
    Tests

    View Slide

  24. Faster
    Tests

    View Slide

  25. Sometimes it isn’t worth it
    https://twitter.com/jamesgolick/status/119911430387544064

    View Slide

  26. Golden Rule
    of Testing

    View Slide

  27. Listen
    to your
    Tests

    View Slide

  28. Now forget
    everything
    I just said

    View Slide

  29. Thanks
    @godfoca

    View Slide

  30. Questions?
    [email protected]

    View Slide

  31. Resources
    http://confreaks.net/videos/641-gogaruco2011-fast-rails-tests
    Fast Rails Tests – Corey Haines
    http://confreaks.net/videos/659-rubyconf2011-why-you-don-t-get-mock-objects
    Why Don’t You Get Mock Objects – Gregory Moeck
    http://blog.rubybestpractices.com/posts/gregory/050-issues-18-testing-dogma.html
    Dirty Little Secrets About Testing – Gregory Brown
    http://speakerrate.com/talks/8891-testing-it-s-a-horrible-idea
    Please rate this talk on SpeakerRate! Thanks!
    http://speakerdeck.com/u/foca/p/testing-its-a-horrible-idea
    These Slides :)

    View Slide