Ryan Latta's Insider Circle by Ryan Latta

All issues

A Deep Dive Into Types of Tests 🌊

Happy Friday!


I'm recovering from a minor surgery this week and while I thought I'd wind up being really productive with my prescription of bed rest, no such thing happened.


Still, I was able to work from home and that is a wonderful thing for me.


As it turns out, I a development team was reviewing their work with me and it kind of made me want to attempt to put some organization to my thoughts around what I was seeing. You see, this team was showing me how they tested their work and I was finding many issues with the approaches they used and they aren't unique.


So in this email I'm going to describe a few of them.


Let's start with the two major categories that people tend to talk about a lot—happy path and negative path tests.


Happy path tests are what most teams default to writing when they're not particularly skilled or motivated to write tests. These tests are there to say that they can prove that the case they want works. It doesn't prove anything else. So, for example, if there were a feature to login they'd have a test that confirmed when you click a button, it logs you in.


Happy path tests are important but alone are nowhere near adequate. They don't protect you from anything that goes wrong, strange, or side effects. That login example would not include things like your username and password matching or not. It just includes you got logged in. Happy path tests are confirmation bias in code.


Negative tests, on the other hand, are all the tests that declare what your system does under unexpected or undesired scenarios. This is where most of the time and attention need to be put, but this takes skill and motivation. What's interesting here, though, is there are lots of different sub-categories you could break down.



This list is mostly me getting things out of my head that I see a lot and working with teams on a lot. It may seem like a lot, but typically getting a good mix of these tests only takes minutes to do once you are aware of them and can eliminate so many sources of issues that it more than pays for itself in reclaimed time that your team isn't spending on bugs or debugging and lowers support cost and time since the software and system are far more stable and resilient.


Let me know what you think of my framing of different tests. I always love hearing from you!


Sincerely,

Ryan

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

0 comments

More issues

All 234 →
#100 Dec 2, 2022

Elon Is Everywhere

Read issue →
#99 Nov 25, 2022

Some Tips for Communication ☎️

Read issue →