Ryan Latta's Insider Circle by Ryan Latta

All issues

Do You Code Review Your Tests 🎒

Why do we mostly code review only our code and not the tests that protect us? Here are some things to look for in tests.

Happy Friday,


A big thanks to those of you who emailed me with encouragement and shared my excitement about bees! They're happy and healthy. I was freaking out the first time, being the proud dad of ~20,000 new kids can do that.


Especially since it snowed the day after I got them.


Anyway, they're alive and well and if you want to see a video of the ladies from Wednesday when I did my big check, you can watch that here.


It shouldn't be any surprise that I love the unlovable parts of our software industry, which means I love tests. I was on a call with a client who admitted that they got completely lost when looking at their tests because they knew there had to be a better way, but they couldn't decide what to do.


This led me to a question.


"Do you code review your tests?"


The answer was they do not. This is common for a lot of groups I see. They are adamant about checking on the production code, but the tests are often ignored.


But lets do a thought experiment. If we do code reviews to protect ourselves from buggy poorly written code, and tests are code, then shouldn't we review that too?


After all, if the tests have bugs and are poorly written, won't that create problems down the road?


Of course it will.


Ignoring test quality often leads to a few symptoms.



So my advice is to incorporate the test code into your code review. Now, test code is a different animal from normal code, so it will be slow at first because what we look for tends to be different. Here are some things to look at when you're reviewing test code.



There's more to consider, but by reviewing tests we keep the very thing that protects us in good working order.


I'm curious though, how many of your groups look at the test code as a part of code review?


Sincerely,

Ryan

Share
Get the next issue in your inbox
Free, and you can unsubscribe any time.

0 comments

More issues

All 234 β†’
#72 Apr 1, 2022

How Does Engineering Get Time For Tech Debt? πŸ‘»

Read issue β†’
#71 Mar 25, 2022

A Couple Quick Links 😁

Read issue β†’