Chapter 7
Testing Architecture Elements
In many projects I have witnessed, automated testing is a mystery. Everyone writes tests as they see fit because it's required by some dusty rule documented in a wiki, but no one can answer targeted questions about the team's testing strategy.
This chapter provides a testing strategy for hexagonal architecture. For each element of our architecture, we will discuss the type of test to cover it.
The Test Pyramid
Let's start the discussion about testing along the lines of the test pyramid (the test pyramid can be traced back to Mike Cohn's book "Succeeding with Agile" from 2009) in the following figure, which is a metaphor that helps us to decide how many tests and of which type we should aim for:
Get Get Your Hands Dirty on Clean Architecture now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.