Member-only story

Here’s how being unpredictable elevates your Software Tests

Bending the Clean Architecture Principles

Anthony Trad
4 min readFeb 19, 2023
Meme

Introduction

Convincing your fellow teammates and manager that writing tests speed you up and does not slow you down is a big hassle. I struggled with this countless times in my consulting roles back in the day. I was seen as an “wannabee” that follows what he reads and does not understand how the real world works. We tried and it didn’t work !” was the top answer…

Writing tests is hard, no matter how senior you are. Here’s how you can make your tests more effective by embracing Randomness and unpredictability:

Randomness

Randomness is a concept that describes events or outcomes that seem to happen without any predictable pattern or order. It’s like a box of chocolates where you never know which flavor you’re going to get next.

But you know that don’t you so why do you care? Let’s take a practical code oriented example:

public class Customer 
{
public string Id {get;set;}
public string FullName {get;set;}
public Phone PhoneNumber {get;set;}
public bool IsVip {get;set;}
public string Email {get;set;}
public int SSNumber {get;set;}
}

--

--

Anthony Trad
Anthony Trad

Written by Anthony Trad

Senior Software Engineer focused on .NET and the Cloud. Reconsidering major principles and patterns, ideas are my own.

No responses yet