Understanding the testing pyramid
The testing pyramid is an easy concept to understand the relative notion of performance, expense, and robustness for the different kinds of testing. The following diagram shows various kinds of testing in the testing pyramid and how much effort is required:
As depicted in the preceding diagram, unit testing is fast, robust, and inexpensive whereas as we go towards the top of the pyramid, testing becomes sluggish, brittle, and expensive. Though all kinds of testing are required to fully verify whether the application is working as expected, a fine balance is critical to cut expenses and increase robustness and speed. Put simply, have a lot of unit tests, a number of service tests, and very few end-to-end tests. This will ensure quality at a greater speed and with less cost.
In the next section, we will begin the automated testing journey with unit testing.