SlideShare une entreprise Scribd logo
1  sur  36
Télécharger pour lire hors ligne
SkładQA #3
Kraków, 2018 - Mateusz Bryła
Contract Testing
Agenda
- Baseline
- Contract
- Contract Testing
- Why (not)?
- Tools
- Example
Baseline
Interface
request
response
consumer producer
Interfaces within a service
module 3module 2
module 5
(third party)
module 1
module 4
module 6
(third party)
Partial interface
producer consumer 2
consumer 1
consumer 3
request A - response A
request B - response B
request B - response B
request A - response A
Microservices
service 1 service 3 service 5
service 4
service 2
Microservices - 3P
service 1 service 3 service 5
service 4
(third-party)
service 2
Contract
Interface
request
response
consumer producer
Contract
consumer producer
when request:
HTTP GET /echo/hello
then response:
HTTP 200
{
“echo”: “hello”
}
Contract Testing
Unit Tests
module 3
(test double)
module 2
(under test)
module 5
module 1
(test double)
module 4 module 6
Integration Test
service 1
(test double)
service 3
(under test)
service 5
(test double)
service 4
(test double)
service 2
(test double)
Single integration
service 1
service 3
(under test)
service 5
service 4
(test double)
service 2
Single integration - sideways ;)
service 3
(under test)
service 4
(test double)
Contract test
service
(under test)
service
when request:
HTTP GET /echo/hello
then response:
HTTP 200
{
“echo”: “hello”
}
tested against
tested against
Contract Test
when request:
HTTP GET /echo/hello
then response:
HTTP 200
{
“echo”: “hello”
}
service
(under test)
service
Single integration with third party - test double
service
(under test)
service
(test double)
Single integration with third party - sandbox
service
(under test)
service
(sandbox)
Contract test - third party
service
(under test)
service
(sandbox)
when request:
HTTP GET /echo/hello
then response:
HTTP 200
{
“echo”: “hello”
}
tested against
Contract test - third party
service
(under test)
service
(sandbox)
when request:
HTTP GET /echo/hello
then response:
HTTP 200
{
“echo”: “hello”
}
tested against
Why (not)?
Integration Test
service 1
(test double)
service 3
(under test)
service 5
(test double)
service 4
(test double)
service 2
(test double)
Single integration
service 1
service 3
(under test)
service 5
service 4
(test double)
service 2
Single integration with third party - test double
service
(under test)
service
(test double)
Single integration with third party - sandbox
service
(under test)
service
(sandbox)
Partial interface
producer consumer 2
consumer 1
consumer 3
request A - response A
request B - response B
request B - response B
request A - response A
Contract test - third party
service
(under test)
service
(sandbox)
when request:
HTTP GET /echo/hello
then response:
HTTP 200
{
“echo”: “hello”
}
tested against
Tools
Spring Cloud Contract
https://cloud.spring.io/spring-cloud-contract/
Pact
https://docs.pact.io/
Example
Java - shared contract
https://github.com/mbryla/contract-testing
Should we do it?
Q / A

Contenu connexe

Similaire à SkładQA #3 - Contract Testing, M. Bryła

Ijcsns international journal of computer science and network security
Ijcsns international journal of computer science and network securityIjcsns international journal of computer science and network security
Ijcsns international journal of computer science and network security
El Nassar
 
Improving Software quality for the Modern Web
Improving Software quality for the Modern WebImproving Software quality for the Modern Web
Improving Software quality for the Modern Web
Euan Garden
 
Testing with test_complete
Testing with test_completeTesting with test_complete
Testing with test_complete
binuiweb
 

Similaire à SkładQA #3 - Contract Testing, M. Bryła (20)

Deploy with confidence
Deploy with confidenceDeploy with confidence
Deploy with confidence
 
MCE^3 - Kyle Fuller - End-to-end Building Web Services in-swift-mce-2016
MCE^3 - Kyle Fuller - End-to-end Building Web Services in-swift-mce-2016MCE^3 - Kyle Fuller - End-to-end Building Web Services in-swift-mce-2016
MCE^3 - Kyle Fuller - End-to-end Building Web Services in-swift-mce-2016
 
Contract based testing
Contract based testingContract based testing
Contract based testing
 
Testing challenges at microservices world
Testing challenges at microservices worldTesting challenges at microservices world
Testing challenges at microservices world
 
Ijcsns international journal of computer science and network security
Ijcsns international journal of computer science and network securityIjcsns international journal of computer science and network security
Ijcsns international journal of computer science and network security
 
Testing 1, 2, 3, ...
Testing 1, 2, 3, ... Testing 1, 2, 3, ...
Testing 1, 2, 3, ...
 
Code Contracts API In .NET
Code Contracts API In .NETCode Contracts API In .NET
Code Contracts API In .NET
 
Kontrakt testy - KraQA 42 - Slawomir Radzyminski
Kontrakt testy - KraQA 42 - Slawomir RadzyminskiKontrakt testy - KraQA 42 - Slawomir Radzyminski
Kontrakt testy - KraQA 42 - Slawomir Radzyminski
 
MQTT 5 - What's New?
MQTT 5 - What's New?MQTT 5 - What's New?
MQTT 5 - What's New?
 
Open-DO Update
Open-DO UpdateOpen-DO Update
Open-DO Update
 
Code Contracts API In .Net
Code Contracts API In .NetCode Contracts API In .Net
Code Contracts API In .Net
 
Continuous testing - GUERLAIS ARGOT - Air France KLM Sogeti- Soirée du Test L...
Continuous testing - GUERLAIS ARGOT - Air France KLM Sogeti- Soirée du Test L...Continuous testing - GUERLAIS ARGOT - Air France KLM Sogeti- Soirée du Test L...
Continuous testing - GUERLAIS ARGOT - Air France KLM Sogeti- Soirée du Test L...
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
SFScon 22 - Andrea Janes - Scalability assessment applied to microservice arc...
SFScon 22 - Andrea Janes - Scalability assessment applied to microservice arc...SFScon 22 - Andrea Janes - Scalability assessment applied to microservice arc...
SFScon 22 - Andrea Janes - Scalability assessment applied to microservice arc...
 
Continuously Delivering Distributed Systems
Continuously Delivering Distributed SystemsContinuously Delivering Distributed Systems
Continuously Delivering Distributed Systems
 
Bdd test automation analysis
Bdd test automation analysisBdd test automation analysis
Bdd test automation analysis
 
Improving Software quality for the Modern Web
Improving Software quality for the Modern WebImproving Software quality for the Modern Web
Improving Software quality for the Modern Web
 
Microservices erfolgreich testen mit Consumer Driven Contract Testing und Spr...
Microservices erfolgreich testen mit Consumer Driven Contract Testing und Spr...Microservices erfolgreich testen mit Consumer Driven Contract Testing und Spr...
Microservices erfolgreich testen mit Consumer Driven Contract Testing und Spr...
 
ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?
ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?
ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?
 
Testing with test_complete
Testing with test_completeTesting with test_complete
Testing with test_complete
 

Plus de kraqa

Od Produktywności do Sabotażu - Sławomir Radzymiński, KraQA #31
Od Produktywności do Sabotażu - Sławomir Radzymiński, KraQA #31Od Produktywności do Sabotażu - Sławomir Radzymiński, KraQA #31
Od Produktywności do Sabotażu - Sławomir Radzymiński, KraQA #31
kraqa
 

Plus de kraqa (20)

RestAssured w sluzbie testow API
RestAssured w sluzbie testow APIRestAssured w sluzbie testow API
RestAssured w sluzbie testow API
 
Postman - podstawy testowania REST API
Postman - podstawy testowania REST APIPostman - podstawy testowania REST API
Postman - podstawy testowania REST API
 
Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20Stanislaw potoczny kra_qa_21.01.20
Stanislaw potoczny kra_qa_21.01.20
 
Machine learning powered regression - KraQA 42 - Pawel Dyrek
Machine learning powered regression - KraQA 42 - Pawel Dyrek Machine learning powered regression - KraQA 42 - Pawel Dyrek
Machine learning powered regression - KraQA 42 - Pawel Dyrek
 
KraQA#41 - PageFactory
KraQA#41 - PageFactoryKraQA#41 - PageFactory
KraQA#41 - PageFactory
 
KraQA#39 - Jak testowac tool do testow
KraQA#39 - Jak testowac tool do testowKraQA#39 - Jak testowac tool do testow
KraQA#39 - Jak testowac tool do testow
 
Hyperion - wystarczy jeden shake
Hyperion - wystarczy jeden shakeHyperion - wystarczy jeden shake
Hyperion - wystarczy jeden shake
 
Wybor urzadzen mobilnych do testow
Wybor urzadzen mobilnych do testowWybor urzadzen mobilnych do testow
Wybor urzadzen mobilnych do testow
 
Continuous security
Continuous securityContinuous security
Continuous security
 
Let s meet inside
Let s meet insideLet s meet inside
Let s meet inside
 
O wezu przy kawie
O wezu przy kawieO wezu przy kawie
O wezu przy kawie
 
Strategia do automatów
Strategia do automatówStrategia do automatów
Strategia do automatów
 
Z czym do api
Z czym do apiZ czym do api
Z czym do api
 
Jenkins pipelines
Jenkins pipelinesJenkins pipelines
Jenkins pipelines
 
Testy UI
Testy UITesty UI
Testy UI
 
Tester w pułapce myślenia
Tester w pułapce myśleniaTester w pułapce myślenia
Tester w pułapce myślenia
 
Kiedy tester zostaje managerem
Kiedy tester zostaje manageremKiedy tester zostaje managerem
Kiedy tester zostaje managerem
 
KraQA#32 - RODO
KraQA#32 - RODOKraQA#32 - RODO
KraQA#32 - RODO
 
SkładQA 2018 - Daniel Dec
SkładQA 2018 - Daniel DecSkładQA 2018 - Daniel Dec
SkładQA 2018 - Daniel Dec
 
Od Produktywności do Sabotażu - Sławomir Radzymiński, KraQA #31
Od Produktywności do Sabotażu - Sławomir Radzymiński, KraQA #31Od Produktywności do Sabotażu - Sławomir Radzymiński, KraQA #31
Od Produktywności do Sabotażu - Sławomir Radzymiński, KraQA #31
 

Dernier

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

SkładQA #3 - Contract Testing, M. Bryła