$30 off During Our Annual Pro Sale. View Details »

The State of Testing 2018 - Why Aren't Devs Testing?

The State of Testing 2018 - Why Aren't Devs Testing?

A short 5-minute presentation given at This Dot's "The State of Testing 2018" online roundtable.

Kevin Lamping

December 18, 2018
Tweet

More Decks by Kevin Lamping

Other Decks in Programming

Transcript

  1. Developers,
    just test your code!*

    View Slide

  2. *The reasons developers don’t test their
    code is multifaceted and not a reflection of
    their skill or worth as a human being
    (and a lot of developers *do* test their code)

    View Slide

  3. Why aren’t devs testing?

    View Slide

  4. “Which tool do you use to test your
    JavaScript?”
    https://ashleynolan.co.uk/blog/frontend-tooling-survey-2018-results#js-testing

    View Slide

  5. https://slides.com/seldo/npm-future-of-javascript#/74

    View Slide

  6. “Do you write tests?”
    https://ponyfoo.com/articles/javascript-developer-survey-results#do-you-write-tests

    View Slide

  7. “How much automated testing do you
    feel you have on a typical project?”
    Disclaimer, it's only 27 votes… from people who follow me

    View Slide

  8. What’s the answer?

    View Slide

  9. Developers are testing,
    but don't seem content

    View Slide

  10. Is it the tools?

    View Slide

  11. “Would you use again?”
    https://2018.stateofjs.com/testing/overview/

    View Slide

  12. “How happy are you (1-5)”
    https://2018.stateofjs.com/testing/conclusion/

    View Slide

  13. Maybe it’s the docs?

    View Slide

  14. Most Liked Aspects of Jest
    https://2018.stateofjs.com/testing/overview/

    View Slide

  15. Most Liked Aspects of Mocha
    https://2018.stateofjs.com/testing/overview/

    View Slide

  16. Courses are getting the hint

    View Slide

  17. What is it then?

    View Slide

  18. “What's holding you back from writing
    automated tests?”
    https://twitter.com/klamping/status/739101158061395968

    View Slide

  19. https://twitter.com/klamping/status/739101158061395968

    View Slide

  20. “What's holding you back from writing
    automated tests?”
    https://twitter.com/klamping/status/739101158061395968

    View Slide

  21. But but but!

    View Slide

  22. •Unit Tests allows you to make big changes to code quickly.
    •TDD helps you to realize when to stop coding.
    •The tests and the code work together to achieve better code.
    •TDD helps with coding constipation. When faced with a large and daunting piece of work
    ahead writing the tests will get you moving quickly.
    •Unit Tests help you really understand the design of the code you are working on.
    •Unit Tests give you instant visual feedback, we all like the feeling of all those green lights
    when we've done.
    •Contrary to popular belief unit testing does not mean writing twice as much code, or
    coding slower.
    •Good unit tests can help document and define what something is supposed to do
    •Unit tests help with code re-use.
    https://stackoverflow.com/questions/67299/is-unit-testing-worth-the-effort/

    View Slide

  23. “There’s no obvious ROI. You can’t get
    the buy-in or budget for testing efforts”

    View Slide

  24. •Unit Tests allows you to make big changes to code quickly.
    •TDD helps you to realize when to stop coding.
    •The tests and the code work together to achieve better code.
    •TDD helps with coding constipation. When faced with a large and daunting piece of work
    ahead writing the tests will get you moving quickly.
    •Unit Tests help you really understand the design of the code you are working on.
    •Unit Tests give you instant visual feedback, we all like the feeling of all those green lights
    when we've done.
    •Contrary to popular belief unit testing does not mean writing twice as much code, or
    coding slower.
    •Good unit tests can help document and define what something is supposed to do
    •Unit tests help with code re-use.
    https://stackoverflow.com/questions/67299/is-unit-testing-worth-the-effort/

    View Slide

  25. Either sell testing, or stop asking
    for permission and just do it
    Warning: opinions ahead!

    View Slide

  26. Can I do that?

    View Slide

  27. https://insights.stackoverflow.com/survey/2017#evaluating-developers

    View Slide

  28. https://insights.stackoverflow.com/survey/2017#evaluating-developers

    View Slide

  29. https://insights.stackoverflow.com/survey/2017#evaluating-developers

    View Slide

  30. Code coverage? Number of tests?
    Users don't care!

    View Slide

  31. Ability to effectively use the site?
    Users care!

    View Slide

  32. Why code coverage then?
    Easier to measure; Can immediately impact it

    View Slide

  33. You don't write a test, then say,
    “Yeah! That'll really make the customer happy!"

    View Slide

  34. What makes users happy?

    View Slide

  35. Well, not having bugs, obviously.

    View Slide

  36. Responding to feedback and improving the site

    View Slide

  37. We hurt ourselves…

    View Slide

  38. Tight coupling in tests and poorly managed
    dependencies slow us down

    View Slide

  39. "Does this make it easier to update my code?”

    View Slide

  40. Sell the result (happier customers)

    View Slide

  41. "Testing helps me know that I'm not
    ruining things for our customers"

    View Slide

  42. "I can't be effective at my job if I'm not able to
    spend time working on tests"

    View Slide

  43. Move testing from "something I should do" to
    "something I do to get things done"

    View Slide

  44. • https://slides.com/seldo/npm-future-of-javascript#/74
    • https://2018.stateofjs.com/testing/overview/
    • https://twitter.com/klamping/status/1072881714798702595
    • https://ashleynolan.co.uk/blog/frontend-tooling-survey-2018-results#js-testing
    • https://ponyfoo.com/articles/javascript-developer-survey-results#do-you-write-tests
    • https://twitter.com/klamping/status/739101158061395968
    • https://insights.stackoverflow.com/survey/2017#evaluating-developers
    • https://stackoverflow.com/questions/67299/is-unit-testing-worth-the-effort/

    View Slide