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

Who will test your tests?

Who will test your tests?

Presentation for VodQA, Pune, November 2014

Shirish Padalkar

November 15, 2014
Tweet

More Decks by Shirish Padalkar

Other Decks in Technology

Transcript

  1. 20

  2. WHY WE WRITE TESTS? 27 Tests prove that the code

    actually works Tests prove that the code sometimes works
  3. WHY WE WRITE TESTS? 29 Tests reduce the Cost of

    Change Change? Are you kidding? I will need a week to change my framework and make sure everything works!
  4. WHY WE WRITE TESTS? 31 Testing helps in faster development.

    Testing is slowing me down :( I am not sure when to stop writing code. Tests keep randomly failing and succeeding.
  5. WHY WE WRITE TESTS? 32 Tests reduce fear Don’t touch

    that code and tests. You will break them!
  6. WHY FLAKY TESTS ARE PROBLEM 36 THEY BREAK YOUR TRUST!

    A red build doesn’t mean anything anymore!
  7. 48

  8. 49

  9. 50

  10. HOW TO FIX FLAKY TESTS 54 KEEP ONLY N TESTS

    IN QUARANTINE Let’s say, 5 tests at any given point
  11. HOW TO FIX FLAKY TESTS 56 UNDERSTAND NATURE OF FLAKINESS

    Most flakiness is due to our own mistakes!
  12. HOW TO FIX FLAKY TESTS 58 YOU KNOW THERE MIGHT

    BE BUGS IN PRODUCTION CODE TEST
  13. 67 TALK TO THE TEAM IF WRITING THE TEST IS

    HARD There might a code smell lying somewhere
  14. RESOURCES ▫︎Eradicating Non-Determinism in Tests - by Martin Fowler ▫︎No

    more flaky tests on the Go team - by Pavan Sudarshan ▫︎Top 12 Reasons to Write Unit Tests - by Eric M. Burke and Brian M. Coyner ▫︎Flaky crusts: Good for pies; bad for test suites ▫︎Creating Maintainable Automated Acceptance Tests - By Jez humble and Badri 70