26
Getting Started With Testing Microservices
Photo by Ryoji Iwata on Unsplash
In this blog post, I will share resources that help you to be more prepared to testing microservices-based systems.
My background is Java and Spring Boot. Many tools and libraries that I will share are from the Java world. But you can find analogies in other technology stacks as well.
I will split resources into the following sections - from the theory to practice:

The first thing is to understand microservices architecture and how it differs from more traditional monolith systems.
The following resources will help you to build initial information:
Resources (Spring Boot):
Of you extensively use virtualization tools, like Docker - learn it.
Pay attention to how to start a single microservice in Docker container on your local machine (together with its dependencies: SQL, NoSQL databases, messaging systems, etc.):
Pay attention to how to start a single microservice in Docker container on your local machine (together with its dependencies: SQL, NoSQL databases, messaging systems, etc.):
If you are not from the Java world - ask your fellow developers about technologies and frameworks they use for building microservices in your organization.
Do not hesitate to ask which testing tools, practices, and guidelines they already use.
Do not hesitate to ask which testing tools, practices, and guidelines they already use.

Classic approach with unit, integration, and end-to-end testing can't be applied to microservices "as is." That's why approaches to testing need to be reworked and adapted.
Resources:
Tools and libraries can greatly simplify testing and automation and boost developer productivity.
Resources:

When the number of microservices is increasing to hundreds or thousands, the problems of integration arises:
Contract testing allows building another layer of fast and reliable tests, preventing integration issues as soon as possible in the development workflow.
Depending on the technologies used on your project, you may prefer:
If services use gRPC protocol for communication - you can use PACT for contract testing as well.
Resources:
Microservices architecture is not a "silver" bullet in software development. The benefits also come with drawbacks.
For tester's point of view - testing microservices is like a testing system of systems: you start with single service verification in isolation, then move to integrate it with dependencies and other services, then you move to end-to-end API and UI tests as for any application.
The biggest challenge here is that the previously described testing process needs to be applied to many different services. It is not fast and scalable to do it manually - so high investment in automation is a prerequisite to any successful microservices testing effort.
This list of resources is not complete - it is just the best ones that helped me a lot in the past.
What is your favorite book or blog post about microservices?
26