Microservices Testing Strategies — Part 1

Onur Baskirt
5 min readSep 1, 2022

Today, speed and quality in software development are essential elements for successful organizations to embrace change in market conditions. Development teams have to cope rapidly with increasing business demands and constant change. This way, they can step ahead of the competition and provide high-quality products to their customers.

At Emirates, delivering valuable software artifacts fast and reliably to customers is at the heart of technology transformation and organizational performance in terms of profitability, productivity, and customer satisfaction. Software testing is essential to set the bar to the top for quality assurance and accelerated software development. To keep up with the highest pace without unwanted software failures, we continuously research the latest software testing techniques to add them to the software delivery life cycle.

Enterprises have undergone technological transformations over the past decade, and one of the biggest is moving from Monolith to Microservices architectures. Rather than deploying the whole system, they transformed the monolithic structures into microservices. This way, they aimed to deliver changes faster and more frequently.

Adapting this latest software transformation avatar was unavoidable and inevitable. We extensively researched how to create a successful microservices architecture, selected the right tools and technologies, and implemented cutting-edge software development and testing approaches. This article shares our software testing strategies during our microservices transformation.

Our microservices testing strategy came into its own when we were building a unified and responsive aircraft seat map for different self-service touchpoints. With this, we aimed to consolidate more than six different seat maps across the Emirates digital space. Our testing strategy allowed us to reduce QA efforts and optimized scenarios to assure a flawless customer experience.

Microservices architectures come with many complexities, and to test these systems effectively, we need to be aware of the system architecture very well. Let’s start with a simple architectural view of microservices.

Generally, we have clients/channels/consumers such as Web, Mobile Web, Mobile Apps, and Desktop. We may have some downstream or external services which do business-critical operations such as loyalty operations and customers’ data-related operations, and they may hold some critical business data. These operations and data depend on the company’s sector. We have a middleware layer between clients and external systems that communicate, translate, and do some business operations.

In microservices, we have multiple data sources for each service.

In the architecture above, we may have several services at the middleware level. They communicate with each other, clients, and external systems. To test this layer, we must also know the internal architecture of middleware. Generally, it consists of an API gateway, microservices, data stores, and other elements such as message queues.

Requests from the channels are generally forwarded and routed to the services via the gateway. We should test the gateway very carefully because all communication goes through it. After the gateway level, we have microservices. Some interact with each other and communicate with data stores, external systems, and the API gateway.

We have covered a glimpse of the microservices architecture. From now on, I want to focus on more microservices testing strategies. In a typical microservices architecture, we need to deal with the below areas and more, as you can see in the diagram below. These challenges arise complex testing problems to solve.

High-level architecture of microservices

As you see, we have multiple layers and components in this architecture; thus, we need to modify the famous test pyramid, and we will have several test types.

Along with the common functional testing types, we should also have some other testing types, such as load testing, endurance testing, stress testing, spike testing, load balancing testing, chaos testing, data replication testing, accessibility testing, security testing, mutation testing, etc. In this way, we enhance the quality of microservices and the whole system.

If UI elements exist in our scope, we need to do UI-related testing such as UI automation, visual testing, accessibility testing, etc. But UI, related tests mainly belong to channel/consumer side testing.

Here at Emirates, we follow the testing pyramid for microservices testing, which is shown in the below diagram. We have more unit tests than component tests and more component tests than system integration tests. The count of integration tests in some conditions may not be much. It depends on the service and its integrations. Also, we are running the contract tests as early as possible. They give early feedback about the contract mismatches and run faster than functional tests.

Microservices testing pyramid

We will proceed with explaining all these testing types one by one. With these testing types, we test the microservices effectively. Note that some of these tests are pre-deployment, while some are post-deployment.

In this article, we covered the high-level view of microservices testing strategies. In the following article, we will cover pre-deployment tests, what they are, how we are performing them at Emirates, and how we are positioning them in PR pipelines.

If you are passionate about microservices and want to be part of something great, browse our current vacancies and find out what it is like to work for a dynamic and multicultural business.

For previous article, please visit: https://medium.com/@armenparonyan/solace-event-streaming-integration-at-emirates-airline-a08c670f558a

#CodeEmirates #CodeBetter #DevRel

Onur Baskirt
Lead Technical Consultant, Emirates Group

References

--

--

Onur Baskirt

Owner of www.swtestacademy.com | Lead Technical Consultant @Emirates | Speaker | Blogger