Usually, full-stack web apps are large and complex. They are designed to expand their functionalities to serve hundreds of different requirements of millions of users. Consequently, as the size of a full-stack codebase and the number of users grow, the cost of dealing with bugs also escalates. This, however, can be successfully mitigated by applying the concept of the test pyramid to your codebase.
The test pyramid approach implies a radical way of thinking as to how different kinds of automated tests can and should be used to create a balanced portfolio. It emphasizes that the number of low-level UnitTests should be much more than high-level BroadStackTests running through a GUI.
When discussing HTTP APIs, you can actualize a test pyramid by following the steps mentioned below:
- Incorporate plenty of low-level unit tests for your model.
- Include fewer joining tests used for determining how your models collaborate with each other.
- Include fewer acknowledgment tests used for testing genuine HTTP endpoints.