Why you should use Architecture Tests in .NET

Bending the Clean Architecture Principles

Anthony Trad
4 min readAug 19, 2022
Testing

Introduction

Tests can arguably be more important than the code itself. You always get asked about your test coverage, what tests do you use, how did you implement them… People even discuss the famous Pyramid of Tests and try to implement as much as they can in their codebase.

Architecture Tests are like the hidden distant cousin nobody knows about. They are not even mentioned in the Pyramid of Tests and are forgotten most of the time.

Yet I have worked on some projects where these tests actually saved the day on multiple occasions. We had a lot of turnovers, with 2 internships welcoming periods. Also, hiring Seniors is generally more painful than juniors so the company would opt for that most of the time.

Why does it matter

In short, your team is mostly fresh and junior and if you’re working on a complex high scale application, you’ll basically always do the heavy lifting and double checking that all the standards you defined are actually being applied. Project references and dependencies, naming conventions, project structure and organization etc…

--

--

Anthony Trad

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