by BehindJava

What is Mike Cohen's Test pyramid in Microservices

Home » microservices » What is Mike Cohen's Test pyramid in Microservices

In this tutorial, we are going to learn about Mike Cohen’s Test pyramid in Microservices.

Mike Cohen’s Test pyramid in Microservices

In microservices, the performance is verified through a series of testing methods that tells the amount of testing required. Mike Cohen’s Test pyramid approach follows the bottom-up approach in which the scope of testing gets narrower while going upwards, keeping the execution time of testing elevated and the execution time and scope of testing share an inverse relationship.

Mike Cohen's Test pyramid

Regardless of the shared inverse relationship, microservices are tested with the following testing procedures:

Unit testing: Unit testing is preferably automated, although test automation entirely depends upon the development language and framework used in the microservice.

Contract testing: Contract testing treats every service independently while verifying their responses. This saves the other service containers from being affected in case one of the services under-performs.

Integration testing: Tests every service individually for performance. Service calls are made with integration to the external services that entail error and success cases. This method validates that the system is proficiently working and all the services are perfectly integrated.

End-to-end/E2E testing: E2E testing ensures that the process flows continuously with all services and database (DB) integration. The rigorous testing of operations ensures that the system works as a whole and can remain unaffected even if a component(s) becomes defunct.

UI/functional testing: Tests the application as it would be tested by the end-user. It gives the feeling of the user trying to interact with the system in real time.