Microservices Considerations: Testing

This article is part of the series on Microservices Architecture.

Testing microservices end to end is definitely a lot more challenging than a monolithic application. Each service can implement unit tests and integration tests. However it starts getting complex as the scope of automated testing is expanded. There is an awesome deck from Toby Clemson that talks specifically about testing microservices. The presentation suggests testing at various levels based on boundaries –

  • Component tests – Limiting the tests to the component/service under tests and creating doubles for external interfaces to affect isolation
  • Contract tests – Testing API contract between consumer and provider service.
  • End-to-end – Testing the system end-to-end. This is more involved approach due to lot of moving parts and time required to execute. It can be limited to a few critical user journeys. The tests can also be implemented in GUI where implementing end-to-end tests is common and the entire microservices architecture based system can act as a monolith with services exposed through gateway.

 

Next post summarizes this series on Microservices Architectures and also provides some guidelines for implementation.

Leave a comment