SlideShare a Scribd company logo
1 of 22
Download to read offline
Contract Driven Development
The Death of Integration Hell 👿
Naresh Jain (@nashjain)
https://xnsio.com
Release under CC by Naresh Jain @ Xnsio 1
Micro-Frontends Micro-Services
Logical E-Com Application Architecture
External Dependencies
Payment Service
Payment Gateways
Authentication
Payment
Elastic
Search
DB
Inventory & Warehouse
Management Systems
Product Catalog
Service
Product Listing
Order Management
Service
Cart
DB
APIGateway
Release under CC by Naresh Jain @ Xnsio 2
Common SITCommon SIT
Current State of Testing in Competitor’s Org
PCS
OMS
PS
CS
IS
SS
External Services
1 2 3
Pre-Prod
PCS
OMS
PS
CS
IS
SS
1 2 3
API Testing
Workflow Testing
E2E Functional Testing Business Acceptance
E-Com Store Dev
Services
PCS OMS PS
Warehouse MS Dev
Services
CS IS SS 1 2 3
Legend
Unstable / Down
Integration Issue
Blocked
UnitTesting–Local
Prod
Release under CC by Naresh Jain @ Xnsio 3
Integration Hell
4
Project B EATWarehouse MS EATWarehouse MS Dev
Services
E-Com Store Dev
Services
Early Feedback in a Controlled Env
Common SIT
PCS OMS PS
CS IS SS
PCS
OMS
PS
CS
IS
SS
1 2 3
External Services
1 2 3
E-Com Store EAT
PCS OMS PS
CS IS SS
Stubbed Dependencies
Stubbed Dependencies
API Testing Workflow Testing E2E Functional Testing
Shift Left
Legend
Unstable / Down
Integration Issue
Blocked
To Pre-Prod
Workflow Testing
Release under CC by Naresh Jain @ Xnsio 19
OMS PCSConnections Tested –
1. Between Internal and
External Services
2. Between internal
services
3. Between internal units /
modules within each
service
PaymentCart
Product
ListingSystem
Tests
Orders
Controller
Order
Repository
Product
Repository
Products
Controller
SIT
PaymentCartOMS
Orders
Controller
Order
Repository
PCS
Product
Repository
Products
Controller
Eg: Mockito Eg: Moq Eg: Jest
Unit Tests
1. Units / Modules Tested in Isolation
2. System Under Test – Modules 1, 2, 3 and 4
3. Dependencies stubbed with Mock Objects like Mockito, etc.
Connections
Tested –
None
Product
Listing
Local
Application Test Pyramid
Contractual Stubs
PGPCS
OMS
Orders
Controller
Order
Repository
Contractual Stubs
DB
PCS
PCS
Product
Repository
Products
Controller
Contractual Stubs
OMS
Elastic
Search
Component / Service Tests
1. Each Microservice (OMS & PCS) and
Micro-frontend (Cart & Payment) tested
in Isolation
2. Dependencies (External and Internal)
stubbed
3. Negative Path Testing by simulating
internal and external dependency errors
Connections Tested
–
Between internal
units / modules
within each
service/component
PaymentCart
Product
Listing
Dev
Auth
OMS PCS
Application Tests
Only External
Dependencies are
Stubbed
Connections Tested –
1. Between internal
services
2. Between internal
units / modules
within each service
Contractual Stubs
PG
PaymentCart
Product
Listing
Orders
Controller
Order
Repository
Product
Repository
Products
Controller
EAT
Auth
Payment
Gateway
Payment
Gateway
(PG)
Authentication
External Dependencies
Contract Testing - Turn your contracts into executable specifications
Micro FrontendsMicro Services
OMS – Order Management Service | PCS – Product Catalogue ServiceRelease under CC by Naresh Jain @ Xnsio 20
Production
Shadow Mode
Tests
Product Test Pyramid
SIT
EAT
Dev
Local
Application
Tests
Component /
Service Test
Unit Tests
System
Tests
Application 2
Application
Tests
Component /
Service Test
Unit Tests
System
Tests
Application 1
Pre-Prod User Acceptance Testing
Performance Testing
Product
Release under CC by Naresh Jain @ Xnsio 21
Are you sure,
this will solve
Integration Hell?
2
2
What’s the main problem you’ve faced
with these Mocking Framework?
Release under CC by Naresh Jain @ Xnsio
23
24
OMS PCSConnections Tested –
1. Between Internal and
External Services
2. Between internal
services
3. Between internal units /
modules within each
service
PaymentCart
Product
ListingSystem
Tests
Orders
Controller
Order
Repository
Product
Repository
Products
Controller
SIT
PaymentCartOMS
Orders
Controller
Order
Repository
PCS
Product
Repository
Products
Controller
Eg: Mockito Eg: Moq Eg: Jest
Unit Tests
1. Units / Modules Tested in Isolation
2. System Under Test – Modules 1, 2, 3 and 4
3. Dependencies stubbed with Mock Objects like Mockito, etc.
Connections
Tested –
None
Product
Listing
Local
Application Test Pyramid
Contractual Stubs
PGPCS
OMS
Orders
Controller
Order
Repository
Contractual Stubs
DB
PCS
PCS
Product
Repository
Products
Controller
Contractual Stubs
OMS
Elastic
Search
Component / Service Tests
1. Each Microservice (OMS & PCS) and
Micro-frontend (Cart & Payment) tested
in Isolation
2. Dependencies (External and Internal)
stubbed
3. Negative Path Testing by simulating
internal and external dependency errors
Connections Tested
–
Between internal
units / modules
within each
service/component
PaymentCart
Product
Listing
Dev
Auth
OMS PCS
Application Tests
Only External
Dependencies are
Stubbed
Connections Tested –
1. Between internal
services
2. Between internal
units / modules
within each service
Contractual Stubs
PG
PaymentCart
Product
Listing
Orders
Controller
Order
Repository
Product
Repository
Products
Controller
EAT
Auth
Payment
Gateway
Payment
Gateway
(PG)
Authentication
External Dependencies
Contract Testing - Turn your contracts into executable specifications
Micro FrontendsMicro Services
OMS – Order Management Service | PCS – Product Catalogue ServiceRelease under CC by Naresh Jain @ Xnsio 25
Contract Driven Development
Collaboratively Design and Independently Deploy MicroServices & MicroFrontends
Release under CC by Naresh Jain @ Xnsio 26
Contract Testing - Turn your contracts into executable specifications
Collaborative Contract Authoring
Release under CC by Naresh Jain @ Xnsio 27
Contract in central Repo
Contracts are executable specs which are
version controlled just like code
Release under CC by Naresh Jain @ Xnsio 28
Contract as Test
Providers runs these specs as
contract tests against their service
Release under CC by Naresh Jain @ Xnsio 29
Contract for Intelligent
Service Virtualisation
Consumers runs these specs as stubs
which validate their expectations
Release under CC by Naresh Jain @ Xnsio 30
Wrapping up
3 Key Takeaways…
Release under CC by Naresh Jain @ Xnsio 31
Takeaway 1: Hyper Collaborate
Architect
Consumer
Dev
Provider
Dev
QA
• Collaboratively design the API over a contract
• Communicate with a common language
Release under CC by Naresh Jain @ Xnsio 32
Takeaway 2: Shift Left
Consumer Provider
Stub Test
• Identify integration issues early
• local development environment
• CI
• Develop with ease
CI Pipeline Environment
Release under CC by Naresh Jain @ Xnsio 33
Contract
Takeaway 3: Deploy With Confidence
• Deploy independently, with confidence
• Bye-bye, Integration Hell!
Higher Environment
Release under CC by Naresh Jain @ Xnsio 34
Release under CC by Naresh Jain @ Xnsio 35
https://qontract.run
Thank you!
Naresh Jain (@nashjain)
https://qontract.run
Release under CC by Naresh Jain @ Xnsio 36

More Related Content

More from Naresh Jain

Pilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert VirdingPilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert VirdingNaresh Jain
 
Concurrent languages are Functional by Francesco Cesarini
Concurrent languages are Functional by Francesco CesariniConcurrent languages are Functional by Francesco Cesarini
Concurrent languages are Functional by Francesco CesariniNaresh Jain
 
Erlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco CesariniErlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco CesariniNaresh Jain
 
Anatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur DatarAnatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur DatarNaresh Jain
 
Setting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile AppSetting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile AppNaresh Jain
 
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to ProdTowards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to ProdNaresh Jain
 
Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas Naresh Jain
 
No Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKennaNo Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKennaNaresh Jain
 
Functional Programming Conference 2016
Functional Programming Conference 2016Functional Programming Conference 2016
Functional Programming Conference 2016Naresh Jain
 
Agile India 2017 Conference
Agile India 2017 ConferenceAgile India 2017 Conference
Agile India 2017 ConferenceNaresh Jain
 
Unleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTUnleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTNaresh Jain
 
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo KimGetting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo KimNaresh Jain
 
MVP Design Hacks
MVP Design HacksMVP Design Hacks
MVP Design HacksNaresh Jain
 
Functional Conf 2015
Functional Conf 2015Functional Conf 2015
Functional Conf 2015Naresh Jain
 
Agile India 2016 Conference
Agile India 2016 ConferenceAgile India 2016 Conference
Agile India 2016 ConferenceNaresh Jain
 
Test Driving a jQuery Plugin
Test Driving a jQuery PluginTest Driving a jQuery Plugin
Test Driving a jQuery PluginNaresh Jain
 
Making Sense Through Action by Dave Snowden
Making Sense Through Action by Dave SnowdenMaking Sense Through Action by Dave Snowden
Making Sense Through Action by Dave SnowdenNaresh Jain
 
Oh Oh To Functional
Oh Oh To FunctionalOh Oh To Functional
Oh Oh To FunctionalNaresh Jain
 
Techniques for Effectively Slicing User Stories by Naresh Jain
Techniques for Effectively Slicing User Stories by Naresh JainTechniques for Effectively Slicing User Stories by Naresh Jain
Techniques for Effectively Slicing User Stories by Naresh JainNaresh Jain
 

More from Naresh Jain (20)

Pilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert VirdingPilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert Virding
 
Concurrent languages are Functional by Francesco Cesarini
Concurrent languages are Functional by Francesco CesariniConcurrent languages are Functional by Francesco Cesarini
Concurrent languages are Functional by Francesco Cesarini
 
Erlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco CesariniErlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco Cesarini
 
Anatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur DatarAnatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur Datar
 
Setting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile AppSetting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile App
 
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to ProdTowards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
 
Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas
 
No Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKennaNo Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKenna
 
Functional Programming Conference 2016
Functional Programming Conference 2016Functional Programming Conference 2016
Functional Programming Conference 2016
 
Agile India 2017 Conference
Agile India 2017 ConferenceAgile India 2017 Conference
Agile India 2017 Conference
 
The Eclipse Way
The Eclipse WayThe Eclipse Way
The Eclipse Way
 
Unleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTUnleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDT
 
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo KimGetting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
 
MVP Design Hacks
MVP Design HacksMVP Design Hacks
MVP Design Hacks
 
Functional Conf 2015
Functional Conf 2015Functional Conf 2015
Functional Conf 2015
 
Agile India 2016 Conference
Agile India 2016 ConferenceAgile India 2016 Conference
Agile India 2016 Conference
 
Test Driving a jQuery Plugin
Test Driving a jQuery PluginTest Driving a jQuery Plugin
Test Driving a jQuery Plugin
 
Making Sense Through Action by Dave Snowden
Making Sense Through Action by Dave SnowdenMaking Sense Through Action by Dave Snowden
Making Sense Through Action by Dave Snowden
 
Oh Oh To Functional
Oh Oh To FunctionalOh Oh To Functional
Oh Oh To Functional
 
Techniques for Effectively Slicing User Stories by Naresh Jain
Techniques for Effectively Slicing User Stories by Naresh JainTechniques for Effectively Slicing User Stories by Naresh Jain
Techniques for Effectively Slicing User Stories by Naresh Jain
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Contract Driven Development: The Death of Integration Hell

  • 1. Contract Driven Development The Death of Integration Hell 👿 Naresh Jain (@nashjain) https://xnsio.com Release under CC by Naresh Jain @ Xnsio 1
  • 2. Micro-Frontends Micro-Services Logical E-Com Application Architecture External Dependencies Payment Service Payment Gateways Authentication Payment Elastic Search DB Inventory & Warehouse Management Systems Product Catalog Service Product Listing Order Management Service Cart DB APIGateway Release under CC by Naresh Jain @ Xnsio 2
  • 3. Common SITCommon SIT Current State of Testing in Competitor’s Org PCS OMS PS CS IS SS External Services 1 2 3 Pre-Prod PCS OMS PS CS IS SS 1 2 3 API Testing Workflow Testing E2E Functional Testing Business Acceptance E-Com Store Dev Services PCS OMS PS Warehouse MS Dev Services CS IS SS 1 2 3 Legend Unstable / Down Integration Issue Blocked UnitTesting–Local Prod Release under CC by Naresh Jain @ Xnsio 3
  • 5. Project B EATWarehouse MS EATWarehouse MS Dev Services E-Com Store Dev Services Early Feedback in a Controlled Env Common SIT PCS OMS PS CS IS SS PCS OMS PS CS IS SS 1 2 3 External Services 1 2 3 E-Com Store EAT PCS OMS PS CS IS SS Stubbed Dependencies Stubbed Dependencies API Testing Workflow Testing E2E Functional Testing Shift Left Legend Unstable / Down Integration Issue Blocked To Pre-Prod Workflow Testing Release under CC by Naresh Jain @ Xnsio 19
  • 6. OMS PCSConnections Tested – 1. Between Internal and External Services 2. Between internal services 3. Between internal units / modules within each service PaymentCart Product ListingSystem Tests Orders Controller Order Repository Product Repository Products Controller SIT PaymentCartOMS Orders Controller Order Repository PCS Product Repository Products Controller Eg: Mockito Eg: Moq Eg: Jest Unit Tests 1. Units / Modules Tested in Isolation 2. System Under Test – Modules 1, 2, 3 and 4 3. Dependencies stubbed with Mock Objects like Mockito, etc. Connections Tested – None Product Listing Local Application Test Pyramid Contractual Stubs PGPCS OMS Orders Controller Order Repository Contractual Stubs DB PCS PCS Product Repository Products Controller Contractual Stubs OMS Elastic Search Component / Service Tests 1. Each Microservice (OMS & PCS) and Micro-frontend (Cart & Payment) tested in Isolation 2. Dependencies (External and Internal) stubbed 3. Negative Path Testing by simulating internal and external dependency errors Connections Tested – Between internal units / modules within each service/component PaymentCart Product Listing Dev Auth OMS PCS Application Tests Only External Dependencies are Stubbed Connections Tested – 1. Between internal services 2. Between internal units / modules within each service Contractual Stubs PG PaymentCart Product Listing Orders Controller Order Repository Product Repository Products Controller EAT Auth Payment Gateway Payment Gateway (PG) Authentication External Dependencies Contract Testing - Turn your contracts into executable specifications Micro FrontendsMicro Services OMS – Order Management Service | PCS – Product Catalogue ServiceRelease under CC by Naresh Jain @ Xnsio 20
  • 7. Production Shadow Mode Tests Product Test Pyramid SIT EAT Dev Local Application Tests Component / Service Test Unit Tests System Tests Application 2 Application Tests Component / Service Test Unit Tests System Tests Application 1 Pre-Prod User Acceptance Testing Performance Testing Product Release under CC by Naresh Jain @ Xnsio 21
  • 8. Are you sure, this will solve Integration Hell? 2 2
  • 9. What’s the main problem you’ve faced with these Mocking Framework? Release under CC by Naresh Jain @ Xnsio 23
  • 10. 24
  • 11. OMS PCSConnections Tested – 1. Between Internal and External Services 2. Between internal services 3. Between internal units / modules within each service PaymentCart Product ListingSystem Tests Orders Controller Order Repository Product Repository Products Controller SIT PaymentCartOMS Orders Controller Order Repository PCS Product Repository Products Controller Eg: Mockito Eg: Moq Eg: Jest Unit Tests 1. Units / Modules Tested in Isolation 2. System Under Test – Modules 1, 2, 3 and 4 3. Dependencies stubbed with Mock Objects like Mockito, etc. Connections Tested – None Product Listing Local Application Test Pyramid Contractual Stubs PGPCS OMS Orders Controller Order Repository Contractual Stubs DB PCS PCS Product Repository Products Controller Contractual Stubs OMS Elastic Search Component / Service Tests 1. Each Microservice (OMS & PCS) and Micro-frontend (Cart & Payment) tested in Isolation 2. Dependencies (External and Internal) stubbed 3. Negative Path Testing by simulating internal and external dependency errors Connections Tested – Between internal units / modules within each service/component PaymentCart Product Listing Dev Auth OMS PCS Application Tests Only External Dependencies are Stubbed Connections Tested – 1. Between internal services 2. Between internal units / modules within each service Contractual Stubs PG PaymentCart Product Listing Orders Controller Order Repository Product Repository Products Controller EAT Auth Payment Gateway Payment Gateway (PG) Authentication External Dependencies Contract Testing - Turn your contracts into executable specifications Micro FrontendsMicro Services OMS – Order Management Service | PCS – Product Catalogue ServiceRelease under CC by Naresh Jain @ Xnsio 25
  • 12. Contract Driven Development Collaboratively Design and Independently Deploy MicroServices & MicroFrontends Release under CC by Naresh Jain @ Xnsio 26 Contract Testing - Turn your contracts into executable specifications
  • 13. Collaborative Contract Authoring Release under CC by Naresh Jain @ Xnsio 27
  • 14. Contract in central Repo Contracts are executable specs which are version controlled just like code Release under CC by Naresh Jain @ Xnsio 28
  • 15. Contract as Test Providers runs these specs as contract tests against their service Release under CC by Naresh Jain @ Xnsio 29
  • 16. Contract for Intelligent Service Virtualisation Consumers runs these specs as stubs which validate their expectations Release under CC by Naresh Jain @ Xnsio 30
  • 17. Wrapping up 3 Key Takeaways… Release under CC by Naresh Jain @ Xnsio 31
  • 18. Takeaway 1: Hyper Collaborate Architect Consumer Dev Provider Dev QA • Collaboratively design the API over a contract • Communicate with a common language Release under CC by Naresh Jain @ Xnsio 32
  • 19. Takeaway 2: Shift Left Consumer Provider Stub Test • Identify integration issues early • local development environment • CI • Develop with ease CI Pipeline Environment Release under CC by Naresh Jain @ Xnsio 33 Contract
  • 20. Takeaway 3: Deploy With Confidence • Deploy independently, with confidence • Bye-bye, Integration Hell! Higher Environment Release under CC by Naresh Jain @ Xnsio 34
  • 21. Release under CC by Naresh Jain @ Xnsio 35 https://qontract.run
  • 22. Thank you! Naresh Jain (@nashjain) https://qontract.run Release under CC by Naresh Jain @ Xnsio 36