Member-only story

DO GREAT TESTS STEP-BY-STEP

Great Testing Is Easy!

With these instructions, just leverage on what you already know about programming.

David Rodenas PhD
7 min readMar 6, 2020

--

Prompted and edited by the author.

In the past, I thought that testing was hard, that you need considerable practice to learn to do proper testing. A few days ago, I realized that it is not correct; every programmer already knows how to test. In this article, I present a small recipe that allows anyone to write excellent tests starting today.

First Hint

I learned the first hint from Uncle Bob just a few weeks ago. I was learning from one of their videos, and I heard the following question:

» Which test you write first?

The question surprised me, because I have years of experience writing tests, and I had never asked the same question to myself. But Uncle Bob was right. But the answer that he gave to that question was also surprising and amazingly simple:

» Which production code would you write first?

Almost at the same time that he was answering which test write first, I was responding by myself: the one that forces you to write the first bit of code.

--

--

David Rodenas PhD
David Rodenas PhD

Written by David Rodenas PhD

Passionate software engineer & storyteller. Sharing knowledge to advance our skills. Join me on a journey of discovery in the world of software engineering.

No responses yet