SlideShare a Scribd company logo
1 of 18
Download to read offline
Contract Testing
11.08.2021
Implementing a scalable testing strategy for Microservices
Said Mengi
Baran Gayretli
Consumer-Driven Contract Tests
ping@kloia.com
The testing pyramid is a concept that
groups software tests into three
different categories. This helps
developers and QA professionals
ensure higher quality, reduce the
time it takes to find the root cause of
bugs, and build a more reliable test
suite.
Consumer-Driven Contract Tests
ping@kloia.com
Unit tests in both sides where
consumers detail clearly what are
the interactions and behaviours
expected from the provider API.
Consumer-Driven Contract Tests
ping@kloia.com
Great for developing and testing intra-organisation microservices.
● You (or your team/organisation/partner organisation) control the development of both the
consumer and the provider.
● The requirements of the consumer(s) are going to be used to drive the features of the
provider.
● There is a small enough number of consumers for a given provider that the provider team
can manage an individual relationship with each consumer team.
Integration Tests vs Contract Tests
ping@kloia.com
Speed
Maintenance
Reliability
Realizing bugs towards the end of
deployment
Scalability
Pact
ping@kloia.com
● Some of the tools that support Consumer-Driven Contract Testing are Pact and Spring Cloud
Contract.
● We chose Pact because:
○ Generation of contracts from the code
○ Provider verification (pact-jvm-provider-junit)
○ Supports multiple languages JVM, Node, JS web apps, …
○ Pact Specification
○ Pact Broker
Pact Broker
ping@kloia.com
● Helps managing, versioning and distributing
contracts.
● Great tool to visualize contracts and system
relationships (dependency graph).
● Contracts as a form of “Live Documentation”
for APIs and interactions between
components.
CDC on the Consumer Side
ping@kloia.com
1) Define expected interactions
CDC on the Consumer Side
ping@kloia.com
2) Test the API client code
3) Pact Mock Service generates contract files for successful tests
CDC on the Consumer Side
ping@kloia.com
Contract Testing on the Provider Side
ping@kloia.com
code screenshot successfully
tests
Contract Testing on the Provider Side
ping@kloia.com
Auto-generated Pact provider contract tests
Pact uses the state description on the contract to
determine which set-up logic needs to be
executed before running a generated test.
Contract Testing on the Provider Side
ping@kloia.com
Test the provider
Contract Testing on the Provider Side
ping@kloia.com
PoC
ping@kloia.com
● Implementing Consumer-Driven Contract tests in Angular, Paulo Clavijo
https://paucls.wordpress.com/2017/08/04/pact-consumer-driven-contract-imple
mentation-in-angular
● Configure Pact JS Consumer Contract tests in Angular, Paulo Clavijo
https://paucls.wordpress.com/2017/08/04/configure-pact-js-consumer-contract-
tests-in-angular
● Sample project on Provider Side https://github.com/paucls/task_list_api-kotlin-pact
Further Reading
ping@kloia.com
References
● ContractTest, Martin Fowler. https://martinfowler.com/bliki/ContractTest.html
● Pact documentation https://docs.pact.io/documentation/implementation_guides.html
● Testing Strategies in a Microservice Architecture, Toby Clemson
https://martinfowler.com/articles/microservice-testing/
● Integrated Tests Are A Scam, J.B. Rainsberger http://blog.thecodewhisperer.com/permalink/integrated-tests-are-a-scam
● Consumer-Driven Contracts: A Service Evolution Pattern, Ian Robinson
https://www.martinfowler.com/articles/consumerDrivenContracts.html
● Microservices, Flexible Software Architecture. Eberhard Wolff.
● Contract testing with GraphQL, Andreas Marek
https://www.andimarek.com/post/contract-testing-graphql
● https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-provider-junit
Thank you for listening
Questions?

More Related Content

What's hot

Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to SwaggerKnoldus Inc.
 
GitHub Copilot.pptx
GitHub Copilot.pptxGitHub Copilot.pptx
GitHub Copilot.pptxLuis Beltran
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices Amazon Web Services
 
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...Edureka!
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerSmartBear
 
Introducing Agile User Stories
Introducing Agile User StoriesIntroducing Agile User Stories
Introducing Agile User StoriesRam Srivastava
 
Mobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariMobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariJaved Ansari
 
Perils of Page-Object Pattern
Perils of Page-Object PatternPerils of Page-Object Pattern
Perils of Page-Object PatternAnand Bagmar
 
DevOps Lifecycle | Edureka
DevOps Lifecycle | EdurekaDevOps Lifecycle | Edureka
DevOps Lifecycle | EdurekaEdureka!
 
Enforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubEnforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubSmartBear
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application TestingNoor Orfahly
 
API as-a-Product with Azure API Management (APIM)
API as-a-Product with Azure API Management (APIM)API as-a-Product with Azure API Management (APIM)
API as-a-Product with Azure API Management (APIM)Bishoy Demian
 
Designing APIs with OpenAPI Spec
Designing APIs with OpenAPI SpecDesigning APIs with OpenAPI Spec
Designing APIs with OpenAPI SpecAdam Paxton
 
API Strategy Introduction
API Strategy IntroductionAPI Strategy Introduction
API Strategy IntroductionDoug Gregory
 
Circuit Breaker Pattern
Circuit Breaker PatternCircuit Breaker Pattern
Circuit Breaker PatternTung Nguyen
 
Mobile Applications Testing: From Concepts to Practice
Mobile Applications Testing: From Concepts to PracticeMobile Applications Testing: From Concepts to Practice
Mobile Applications Testing: From Concepts to PracticeTechWell
 

What's hot (20)

Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
GitHub Copilot.pptx
GitHub Copilot.pptxGitHub Copilot.pptx
GitHub Copilot.pptx
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices
 
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of Swagger
 
Testing in Agile Development
Testing in Agile DevelopmentTesting in Agile Development
Testing in Agile Development
 
Introducing Agile User Stories
Introducing Agile User StoriesIntroducing Agile User Stories
Introducing Agile User Stories
 
Mobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariMobile Application Testing by Javed Ansari
Mobile Application Testing by Javed Ansari
 
Perils of Page-Object Pattern
Perils of Page-Object PatternPerils of Page-Object Pattern
Perils of Page-Object Pattern
 
DevOps Lifecycle | Edureka
DevOps Lifecycle | EdurekaDevOps Lifecycle | Edureka
DevOps Lifecycle | Edureka
 
Enforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubEnforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHub
 
Azure DevOps
Azure DevOpsAzure DevOps
Azure DevOps
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
 
API as-a-Product with Azure API Management (APIM)
API as-a-Product with Azure API Management (APIM)API as-a-Product with Azure API Management (APIM)
API as-a-Product with Azure API Management (APIM)
 
Api types
Api typesApi types
Api types
 
Designing APIs with OpenAPI Spec
Designing APIs with OpenAPI SpecDesigning APIs with OpenAPI Spec
Designing APIs with OpenAPI Spec
 
API Strategy Introduction
API Strategy IntroductionAPI Strategy Introduction
API Strategy Introduction
 
Circuit Breaker Pattern
Circuit Breaker PatternCircuit Breaker Pattern
Circuit Breaker Pattern
 
Mobile Applications Testing: From Concepts to Practice
Mobile Applications Testing: From Concepts to PracticeMobile Applications Testing: From Concepts to Practice
Mobile Applications Testing: From Concepts to Practice
 

Similar to Implementing Scalable Testing for Microservices

Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)Rob Crowley
 
Software contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSoftware contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSeb Rose
 
Whitepaper : Testing Micro Services Part I & Part 2
Whitepaper : Testing Micro Services Part I & Part 2Whitepaper : Testing Micro Services Part I & Part 2
Whitepaper : Testing Micro Services Part I & Part 2Newt Global Consulting LLC
 
Micro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsMicro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsSeb Rose
 
Integration testing with PACT
Integration testing with PACTIntegration testing with PACT
Integration testing with PACTKnoldus Inc.
 
TDD for Microservices
TDD for MicroservicesTDD for Microservices
TDD for MicroservicesVMware Tanzu
 
Testing microservices, contract testing
Testing microservices, contract testingTesting microservices, contract testing
Testing microservices, contract testingDaria Golub
 
Consumer Driven Contracts
Consumer Driven ContractsConsumer Driven Contracts
Consumer Driven ContractsVisuality
 
Contract Metadata Extraction with Artificial Intelligence (AI)
Contract Metadata Extraction with Artificial Intelligence (AI)Contract Metadata Extraction with Artificial Intelligence (AI)
Contract Metadata Extraction with Artificial Intelligence (AI)Aavenir
 
Consumer Driven Contracts for microservices
Consumer Driven Contracts for microservicesConsumer Driven Contracts for microservices
Consumer Driven Contracts for microservicesReshmi Krishna
 
Micro Service automation by Srijit Jain
Micro Service automation by Srijit JainMicro Service automation by Srijit Jain
Micro Service automation by Srijit JainSoftware Testing Board
 
Top Software panies to Outsource.pdfTesting Com
Top Software panies to Outsource.pdfTesting ComTop Software panies to Outsource.pdfTesting Com
Top Software panies to Outsource.pdfTesting ComMindfire LLC
 
Wading through treacle? Escape the integration syrup with contract tests
Wading through treacle? Escape the integration syrup with contract testsWading through treacle? Escape the integration syrup with contract tests
Wading through treacle? Escape the integration syrup with contract testsStefan Smith
 
CTD for client signoff and early requirements validation - 11th IEEE SW Eng...
CTD for client signoff and early requirements validation   - 11th IEEE SW Eng...CTD for client signoff and early requirements validation   - 11th IEEE SW Eng...
CTD for client signoff and early requirements validation - 11th IEEE SW Eng...Saritha Route
 
APIdays Paris 2019 - The Benefits of API Contract Testing by Adrian Minnock, ...
APIdays Paris 2019 - The Benefits of API Contract Testing by Adrian Minnock, ...APIdays Paris 2019 - The Benefits of API Contract Testing by Adrian Minnock, ...
APIdays Paris 2019 - The Benefits of API Contract Testing by Adrian Minnock, ...apidays
 
Consumer-Driven Contract Testing With Postman
Consumer-Driven Contract Testing With PostmanConsumer-Driven Contract Testing With Postman
Consumer-Driven Contract Testing With PostmanPostman
 
software sourcing presentation
software sourcing presentationsoftware sourcing presentation
software sourcing presentationManoj Abraham
 
RUNNING HEAD Intersession 6 Final Project Projection1Interse.docx
RUNNING HEAD Intersession 6 Final Project Projection1Interse.docxRUNNING HEAD Intersession 6 Final Project Projection1Interse.docx
RUNNING HEAD Intersession 6 Final Project Projection1Interse.docxjeanettehully
 

Similar to Implementing Scalable Testing for Microservices (20)

Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)
 
Software contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSoftware contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdf
 
Whitepaper : Testing Micro Services Part I & Part 2
Whitepaper : Testing Micro Services Part I & Part 2Whitepaper : Testing Micro Services Part I & Part 2
Whitepaper : Testing Micro Services Part I & Part 2
 
Micro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsMicro-service delivery - without the pitfalls
Micro-service delivery - without the pitfalls
 
Integration testing with PACT
Integration testing with PACTIntegration testing with PACT
Integration testing with PACT
 
TDD for Microservices
TDD for MicroservicesTDD for Microservices
TDD for Microservices
 
Testing microservices, contract testing
Testing microservices, contract testingTesting microservices, contract testing
Testing microservices, contract testing
 
Consumer Driven Contracts
Consumer Driven ContractsConsumer Driven Contracts
Consumer Driven Contracts
 
Contract Metadata Extraction with Artificial Intelligence (AI)
Contract Metadata Extraction with Artificial Intelligence (AI)Contract Metadata Extraction with Artificial Intelligence (AI)
Contract Metadata Extraction with Artificial Intelligence (AI)
 
Consumer Driven Contracts for microservices
Consumer Driven Contracts for microservicesConsumer Driven Contracts for microservices
Consumer Driven Contracts for microservices
 
Micro Service automation by Srijit Jain
Micro Service automation by Srijit JainMicro Service automation by Srijit Jain
Micro Service automation by Srijit Jain
 
Madhav_Resume
Madhav_ResumeMadhav_Resume
Madhav_Resume
 
Top Software panies to Outsource.pdfTesting Com
Top Software panies to Outsource.pdfTesting ComTop Software panies to Outsource.pdfTesting Com
Top Software panies to Outsource.pdfTesting Com
 
Wading through treacle? Escape the integration syrup with contract tests
Wading through treacle? Escape the integration syrup with contract testsWading through treacle? Escape the integration syrup with contract tests
Wading through treacle? Escape the integration syrup with contract tests
 
CTD for client signoff and early requirements validation - 11th IEEE SW Eng...
CTD for client signoff and early requirements validation   - 11th IEEE SW Eng...CTD for client signoff and early requirements validation   - 11th IEEE SW Eng...
CTD for client signoff and early requirements validation - 11th IEEE SW Eng...
 
APIdays Paris 2019 - The Benefits of API Contract Testing by Adrian Minnock, ...
APIdays Paris 2019 - The Benefits of API Contract Testing by Adrian Minnock, ...APIdays Paris 2019 - The Benefits of API Contract Testing by Adrian Minnock, ...
APIdays Paris 2019 - The Benefits of API Contract Testing by Adrian Minnock, ...
 
Testing.pptx
Testing.pptxTesting.pptx
Testing.pptx
 
Consumer-Driven Contract Testing With Postman
Consumer-Driven Contract Testing With PostmanConsumer-Driven Contract Testing With Postman
Consumer-Driven Contract Testing With Postman
 
software sourcing presentation
software sourcing presentationsoftware sourcing presentation
software sourcing presentation
 
RUNNING HEAD Intersession 6 Final Project Projection1Interse.docx
RUNNING HEAD Intersession 6 Final Project Projection1Interse.docxRUNNING HEAD Intersession 6 Final Project Projection1Interse.docx
RUNNING HEAD Intersession 6 Final Project Projection1Interse.docx
 

More from kloia

re:Invent recap - Application Modernization
re:Invent recap - Application Modernizationre:Invent recap - Application Modernization
re:Invent recap - Application Modernizationkloia
 
Isovalent-kloia Cilium Workshop
Isovalent-kloia Cilium WorkshopIsovalent-kloia Cilium Workshop
Isovalent-kloia Cilium Workshopkloia
 
Kloia - Why Microsoft Modernisation Matters
Kloia - Why Microsoft Modernisation MattersKloia - Why Microsoft Modernisation Matters
Kloia - Why Microsoft Modernisation Matterskloia
 
DotNetKonf23 - NET Modernization Problems & Solutions.pdf
DotNetKonf23 - NET Modernization Problems & Solutions.pdfDotNetKonf23 - NET Modernization Problems & Solutions.pdf
DotNetKonf23 - NET Modernization Problems & Solutions.pdfkloia
 
AWS User Group Meetup Feb2023.pptx
AWS User Group Meetup Feb2023.pptxAWS User Group Meetup Feb2023.pptx
AWS User Group Meetup Feb2023.pptxkloia
 
re:Invent Recap
re:Invent Recapre:Invent Recap
re:Invent Recapkloia
 
The New era in QA: k6
The New era in QA: k6The New era in QA: k6
The New era in QA: k6kloia
 
Etkili Blog Yazım Teknikleri - Tuğba Sertkaya
Etkili Blog Yazım Teknikleri - Tuğba SertkayaEtkili Blog Yazım Teknikleri - Tuğba Sertkaya
Etkili Blog Yazım Teknikleri - Tuğba Sertkayakloia
 
AWS re:Invent 2021 Recap by APN Ambassador
AWS re:Invent 2021 Recap by APN AmbassadorAWS re:Invent 2021 Recap by APN Ambassador
AWS re:Invent 2021 Recap by APN Ambassadorkloia
 
Camunda BPM - Said Mengi
Camunda BPM - Said MengiCamunda BPM - Said Mengi
Camunda BPM - Said Mengikloia
 
AlOps - Yetişkan Eliaçık
AlOps - Yetişkan EliaçıkAlOps - Yetişkan Eliaçık
AlOps - Yetişkan Eliaçıkkloia
 
Zaman Yönetimi - Aras Bilgen
Zaman Yönetimi - Aras Bilgen Zaman Yönetimi - Aras Bilgen
Zaman Yönetimi - Aras Bilgen kloia
 
Gravitee API Management - Ahmet AYDIN
 Gravitee API Management  -  Ahmet AYDIN Gravitee API Management  -  Ahmet AYDIN
Gravitee API Management - Ahmet AYDINkloia
 
React Bootcamp Day 2 - Yunus Demirpolat
React Bootcamp Day 2 - Yunus DemirpolatReact Bootcamp Day 2 - Yunus Demirpolat
React Bootcamp Day 2 - Yunus Demirpolatkloia
 
React Bootcamp Day 1 - Yunus Demirpolat
React Bootcamp Day 1 - Yunus DemirpolatReact Bootcamp Day 1 - Yunus Demirpolat
React Bootcamp Day 1 - Yunus Demirpolatkloia
 
Contract testing - Baran Gayretli
Contract testing - Baran Gayretli Contract testing - Baran Gayretli
Contract testing - Baran Gayretli kloia
 
Using Design Methods to Establish Healthy DevOps Practices - Aras Bilgen
Using Design Methods to Establish Healthy DevOps Practices - Aras BilgenUsing Design Methods to Establish Healthy DevOps Practices - Aras Bilgen
Using Design Methods to Establish Healthy DevOps Practices - Aras Bilgenkloia
 
Kloia Quality Assurance
Kloia Quality AssuranceKloia Quality Assurance
Kloia Quality Assurancekloia
 
DevOps Turkey Test Automation with Docker and Seleniumhub
DevOps Turkey Test Automation with Docker and SeleniumhubDevOps Turkey Test Automation with Docker and Seleniumhub
DevOps Turkey Test Automation with Docker and Seleniumhubkloia
 
BDD Approach with Karate Framework in Service Tests
BDD Approach with Karate Framework in Service TestsBDD Approach with Karate Framework in Service Tests
BDD Approach with Karate Framework in Service Testskloia
 

More from kloia (20)

re:Invent recap - Application Modernization
re:Invent recap - Application Modernizationre:Invent recap - Application Modernization
re:Invent recap - Application Modernization
 
Isovalent-kloia Cilium Workshop
Isovalent-kloia Cilium WorkshopIsovalent-kloia Cilium Workshop
Isovalent-kloia Cilium Workshop
 
Kloia - Why Microsoft Modernisation Matters
Kloia - Why Microsoft Modernisation MattersKloia - Why Microsoft Modernisation Matters
Kloia - Why Microsoft Modernisation Matters
 
DotNetKonf23 - NET Modernization Problems & Solutions.pdf
DotNetKonf23 - NET Modernization Problems & Solutions.pdfDotNetKonf23 - NET Modernization Problems & Solutions.pdf
DotNetKonf23 - NET Modernization Problems & Solutions.pdf
 
AWS User Group Meetup Feb2023.pptx
AWS User Group Meetup Feb2023.pptxAWS User Group Meetup Feb2023.pptx
AWS User Group Meetup Feb2023.pptx
 
re:Invent Recap
re:Invent Recapre:Invent Recap
re:Invent Recap
 
The New era in QA: k6
The New era in QA: k6The New era in QA: k6
The New era in QA: k6
 
Etkili Blog Yazım Teknikleri - Tuğba Sertkaya
Etkili Blog Yazım Teknikleri - Tuğba SertkayaEtkili Blog Yazım Teknikleri - Tuğba Sertkaya
Etkili Blog Yazım Teknikleri - Tuğba Sertkaya
 
AWS re:Invent 2021 Recap by APN Ambassador
AWS re:Invent 2021 Recap by APN AmbassadorAWS re:Invent 2021 Recap by APN Ambassador
AWS re:Invent 2021 Recap by APN Ambassador
 
Camunda BPM - Said Mengi
Camunda BPM - Said MengiCamunda BPM - Said Mengi
Camunda BPM - Said Mengi
 
AlOps - Yetişkan Eliaçık
AlOps - Yetişkan EliaçıkAlOps - Yetişkan Eliaçık
AlOps - Yetişkan Eliaçık
 
Zaman Yönetimi - Aras Bilgen
Zaman Yönetimi - Aras Bilgen Zaman Yönetimi - Aras Bilgen
Zaman Yönetimi - Aras Bilgen
 
Gravitee API Management - Ahmet AYDIN
 Gravitee API Management  -  Ahmet AYDIN Gravitee API Management  -  Ahmet AYDIN
Gravitee API Management - Ahmet AYDIN
 
React Bootcamp Day 2 - Yunus Demirpolat
React Bootcamp Day 2 - Yunus DemirpolatReact Bootcamp Day 2 - Yunus Demirpolat
React Bootcamp Day 2 - Yunus Demirpolat
 
React Bootcamp Day 1 - Yunus Demirpolat
React Bootcamp Day 1 - Yunus DemirpolatReact Bootcamp Day 1 - Yunus Demirpolat
React Bootcamp Day 1 - Yunus Demirpolat
 
Contract testing - Baran Gayretli
Contract testing - Baran Gayretli Contract testing - Baran Gayretli
Contract testing - Baran Gayretli
 
Using Design Methods to Establish Healthy DevOps Practices - Aras Bilgen
Using Design Methods to Establish Healthy DevOps Practices - Aras BilgenUsing Design Methods to Establish Healthy DevOps Practices - Aras Bilgen
Using Design Methods to Establish Healthy DevOps Practices - Aras Bilgen
 
Kloia Quality Assurance
Kloia Quality AssuranceKloia Quality Assurance
Kloia Quality Assurance
 
DevOps Turkey Test Automation with Docker and Seleniumhub
DevOps Turkey Test Automation with Docker and SeleniumhubDevOps Turkey Test Automation with Docker and Seleniumhub
DevOps Turkey Test Automation with Docker and Seleniumhub
 
BDD Approach with Karate Framework in Service Tests
BDD Approach with Karate Framework in Service TestsBDD Approach with Karate Framework in Service Tests
BDD Approach with Karate Framework in Service Tests
 

Recently uploaded

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 

Recently uploaded (20)

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 

Implementing Scalable Testing for Microservices

  • 1. Contract Testing 11.08.2021 Implementing a scalable testing strategy for Microservices Said Mengi Baran Gayretli
  • 2. Consumer-Driven Contract Tests ping@kloia.com The testing pyramid is a concept that groups software tests into three different categories. This helps developers and QA professionals ensure higher quality, reduce the time it takes to find the root cause of bugs, and build a more reliable test suite.
  • 3. Consumer-Driven Contract Tests ping@kloia.com Unit tests in both sides where consumers detail clearly what are the interactions and behaviours expected from the provider API.
  • 4. Consumer-Driven Contract Tests ping@kloia.com Great for developing and testing intra-organisation microservices. ● You (or your team/organisation/partner organisation) control the development of both the consumer and the provider. ● The requirements of the consumer(s) are going to be used to drive the features of the provider. ● There is a small enough number of consumers for a given provider that the provider team can manage an individual relationship with each consumer team.
  • 5. Integration Tests vs Contract Tests ping@kloia.com Speed Maintenance Reliability Realizing bugs towards the end of deployment Scalability
  • 6. Pact ping@kloia.com ● Some of the tools that support Consumer-Driven Contract Testing are Pact and Spring Cloud Contract. ● We chose Pact because: ○ Generation of contracts from the code ○ Provider verification (pact-jvm-provider-junit) ○ Supports multiple languages JVM, Node, JS web apps, … ○ Pact Specification ○ Pact Broker
  • 7. Pact Broker ping@kloia.com ● Helps managing, versioning and distributing contracts. ● Great tool to visualize contracts and system relationships (dependency graph). ● Contracts as a form of “Live Documentation” for APIs and interactions between components.
  • 8. CDC on the Consumer Side ping@kloia.com
  • 9. 1) Define expected interactions CDC on the Consumer Side ping@kloia.com 2) Test the API client code
  • 10. 3) Pact Mock Service generates contract files for successful tests CDC on the Consumer Side ping@kloia.com
  • 11. Contract Testing on the Provider Side ping@kloia.com
  • 12. code screenshot successfully tests Contract Testing on the Provider Side ping@kloia.com Auto-generated Pact provider contract tests
  • 13. Pact uses the state description on the contract to determine which set-up logic needs to be executed before running a generated test. Contract Testing on the Provider Side ping@kloia.com
  • 14. Test the provider Contract Testing on the Provider Side ping@kloia.com
  • 16. ● Implementing Consumer-Driven Contract tests in Angular, Paulo Clavijo https://paucls.wordpress.com/2017/08/04/pact-consumer-driven-contract-imple mentation-in-angular ● Configure Pact JS Consumer Contract tests in Angular, Paulo Clavijo https://paucls.wordpress.com/2017/08/04/configure-pact-js-consumer-contract- tests-in-angular ● Sample project on Provider Side https://github.com/paucls/task_list_api-kotlin-pact Further Reading ping@kloia.com
  • 17. References ● ContractTest, Martin Fowler. https://martinfowler.com/bliki/ContractTest.html ● Pact documentation https://docs.pact.io/documentation/implementation_guides.html ● Testing Strategies in a Microservice Architecture, Toby Clemson https://martinfowler.com/articles/microservice-testing/ ● Integrated Tests Are A Scam, J.B. Rainsberger http://blog.thecodewhisperer.com/permalink/integrated-tests-are-a-scam ● Consumer-Driven Contracts: A Service Evolution Pattern, Ian Robinson https://www.martinfowler.com/articles/consumerDrivenContracts.html ● Microservices, Flexible Software Architecture. Eberhard Wolff. ● Contract testing with GraphQL, Andreas Marek https://www.andimarek.com/post/contract-testing-graphql ● https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-provider-junit
  • 18. Thank you for listening Questions?