3 Minutes with Kent

Why I don't have tests for my blog

01.07.2021 - By Kent C. DoddsPlay

Download our free app to listen on your phone

Download on the App StoreGet it on Google Play

What is up my friends so I'm a little bit late today, sorry but it is

January 6, 20 21 and I'm excited to talk about testing so I had a bug on my

website kidsdance.com slash contact where you'd fill out a contact form and

one of the things that happens is server side validation, so that uses a

serverless function that I have running on Netlify, it is great, it's

awesome the way that it works but yeah one of what it does is it uses a,NPM

module called OW to do validation and on my website.

I pretty much just like every week when I write a blog post I just update

all the packages sometimes. I'll take a look at some of the breaking

changes like major version bumps and stuff but often I just like I pull up

and ship it because I don't really care and that's actually kind of what I

wanted to talk about is.

I I do have some tests on my website. I have one or I,Handful of unit tests

and then a cypress test that just makes sure that you can pull it up and

and click on this on a link and stuff so I know that at least it does open

but I didn't have any sort of test for my contact form which is why this

bug slipped out but here's here's the reason why I haven't invested any

time into testing my own site, which is kind of like a lot of people would

think that's paradoxical like hold on a second can't see.

Dodds doesn't even test his own website, well the thing is that I think

that it's important that you measure or that you think about.The things

that you have to do all relative to one another and that includes tests so

tests is just another task on your list of things to do and you need to

think consider things relative to their return on the investment and for me

writing some tests for my website has a pretty low return on investment

frankly, like if something breaks it's not a huge deal.

I'm not like taking people's money there or storing their you know, secure

information or anything like that, it's not like a big deal of something

breaks and that was the case here somebody sent me an email and said, hey

your contact form is broken and that's why I sent you.

Direct email so yeah maybe I missed a couple of contacts you know people

saying trying to contact me but actually I don't really care how much so

yeah so it ended up not being a big deal. I fixed it and I pushed that out

and hopefully the context form is working now but I just wanted to talk

about that.

I do have a blog post actually about this, you know, whether you should fix

the bug or write a test, you know, just how you prioritize testing and for

me, I prioritize it like everything else that I do just consider the return

on investment and focus on the highest return hope that's helpful have a

wonderful day.

More episodes from 3 Minutes with Kent