SlideShare a Scribd company logo
UPS AND DOWNS OF CONTRACT
TESTING IN REAL LIFE
2
WILD MICROSERVICES WORLD
3
MICROSERVICES
ARCHITECTURE
4
GAME BACKEND AT 2017
> 100 microservices ~40 deployments
per week
Unit + Component
+ API tests
Integration errors
5
EXAMPLE
User
Conference
Service
Bonus
Conference
Service
GET /bonus-conference-
service/userBalance?userId=1&sessionId=2
6
UNIT TEST
User
Conference
Service
Bonus
Conference
Service
GET /bonus-conference-
service/userBalance?userId=1&sessionId=2
User
Conference
Service
Mock(Bonus
Conference
Service)
when(bonusClient.getBalance(1, 2)).thenReturn(100);
assertThat(getUserItem(1)).isEqualTo(100);
Runs locally
7
API TEST
User
Conference
Service
Bonus
Conference
Service
GET /bonus-conference-
service/userBalance?userId=1&sessionId=2
User
Conference
Service
Bonus
Conference
Service
assertThat(getUserBonusBalance(1,2))
.isEqualTo(100);
Runs on environment
8
WHAT SHOULD I CHOOSE?
9
CONTRACT TESTING TO THE RESCUE!
User
Conference
Service
Bonus
Conference
Service
Runs locally
User
Conference
Service
Bonus
Conference
Service
GET /bonus-conference-
service/userBalance?userId=1&sessionId=2
Producer
Test
ContractConsumer
Test
10
WHY CONTRACT TESTING
ASPECT / LEVEL UNIT CONTRACT API
WAY TO EXECUTE LOCAL LOCAL ENVIRONMENT
FEEDBACK TIME FAST MEDIUM SLOW
SETUP
COMPLEXITY
LOW MEDIUM HIGH
CHANGE
TOLERANCE
NO YES YES
CHECK
FUNCTIONALITY
YES NO YES
CROSS-TEAM
COLLABORATION
NO YES YES
11
TEST PYRAMID FOR MICROSERVICES
Exploratory
End-to-End
Contract
Component
Unit
12
BEFORE IMPLEMENTATION
13
APPROACHES
14
PRODUCER-DRIVEN CONTRACTS
User
Conference
Service
(Consumer)
Bonus
Conference
Service
(Producer)
Some Other
Service
(Consumer)
Bonus
Conference
Service
(Producer)
15
CONSUMER-DRIVEN CONTRACTS
User
Conference
Service
(Consumer)
Some Other
Service
(Consumer)
Bonus
Conference
Service
(Producer)
{
"bonuses":[
{
“id":1,
“type":"TICKET"
}
]
}
{
"bonuses":[
{
“id":1
}
]
}
16
TOOLSET
17
TOOLSET
18
CONCEPTS
19
PROOF – OF - CONCEPTS
Explore trade-offs. Do
not seek for 'perfect'
one
Sample
services - not
a prod ones
Do not forget
about use
cases
20
STORAGE
21
STORAGE: PRODUCER SIDE
Contract kept with producer
Need to make changes to
producer repo every time
Low visibility of coverage
22
STORAGE: SEPARATE REPOSITORY
Need to setup and maintain
separate repo
High visibility of contract
coverage
Ability to set up additional
workflows and hooks
23
DURING THE LAUNCH
24
FLOWS AND PIPELINES
25
WORKFLOWS: ADDING NEW CONTRACT
Add
contract in
contract
repo
Contract
review
Implement
test on
consumer
side
Implement
test on
producer
side
Merge
contract
Merge
consumer
test
Merge
producer
test
26
WORKFLOWS: CHANGE EXISTING CONTRACT
Change
contract in
contract
repo
Change
code
review
Apply fixes
on each
consumer’s
side
Apply fixes
on each
producer’s
side
Merge
contract
change
Merge
consumer
changes
Merge
producer
changes
27
INTEGRATING INTO DEVELOPMENT PIPELINE
Unit + Component +
Contract tests while
artifacts build
End-to-End API
tests on pre-
prod
Deploy to prod
28
EDUCATION
29
TRAINING AND EDUCATION
Make projects
easy to start
Do workshop. A lot Engineers need a
knowledge base
QA can write
contract tests
30
AFTER IMPLEMENTATION
31
LEGACY SERVICES
• It is better to think before
action
• Stakeholders can change
priorities
• Do not touch ‘old’ stuff
32
AUTOMATE THE PROCESS
• People can trick, gates don’t
• If it’s not enforced, it will be
skipped
• “I can’t break anything with
this change!”
• Who is the gatekeeper of
the services?
33
AUTOMATIC TASKS TO RESOLVE
34
AUTOMATIC TASKS TO RESOLVE
35
QUALITY GATE BUILD
36
COMMUNICATION
• No time for code review
• No time for applying the
change / fix a test
• “Talk to product owner”
37
WHAT’S NOW
• ~230 microservices
• > 3200 contracts
• Automatic contract resolution
BUT?
• Missing contract coverage map
• Build time for contract repo
• Contract tests for client
38
CONTRACT TESTING…
brings
challenges
39
CONTRACT TESTING…
brings value
40
CONTRACT TESTING…
is not a “silver”
bullet
41
THINK!
42
WHO AM I?
OLEKSANDR ROMANOV
Lead Software Engineer In Test @ Playtika
Twitter: @al8xr
Skype: alex_roma_nov
www.linkedin.com/in/oleksandr-romanov
43
Playtika is a world-leading games company.
ABOUT US
Platforms
13
Locations
19
Employees
3000+
Games
16
Ups and downs of contract testing in real life

More Related Content

PDF
What does it take to be an architect
Constantine Slisenka
 
PDF
Consumer Driven Contracts and Your Microservice Architecture
Marcin Grzejszczak
 
PDF
Microservices: Consumer Driven Contracts in Practice
Qaiser Mazhar
 
PDF
What does it take to be architect (for Cjicago JUG)
Constantine Slisenka
 
PPTX
Gengo Jaws Days Tokyo 2014 Presentation
Derek Szydlowski
 
PDF
API Design Collaboration
Uchit Vyas ☁
 
PDF
Process
Jaishree Garg
 
PDF
Consumer-Driven Contract Testing With Postman
Postman
 
What does it take to be an architect
Constantine Slisenka
 
Consumer Driven Contracts and Your Microservice Architecture
Marcin Grzejszczak
 
Microservices: Consumer Driven Contracts in Practice
Qaiser Mazhar
 
What does it take to be architect (for Cjicago JUG)
Constantine Slisenka
 
Gengo Jaws Days Tokyo 2014 Presentation
Derek Szydlowski
 
API Design Collaboration
Uchit Vyas ☁
 
Process
Jaishree Garg
 
Consumer-Driven Contract Testing With Postman
Postman
 

What's hot (14)

PDF
TAUS Webinar - Introduction to the Gengo API Ecosystem
Gengo
 
PDF
The Most Common Errors That Aren’t Caught
Nordic APIs
 
PPTX
Consumer-driven contracts: avoid microservices integration hell! (LondonCD - ...
Pierre Vincent
 
PPTX
Consumer-driven contracts with Pact and PHP
Andy Kelk
 
PPTX
ATAGTR2017 HikeRunner: Load Test Framework
Agile Testing Alliance
 
PDF
[API World 2021 ] - Understanding Cloud Native Deployment
WSO2
 
PDF
Unit Testing: Not Just for Apex
Salesforce Developers
 
PDF
MuleSoft Surat Virtual Meetup#17 - Automated Code Review
Jitendra Bafna
 
PPTX
Consumer Driven Contracts for microservices
Reshmi Krishna
 
PDF
Fed London - January 2015
Phil Leggetter
 
PDF
Kasten securing access to your kubernetes applications
LibbySchulze
 
PDF
TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...
Michael Kuehne-Schlinkert
 
PDF
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays
 
PPTX
Automation world under the DevTestSecOps umbrella
Katherine Golovinova
 
TAUS Webinar - Introduction to the Gengo API Ecosystem
Gengo
 
The Most Common Errors That Aren’t Caught
Nordic APIs
 
Consumer-driven contracts: avoid microservices integration hell! (LondonCD - ...
Pierre Vincent
 
Consumer-driven contracts with Pact and PHP
Andy Kelk
 
ATAGTR2017 HikeRunner: Load Test Framework
Agile Testing Alliance
 
[API World 2021 ] - Understanding Cloud Native Deployment
WSO2
 
Unit Testing: Not Just for Apex
Salesforce Developers
 
MuleSoft Surat Virtual Meetup#17 - Automated Code Review
Jitendra Bafna
 
Consumer Driven Contracts for microservices
Reshmi Krishna
 
Fed London - January 2015
Phil Leggetter
 
Kasten securing access to your kubernetes applications
LibbySchulze
 
TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...
Michael Kuehne-Schlinkert
 
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays
 
Automation world under the DevTestSecOps umbrella
Katherine Golovinova
 
Ad

Similar to Ups and downs of contract testing in real life (20)

PPTX
Lights-Out Testing for Lights-On Business
Worksoft
 
PDF
TDD for APIs in a Microservice World (extended Version) by Michael Kuehne-Sch...
Michael Kuehne-Schlinkert
 
PPTX
Continuously Delivering Distributed Systems
Daniel Löffelholz
 
PDF
Journey to APIs and Microservices: Best Practices
Deepak Nadig
 
PDF
Keynote AST 2016
Kim Herzig
 
PPTX
Top Performance Problems in Distributed Architectures
Andreas Grabner
 
PDF
Failure is an Option: Scaling Resilient Feature Delivery
Optimizely
 
PDF
Deploying large-scale, serverless and asynchronous systems - without integrat...
DiUS
 
PPTX
Migrate to microservices
Andrey Trubitsyn
 
PDF
SPUnite17 Timer Jobs Event Handlers
NCCOMMS
 
PPTX
Bejug - Activiti in Action (part 1)
Joram Barrez
 
PPTX
Accelerate Your Delivery Pipeline with Continuous Testing
SmartBear
 
PPTX
Making the business case for DevOps
Martin Croker
 
PDF
Serverless microservices: Test smarter, not harder
DiUS
 
PDF
TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)
Nordic APIs
 
PDF
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Domas Lasauskas
 
PPTX
Zero touch QA automation platform for DevOps
TaUB Solutions
 
PPTX
Contract based testing
Alisa Petivotova
 
PDF
Serverless in production (O'Reilly Software Architecture)
Yan Cui
 
PDF
AWS Lambda from the trenches (Serverless London)
Yan Cui
 
Lights-Out Testing for Lights-On Business
Worksoft
 
TDD for APIs in a Microservice World (extended Version) by Michael Kuehne-Sch...
Michael Kuehne-Schlinkert
 
Continuously Delivering Distributed Systems
Daniel Löffelholz
 
Journey to APIs and Microservices: Best Practices
Deepak Nadig
 
Keynote AST 2016
Kim Herzig
 
Top Performance Problems in Distributed Architectures
Andreas Grabner
 
Failure is an Option: Scaling Resilient Feature Delivery
Optimizely
 
Deploying large-scale, serverless and asynchronous systems - without integrat...
DiUS
 
Migrate to microservices
Andrey Trubitsyn
 
SPUnite17 Timer Jobs Event Handlers
NCCOMMS
 
Bejug - Activiti in Action (part 1)
Joram Barrez
 
Accelerate Your Delivery Pipeline with Continuous Testing
SmartBear
 
Making the business case for DevOps
Martin Croker
 
Serverless microservices: Test smarter, not harder
DiUS
 
TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)
Nordic APIs
 
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Domas Lasauskas
 
Zero touch QA automation platform for DevOps
TaUB Solutions
 
Contract based testing
Alisa Petivotova
 
Serverless in production (O'Reilly Software Architecture)
Yan Cui
 
AWS Lambda from the trenches (Serverless London)
Yan Cui
 
Ad

More from Oleksandr Romanov (10)

PPTX
Тестування Blockchain - Що там можна тестувати?
Oleksandr Romanov
 
PDF
What does it mean to test a blockchain
Oleksandr Romanov
 
PPTX
Testing challenges at microservices world
Oleksandr Romanov
 
PPTX
Practical contract testing with Spring Cloud Contract [Test Con 2019]
Oleksandr Romanov
 
PPTX
Turning automation education upside down [QAFest 2019]
Oleksandr Romanov
 
PPTX
Hidden complexities in microservices testing
Oleksandr Romanov
 
PPTX
Automating microservices: what, where and when
Oleksandr Romanov
 
PPTX
Integration testing for microservices with Spring Boot
Oleksandr Romanov
 
PDF
Introduction to web application security testing
Oleksandr Romanov
 
PDF
Introduction to pairwise testing
Oleksandr Romanov
 
Тестування Blockchain - Що там можна тестувати?
Oleksandr Romanov
 
What does it mean to test a blockchain
Oleksandr Romanov
 
Testing challenges at microservices world
Oleksandr Romanov
 
Practical contract testing with Spring Cloud Contract [Test Con 2019]
Oleksandr Romanov
 
Turning automation education upside down [QAFest 2019]
Oleksandr Romanov
 
Hidden complexities in microservices testing
Oleksandr Romanov
 
Automating microservices: what, where and when
Oleksandr Romanov
 
Integration testing for microservices with Spring Boot
Oleksandr Romanov
 
Introduction to web application security testing
Oleksandr Romanov
 
Introduction to pairwise testing
Oleksandr Romanov
 

Recently uploaded (20)

PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Doc9.....................................
SofiaCollazos
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Software Development Methodologies in 2025
KodekX
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 

Ups and downs of contract testing in real life