Member-only story

Hot take 🔥. You should probably stop writing unit tests.

Richard Oliver Bray
9 min readNov 23, 2022

--

Photo by Elisa Ventur on Unsplash

If you’ve been a developer for any amount of time you would have written, or at least heard of unit tests. They’re a way to test that a unit of code that you’ve written is doing what it’s supposed to be doing. There’s a good definition of what they are on Smartbear.com

“A unit test is a way of testing a unit — the smallest piece of code that can be logically isolated in a system.” Smartbear.com

Simple unit test in Ruby
Unit test example from smartbear.com

They make sense right? And for the longest time I’ve been okay with unit tests. They can be a pain to write and can break quite easily but for the most part, they’re a good way of quickly giving you, the developer confidence in your code. I thought that until recently when a few things happened at once that made me change my mind about them.

Firstly, I watched an episode of DevHour hosted by a popular code streamer (I don’t know if that’s the official term) called, The Primeagen. Prime interviewed someone called Theo was a developer at Twitch but now has his own company called ping.gg. Anyway, a huge chunk of this conversation was spent on Theo explaining why he didn’t like unit tests. In fact, his codebase for ping.gg does not contain any…

--

--

Richard Oliver Bray
Richard Oliver Bray

Written by Richard Oliver Bray

Co-founder of orva.studio. Building digital products and teaching others to do the same. Saved by grace.

Responses (1)