Component testing

Once we have done unit and integration testing for all functions of the modules within a microservice, we need to test each microservice in isolation. A distributed system might be composed of a number of microservices. So, when it comes to testing a microservice in isolation, we have to create a mock of other microservices. Consider the following diagram on component-testing a microservice:

Component testing involves testing the interaction of a microservice with its dependencies, such as a database, all as one unit.

Component testing tests the separation of a component from a large system. A component is a well defined and encapsulated part of a large system, which can be independently replaced. Consequently, testing such components in an isolated system provides many benefits, such as the separation of concern among components of the application, as well as also testing the complexity of a microservice with external services. So, external services and external data stores must be replaceable with stub services and in-memory data stores respectively.

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

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