We are seeing a big paradigm shift from monolithic applications to cloud-native applications. Everybody is talking about microservices architecture, how to independently deploy, scale and maintain these microservices. But are we talking enough about how to test these microservices? What are the types of testing required to test them in isolation as well as in terms of end-to-end integration? In this talk, I will cover my journey in the world of microservices testing which I embarked on a couple of years back and what I learned during these years. We will cover all possible types of testing including unit, contract, integration, resiliency, performance, and end-to-end testing.
2. Hello!
I am Amit Rawat
I am here because I love to talk on Test
Automation.
“I am a Civil Engineer by qualification, a Test
Automation Architect by profession and a
Developer by passion.”
You can find me at:
Twitter/Medium: @sahajamit
Email: sahajamit@gmail.com
6. Positives of Monolithic Architecture
Image Source: https://dzone.com/articles/microservices-1-introduction-monolithic-vs-microse
7. Drawbacks of Monolithic Architecture
- has limitation in size and complexity
- too large and complex to fully understand and made changes
fast and correctly
- Re-deploy the entire application on each update.
- Impact of a change is not easily traceable and it leads to
extensive manual testing
- Single point of failure.
- Not flexible to adopt new technologies/languages
12. Why Microservices?
Image Source: https://dzone.com/articles/microservices-1-introduction-monolithic-vs-microse
● Services are small, independent and loosely coupled
● Each service is a separate code base managed by a small dev team
● Services can be deployed to production independently
● Services communicate to each other using a well defined api
(contract/schemas)
● Services do not need to share the same tech stack, libraries or
frameworks
● Responsible for persisting their own data
14. Microservices Anti-patterns
● Breaking the monolith in to pieces without intentional
division of services either by domain or unit of work
you end up creating several mini monoliths.
● Everything micro except data
● Relying on consumer sign-offs
● Building a gateway in every service
15. Testing the entire stack of Microservices
Source: https://twitter.com/simform/status/1133352132013199366
28. Contract Testing: Take 2
Source: https://docs.confluent.io/current/schema-registry/index.html
29. End-to-end Journey tests
● Try to have as few end-to-end tests as possible.
● Focus on important user journeys
● Use Infrastructure as a code for repeatability
● Make your tests data-independent
Source: https://www.hanoverresearch.com/insights-blog/4-tests-measure-customer-journey-mapping/
30. Non-Functional Testing in Microservices
● Resilience / Fault-tolerance Testing
● Chaos Testing
● Config and Service Discovery testing
● Elasticity Testing