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.

6823d6d1ee14bd068007bd60ddb6a41a?s=128

Kevin Lamping

December 18, 2018
Tweet

Transcript

  1. Developers, just test your code!*

  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)
  3. Why aren’t devs testing?

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

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

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

  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
  8. What’s the answer?

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

  10. Is it the tools?

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

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

  13. Maybe it’s the docs?

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

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

  16. Courses are getting the hint

  17. What is it then?

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

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

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

  21. But but but!

  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/
  23. “There’s no obvious ROI. You can’t get the buy-in or

    budget for testing efforts”
  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/
  25. Either sell testing, or stop asking for permission and just

    do it Warning: opinions ahead!
  26. Can I do that?

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

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

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

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

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

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

    it
  33. You don't write a test, then say, “Yeah! That'll really

    make the customer happy!"
  34. What makes users happy?

  35. Well, not having bugs, obviously.

  36. Responding to feedback and improving the site

  37. We hurt ourselves…

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

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

  40. Sell the result (happier customers)

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

    our customers"
  42. "I can't be effective at my job if I'm not

    able to spend time working on tests"
  43. Move testing from "something I should do" to "something I

    do to get things done"
  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/