Slide 1

Slide 1 text

Developers, just test your code!*

Slide 2

Slide 2 text

*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)

Slide 3

Slide 3 text

Why aren’t devs testing?

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

What’s the answer?

Slide 9

Slide 9 text

Developers are testing, but don't seem content

Slide 10

Slide 10 text

Is it the tools?

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

Maybe it’s the docs?

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

Courses are getting the hint

Slide 17

Slide 17 text

What is it then?

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

But but but!

Slide 22

Slide 22 text

•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/

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

•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/

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

Can I do that?

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

Ability to effectively use the site? Users care!

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

What makes users happy?

Slide 35

Slide 35 text

Well, not having bugs, obviously.

Slide 36

Slide 36 text

Responding to feedback and improving the site

Slide 37

Slide 37 text

We hurt ourselves…

Slide 38

Slide 38 text

Tight coupling in tests and poorly managed dependencies slow us down

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

Sell the result (happier customers)

Slide 41

Slide 41 text

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

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

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

Slide 44

Slide 44 text

• 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/