Logo Valérian de Thézan de Gaussan

On the importance of tests in software.

Valerian Valerian
December 1, 2022
3 min read
Table of Contents

Most developers don’t test. That’s the sad, shocking reality of today’s software industry.

Building software is already a challenging pursuit. We navigate the maze of client needs, solution design, infrastructure setups, and team coordination. But here’s the brutal truth: none of it matters if your code doesn’t work, and you don’t actually know if it works if you’re not testing it. Testing isn’t a nice-to-have; it’s the foundation of quality, and quality is non-negotiable.

A Cautionary Tale

Take this: An e-commerce platform’s data pipeline processes thousands of customer orders each day. Then, one day, an order comes through with a slightly off format. Let’s say an odd timestamp, as it can often be the case with dates. A minor glitch, right? Wrong. That small formatting blip turns into a system-wide disaster as it cascades through the data pipeline, triggering exceptions like falling dominoes until the backend chokes, transactions grind to a halt, and revenue stops flowing. All because no one anticipated or tested for this “unexpected” case.

This isn’t some rare nightmare scenario. It’s the sort of thing happening every single day in software everywhere, and it’s preventable.

So, How Do You Prevent It?

Sure, you can’t predict every oddball input that might hit your pipeline—data is infinite. But you can test for the cases that matter. For a validation issue like the one above, there are two main scenarios: valid data and invalid data. Business rules define “valid,” and once you’ve defined those rules, it’s simple to test.

  1. Build a few invalid test cases: a null order, an empty order, an order with no amount.
  2. Gather some valid cases.
  3. Write tests to make sure the invalid cases are rejected, and the valid cases flow through without a hitch.

Tests should be lightning fast, running in milliseconds, so you can check things the instant you make changes. They stay in the codebase, so the next person who touches the code can use them too. Testing is a guardrail for every future developer.

Yet, Half the Industry Isn’t Testing

Shockingly, around 50% of developers don’t test. And for the other half, testing is sporadic at best. This isn’t speculation: it’s backed by hard data! Check this IEEE paper.