Understanding API, contract, and integration testing
To further clarify the difference between these tests and identify potential dangers and gaps when testing the middle of the pyramid, we have researched for many years and come up with the best schema that will express this:
Figure 3.1: The bicycle example
Yes! This is a bicycle.
The years of research part was a joke. However, one of the first questions that used to be asked in every interview that had anything to do with testing is “how would you test …” followed by a day-to-day item (generally a pen or similar). Let’s put that question to work here since a bicycle is a perfect visual example that could help us find the difference between these tests:
- The wheels are components. We can test that they have the right amount of air, friction, and so on (component testing).
- We can also test the unit of the code that would control the wheels – for example...