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:
Figure 7.1: According to the test pyramid, we should create many cheap tests and fewer expensive ones
The basic statement is that we should have high coverage of fine-grained tests that are cheap to...