Very simple rule of thumb on when to write tests

msedzins

Mirek Sedzinski

Posted on January 1, 2021

Very simple rule of thumb on when to write tests

Testing is a critical part of software development process. And there is a ton of literature on when and how to test.

I'm not a big fun of sticking to any particular approach just because it's currently popular.

Over the course of time I found a simple way to identify potential candidate for tests in my code:

As I write a piece of the code, very often, I start to feel uncertain whether it will work or not. This feeling is accompanied by the urge to execute the code and validate its behaviour at runtime.
Well, this for me is a strong indicator that I should write tests.

Having said that, please mind that I'm talking about potential candidate. Sometimes (rarely), on second thought, I come to conclusion that no tests are needed.

💖 💪 🙅 🚩
msedzins
Mirek Sedzinski

Posted on January 1, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024

Can a Solo Developer Build a SaaS App?
undefined Can a Solo Developer Build a SaaS App?

November 29, 2024

Cybersecurity for Multi-Cloud Environments
undefined Cybersecurity for Multi-Cloud Environments

November 29, 2024