The purpose of testing in the microservices world

Microservices are different from monolithic applications in many ways, so the approach to testing microservices can't be the same as that of testing monolithic applications. As releases are more frequent in microservices, speed is an important factor. To keep up the speed, testing of microservices should also be fast, but quality is also a major factor in microservice testing. Testing one microservice in isolation, though tricky, is a good practice -unit tests can help us here. However, this is not the case all the time. A microservice is used to communicate with a third-party sometimes, and also other microservices; so unit testing is not sufficient here. Any change in service A can impact the communication between service A and service B. So, the developer/QA has to ensure that nothing is broken during this development process. Many teams are working on different components, but they impact communication between other microservices, so it is essential to have contract testing in place. The QA is supposed to perform end-to-end testing on the platform; some of these tests can be automated, while others are manual.

From this discussion, it is clear that no one method is sufficient to ensure the compatibility, integrity, and quality of newly developed microservices. To ensure all this, we will combine some of the best-suited testing strategies to accomplish our objective. The layers shown in the following diagram are not fixed or suitable for all organizations, but this can be treated as a model for testing paradigms in microservices:

Every organization makes changes in this layer structure according to their team and requirement. Testing starts with unit testing and ends on end-to-end (E2E) testing. We will go through each layer in the upcoming sections.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset