Skip to main content
Login | Suomeksi | På svenska | In English

Browsing by Author "Lehvä, Jyri"

Sort by: Order: Results:

  • Lehvä, Jyri (2019)
    Consumer-Driven Contract testing is a way to test integrations between services. The main idea is that when an application or a service (consumer) consumes an API provided by another service (provider) a contract is formed between them. The contract contains information about how the consumer calls the provider and what the consumer needs from the responses. The contract can then be used to test both sides of the integration separately. The testing method is said to be useful when testing integration-heavy systems such as systems based on microservice architecture. Therefore the research question of the thesis is: "with a focus on integrations, is Consumer-Driven Contract testing a viable addition to a testing strategy used to test a system based on microservice architecture, and if so, why?" The research question is first approached by taking a look at the most recent literature. The goal is to learn about different testing methods and create a basic understanding of a general testing strategy for microservices. The next step is to figure out how the Consumer-Driven Contract testing fits that picture. The Consumer-Driven Contract testing is introduced thoroughly to gain a good understanding of its core concepts, advantages, disadvantages, and tooling. After the literature check, the research question is approached by introducing a case study based on a microservice architecture. Its testing strategy is described in detail, and Consumer-Driven Contract tests are implemented for it. The testing methods are compared by systematically implementing defects to the integrations and seeing how the testing methods catch them. Finally, the results and experiences are shared and analyzed, and the research question gets answered. The results based on literature and experiences from the case study proved that the Consumer-Driven Contract testing is a viable way to test integrations. The tests implemented in the case study caught every defect from the integrations, and the case study was able to verify the advantages mentioned in the literature. It was shown that the Consumer-Driven Contract tests could replace the more traditional integration tests completely. That results to more deterministic testing strategy as the integrations are tested in isolation. It should be emphasized that the teams have to be able to communicate with each other to implement and achieve the benefits of Consumer-Driven Contract testing. The level of communication between the teams has to be mature enough to share the contracts and to coordinate the implementation. Communication is the foundation that enables or disables the testing method. Because of that improving the ways of communication should be a major focus for the teams who want to implement Consumer-Driven Contract tests.