SlideShare a Scribd company logo
Pact – Consumer Driven Contract Testing 
Commercial in Confidence | Assurity Consulting Limited 2014 
“Integrated Tests Are A Scam” 
Pete Sellars – Technical Consultant
Challenge… 
Commercial in Confidence | Assurity Consulting Limited 2014
Who Writes Integration Test? 
Commercial in Confidence | Assurity Consulting Limited 2014
Integrated Tests Are A Scam 
Integrated tests are a scam—a self-replicating 
Commercial in Confidence | Assurity Consulting Limited 2014 
virus that threatens to infect 
your code base, your project, and your 
team with endless pain and suffering.
Code Whisperer 
Commercial in Confidence | Assurity Consulting Limited 2014
Challenge Accepted 
Commercial in Confidence | Assurity Consulting Limited 2014
Timeline - 2005 
Commercial in Confidence | Assurity Consulting Limited 2014
Contract Tests – Design By Contract 
Commercial in Confidence | Assurity Consulting Limited 2014
Timeline - 2006 
Commercial in Confidence | Assurity Consulting Limited 2014
Contracts Overview 
Provider 
•Closed & Complete 
•Singular & Authorative 
•Bounded Stability & 
Immutability 
Commercial in Confidence | Assurity Consulting Limited 2014 
Consumer 
•Open & Incomplete 
•Multiple & 
Non-Authorative 
•Bounded Stability & 
Immutability 
Consumer-Driven 
•Closed & Complete 
•Singular & 
Non-Authorative 
•Bounded Stability & 
Immutability 
Consumer-Driven Contracts, A Service Evolution Pattern: Ian Robinson
Consumer-Driven Contract Benefits 
…they focus the specification 
and delivery of service 
functionality around key 
business value drivers. 
Commercial in Confidence | Assurity Consulting Limited 2014 
…give us the fine-grained 
insight and rapid feedback we 
require to plan changes and 
assess their impact on 
applications currently in 
production 
Consumer-Driven Contracts, A Service Evolution Pattern: Ian Robinson
Timeline - 2009 
Commercial in Confidence | Assurity Consulting Limited 2014
Why Are Integrated Tests A Scam? 
Commercial in Confidence | Assurity Consulting Limited 2014
Why Are Integrated Tests A Scam 
Commercial in Confidence | Assurity Consulting Limited 2014 
Integrated Tests Are A Scam (2009): J.B. Rainsberger
How to beat the Scam…. 
Commercial in Confidence | Assurity Consulting Limited 2014 
Integrated Tests Are A Scam (2009): J.B. Rainsberger
Timeline - 2010 
Commercial in Confidence | Assurity Consulting Limited 2014
Why Are Integrated Tests A Scam? 
Commercial in Confidence | Assurity Consulting Limited 2014 
Integrated Tests Are A Scam (2010): J.B. Rainsberger
Why Are Integrated Tests A Scam… 
Consider 10 layers with 3 
potential branch points 
at each layer. Number of 
code paths: 310 > 59,000. 
How about 4 branch 
points per layer? 410 > 
1,000,000. How about 3 
branch and 12 layers? 
312 > 530,000. 
Commercial in Confidence | Assurity Consulting Limited 2014 
How about 3 branch and 
12 layers? 312 > 530,000. 
Even if one of your 12 
layers has a single code 
path, 311 > 177,000. 
Even if your 10-layer 
application has only an 
average of 3.5 code 
paths per layer, 3.510> 
275,0001. 
Do you feel lucky? 
Do you? 
Integrated Tests Are A Scam (2010): J.B. Rainsberger
How to beat the Scam… 
Commercial in Confidence | Assurity Consulting Limited 2014 
Integrated Tests Are A Scam (2010): J.B. Rainsberger
Timeline - 2010 
Commercial in Confidence | Assurity Consulting Limited 2014
Sharing Tests!! … 
To reduce the chances of unexpected 
breaks in integration contracts, it's useful 
to move to a Consumer Driven 
Contracts approach. You can facilitate this 
by letting the supplier team have copies of 
your integration contract tests so they can 
run them as part of their build pipeline. 
Commercial in Confidence | Assurity Consulting Limited 2014 
Integrtation Contract Tests (2010): Martin Fowler
2010: Writing Consumer-Driven Contracts? 
Commercial in Confidence | Assurity Consulting Limited 2014
Micro Services 
Commercial in Confidence | Assurity Consulting Limited 2014
Micro Services 
Commercial in Confidence | Assurity Consulting Limited 2014
Timeline - 2013 
Commercial in Confidence | Assurity Consulting Limited 2014
Pact 
Commercial in Confidence | Assurity Consulting Limited 2014 
Testing Interactions with Web Services without Integration Tests In Ruby: 
REA Engineering Blog
Pact 
Consumer sets up 
expectations on a mock 
service provider. Mock 
service returns the 
expected responses. 
The requests, and their 
expected responses, are 
then written to a "pact“ 
file 
Commercial in Confidence | Assurity Consulting Limited 2014 
The requests in the pact 
file are later replayed 
against the provider. Actual 
responses are checked to 
make sure they match the 
expected responses. 
Integrated Tests Are A Scam (2010): 
J.B. Rainsberger
Pact 
Commercial in Confidence | Assurity Consulting Limited 2014 
Testing with Pact: Pact Wiki
Pact 
Commercial in Confidence | Assurity Consulting Limited 2014 
Simplifying Micro-Services Testing with Pacts: Ron Holshausen
Pact Features 
Pact Wiki 
Commercial in Confidence | Assurity Consulting Limited 2014
Pact 
We now have fast unit-like 
tests on each side of the 
integration point instead of 
tedious integration tests. 
Commercial in Confidence | Assurity Consulting Limited 2014 
Testing Interactions with Web Services without Integration Tests In Ruby: 
REA Engineering Blog
Timeline - 2013 
Commercial in Confidence | Assurity Consulting Limited 2014
Why Integration Test Are Still A Scam… 
Commercial in Confidence | Assurity Consulting Limited 2014 
Cumulative 
# Required; 
Slow & 
Brittle 
Doesn’t 
Provide 
Coverage 
Expected 
Encourage 
Sloppy 
Coding 
Integrated Tests Are A Scam
Timeline - 2014 
Commercial in Confidence | Assurity Consulting Limited 2014
Trial Pact & Pacto 
Consumer-Driven Contracts are a testing 
approach to help service interfaces evolve 
with confidence without unknowingly 
breaking consumers. The similarly 
named Pact and Pacto are two new open-source 
tools which allow testing interactions 
between service providers and consumers in 
isolation against a contract. Both have grown 
out of projects which are building RESTful 
microservices and show great promise. 
Commercial in Confidence | Assurity Consulting Limited 2014 
ThoughtWorks Technology Radar: July 2014
Do Things Differently? 
Commercial in Confidence | Assurity Consulting Limited 2014
References 
• Blog Posts 
> Contract Testing, J.B. Rainsberger: http://blog.thecodewhisperer.com/2005/03/02/in-brief-contract-tests/ 
> Integrated Tests Are A Scam, J.B. Rainsberger: http://blog.thecodewhisperer.com/2010/10/16/integrated-tests-are-a-scam/ 
> IntegrationContractTests, Martin Fowler: http://martinfowler.com/bliki/IntegrationContractTest.html 
> Testing Interactions with WebServices without Integration Tests in Ruby, REA Techblog: http://techblog.realestate.com.au/testing-interactions-with-web-services-without-integration-tests-in-ruby/ 
> Simplifying Micro-Service testing with Pacts, Ron Holshausen: http://dius.com.au/2014/05/19/simplifying-micro-service-testing-with-pacts/ 
• Articles 
> Consumer-Driven Contracts – A Service Evolution Pattern, Ian Robinson: http://www.martinfowler.com/articles/consumerDrivenContracts.html 
> Thoughtworks Technology Radar: http://www.thoughtworks.com/radar 
> Design By Contract: http://c2.com/cgi/wiki?DesignByContract 
• Presentations 
> Agile 2009 - Integration Tests Are A Scam, J.B. Rainsberger: http://www.infoq.com/presentations/integration-tests-scam 
> Integration Tests Are A Scam (Slides 2010), J.B. Rainsberger: http://www.slideshare.net/agileee/notes-5407051 
> DevConFu 2013 – Integrated Tests Are A Scam, J.B. Rainsberger: http://vimeo.com/80533536 
> Micro-Service Architecture, Fred George: http://www.slideshare.net/fredgeorge/micro-service-architecure 
> Practical Microserices (YOW 2013), Sam Newman: http://www.slideshare.net/spnewman/practical-microservices-yow-2013 
> Practical Considerations for Micro-Service Architectures, Sam Newman: http://yow.eventer.com/yow-2013-1080/practical-considerations-for-microservice-architectures-by-sam-newman-1389 
• Tools 
> Pact: https://github.com/realestate-com-au/pact/wiki 
− Provider State Example: https://github.com/realestate-com-au/pact/blob/master/example/zoo-app/spec/service_providers/animal_service_client_spec.rb 
− Generated Documentation Example: https://github.com/realestate-com-au/pact/blob/master/example/zoo-app/doc/pacts/markdown/Zoo%20App%20-%20Animal%20Service.md 
> Pacto: http://thoughtworks.github.io/pacto/ 
Commercial in Confidence | Assurity Consulting Limited 2014

More Related Content

Similar to Lightening Talk: Auckland Continuous Delivery Meetup [Sept 2014] - Pact: Consumer-Driven Contract Testing (Integrated Tests Are A Scam)

ConnectTheGrid Overview Webinar - June 10, 2015
ConnectTheGrid Overview Webinar - June 10, 2015ConnectTheGrid Overview Webinar - June 10, 2015
ConnectTheGrid Overview Webinar - June 10, 2015
West Monroe Partners
 
IPI-Brochure-Final
IPI-Brochure-FinalIPI-Brochure-Final
IPI-Brochure-Final
Gerol Nygard
 
KiwiQA-Corporate-Presefvdvdxvxcvxcntation (2).pptx
KiwiQA-Corporate-Presefvdvdxvxcvxcntation (2).pptxKiwiQA-Corporate-Presefvdvdxvxcvxcntation (2).pptx
KiwiQA-Corporate-Presefvdvdxvxcvxcntation (2).pptx
MeseAK
 

Similar to Lightening Talk: Auckland Continuous Delivery Meetup [Sept 2014] - Pact: Consumer-Driven Contract Testing (Integrated Tests Are A Scam) (20)

ConnectTheGrid Overview Webinar - June 10, 2015
ConnectTheGrid Overview Webinar - June 10, 2015ConnectTheGrid Overview Webinar - June 10, 2015
ConnectTheGrid Overview Webinar - June 10, 2015
 
TechMinfy Services_Offerings
TechMinfy Services_OfferingsTechMinfy Services_Offerings
TechMinfy Services_Offerings
 
QAI STC 2014 Plenary Keynote: Innovation & agility in testing a paradigm shift
QAI STC 2014 Plenary Keynote: Innovation & agility in testing   a paradigm shiftQAI STC 2014 Plenary Keynote: Innovation & agility in testing   a paradigm shift
QAI STC 2014 Plenary Keynote: Innovation & agility in testing a paradigm shift
 
Integra Networks About
Integra Networks AboutIntegra Networks About
Integra Networks About
 
AssureBridge - B2B Partner Demands SSO - Marketing Presentation
AssureBridge - B2B Partner Demands SSO - Marketing PresentationAssureBridge - B2B Partner Demands SSO - Marketing Presentation
AssureBridge - B2B Partner Demands SSO - Marketing Presentation
 
AssureBridge - B2B Partner Demands SSO
AssureBridge - B2B Partner Demands SSOAssureBridge - B2B Partner Demands SSO
AssureBridge - B2B Partner Demands SSO
 
AssureBridge - B2B Partner Demands SSO - Marketing Presentation
AssureBridge - B2B Partner Demands SSO - Marketing PresentationAssureBridge - B2B Partner Demands SSO - Marketing Presentation
AssureBridge - B2B Partner Demands SSO - Marketing Presentation
 
Improving Customer Experience with IVR
Improving Customer Experience with IVRImproving Customer Experience with IVR
Improving Customer Experience with IVR
 
Building quality in
Building quality inBuilding quality in
Building quality in
 
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
 
Gartner BPM Summit Keynote - Adoption drives ROI
Gartner BPM Summit Keynote - Adoption drives ROIGartner BPM Summit Keynote - Adoption drives ROI
Gartner BPM Summit Keynote - Adoption drives ROI
 
Top 10 Best Quality Assurance Consultants In the World in 2024
Top 10 Best Quality Assurance Consultants In the World in 2024Top 10 Best Quality Assurance Consultants In the World in 2024
Top 10 Best Quality Assurance Consultants In the World in 2024
 
Guidewire Connections 2023 DE-4 Using AI to Accelerate Application Integration
Guidewire Connections 2023 DE-4 Using AI to Accelerate Application IntegrationGuidewire Connections 2023 DE-4 Using AI to Accelerate Application Integration
Guidewire Connections 2023 DE-4 Using AI to Accelerate Application Integration
 
IPI-Brochure-Final
IPI-Brochure-FinalIPI-Brochure-Final
IPI-Brochure-Final
 
AssureBridge - SSO to Many B2B Service Providers - Marketing presentation
AssureBridge - SSO to Many B2B Service Providers - Marketing presentationAssureBridge - SSO to Many B2B Service Providers - Marketing presentation
AssureBridge - SSO to Many B2B Service Providers - Marketing presentation
 
Ambiguity Reviews: Building Quality Requirements
Ambiguity Reviews: Building Quality RequirementsAmbiguity Reviews: Building Quality Requirements
Ambiguity Reviews: Building Quality Requirements
 
Underpinning Agreements: Keeping the End Goal in Mind
Underpinning Agreements:  Keeping the End Goal in MindUnderpinning Agreements:  Keeping the End Goal in Mind
Underpinning Agreements: Keeping the End Goal in Mind
 
Collaborative contracting strategies and the use of the NEC3 family of contracts
Collaborative contracting strategies and the use of the NEC3 family of contractsCollaborative contracting strategies and the use of the NEC3 family of contracts
Collaborative contracting strategies and the use of the NEC3 family of contracts
 
A Legal Checklist
A Legal Checklist A Legal Checklist
A Legal Checklist
 
KiwiQA-Corporate-Presefvdvdxvxcvxcntation (2).pptx
KiwiQA-Corporate-Presefvdvdxvxcvxcntation (2).pptxKiwiQA-Corporate-Presefvdvdxvxcvxcntation (2).pptx
KiwiQA-Corporate-Presefvdvdxvxcvxcntation (2).pptx
 

More from Peter Sellars

More from Peter Sellars (10)

Culture As Strategy - DevOpsDays NZ 2016
Culture As Strategy - DevOpsDays NZ 2016Culture As Strategy - DevOpsDays NZ 2016
Culture As Strategy - DevOpsDays NZ 2016
 
What Is The Docker Global Hack Day?
What Is The Docker Global Hack Day?What Is The Docker Global Hack Day?
What Is The Docker Global Hack Day?
 
Auckland Docker Meetup (July 2015) - DockerCon2015 lightningtalk
Auckland Docker Meetup (July 2015) - DockerCon2015 lightningtalkAuckland Docker Meetup (July 2015) - DockerCon2015 lightningtalk
Auckland Docker Meetup (July 2015) - DockerCon2015 lightningtalk
 
Be awesomer
Be awesomerBe awesomer
Be awesomer
 
Technology Radar - Pecha Kucha
Technology Radar - Pecha KuchaTechnology Radar - Pecha Kucha
Technology Radar - Pecha Kucha
 
YOW! 2010 Day 2
YOW! 2010 Day 2YOW! 2010 Day 2
YOW! 2010 Day 2
 
YOW! 2010 Day 1
YOW! 2010 Day 1YOW! 2010 Day 1
YOW! 2010 Day 1
 
BQI Project Overview
BQI Project OverviewBQI Project Overview
BQI Project Overview
 
Jet presentation
Jet presentationJet presentation
Jet presentation
 
JUnit Goodness
JUnit GoodnessJUnit Goodness
JUnit Goodness
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 

Lightening Talk: Auckland Continuous Delivery Meetup [Sept 2014] - Pact: Consumer-Driven Contract Testing (Integrated Tests Are A Scam)

  • 1. Pact – Consumer Driven Contract Testing Commercial in Confidence | Assurity Consulting Limited 2014 “Integrated Tests Are A Scam” Pete Sellars – Technical Consultant
  • 2. Challenge… Commercial in Confidence | Assurity Consulting Limited 2014
  • 3. Who Writes Integration Test? Commercial in Confidence | Assurity Consulting Limited 2014
  • 4. Integrated Tests Are A Scam Integrated tests are a scam—a self-replicating Commercial in Confidence | Assurity Consulting Limited 2014 virus that threatens to infect your code base, your project, and your team with endless pain and suffering.
  • 5. Code Whisperer Commercial in Confidence | Assurity Consulting Limited 2014
  • 6. Challenge Accepted Commercial in Confidence | Assurity Consulting Limited 2014
  • 7. Timeline - 2005 Commercial in Confidence | Assurity Consulting Limited 2014
  • 8. Contract Tests – Design By Contract Commercial in Confidence | Assurity Consulting Limited 2014
  • 9. Timeline - 2006 Commercial in Confidence | Assurity Consulting Limited 2014
  • 10. Contracts Overview Provider •Closed & Complete •Singular & Authorative •Bounded Stability & Immutability Commercial in Confidence | Assurity Consulting Limited 2014 Consumer •Open & Incomplete •Multiple & Non-Authorative •Bounded Stability & Immutability Consumer-Driven •Closed & Complete •Singular & Non-Authorative •Bounded Stability & Immutability Consumer-Driven Contracts, A Service Evolution Pattern: Ian Robinson
  • 11. Consumer-Driven Contract Benefits …they focus the specification and delivery of service functionality around key business value drivers. Commercial in Confidence | Assurity Consulting Limited 2014 …give us the fine-grained insight and rapid feedback we require to plan changes and assess their impact on applications currently in production Consumer-Driven Contracts, A Service Evolution Pattern: Ian Robinson
  • 12. Timeline - 2009 Commercial in Confidence | Assurity Consulting Limited 2014
  • 13. Why Are Integrated Tests A Scam? Commercial in Confidence | Assurity Consulting Limited 2014
  • 14. Why Are Integrated Tests A Scam Commercial in Confidence | Assurity Consulting Limited 2014 Integrated Tests Are A Scam (2009): J.B. Rainsberger
  • 15. How to beat the Scam…. Commercial in Confidence | Assurity Consulting Limited 2014 Integrated Tests Are A Scam (2009): J.B. Rainsberger
  • 16. Timeline - 2010 Commercial in Confidence | Assurity Consulting Limited 2014
  • 17. Why Are Integrated Tests A Scam? Commercial in Confidence | Assurity Consulting Limited 2014 Integrated Tests Are A Scam (2010): J.B. Rainsberger
  • 18. Why Are Integrated Tests A Scam… Consider 10 layers with 3 potential branch points at each layer. Number of code paths: 310 > 59,000. How about 4 branch points per layer? 410 > 1,000,000. How about 3 branch and 12 layers? 312 > 530,000. Commercial in Confidence | Assurity Consulting Limited 2014 How about 3 branch and 12 layers? 312 > 530,000. Even if one of your 12 layers has a single code path, 311 > 177,000. Even if your 10-layer application has only an average of 3.5 code paths per layer, 3.510> 275,0001. Do you feel lucky? Do you? Integrated Tests Are A Scam (2010): J.B. Rainsberger
  • 19. How to beat the Scam… Commercial in Confidence | Assurity Consulting Limited 2014 Integrated Tests Are A Scam (2010): J.B. Rainsberger
  • 20. Timeline - 2010 Commercial in Confidence | Assurity Consulting Limited 2014
  • 21. Sharing Tests!! … To reduce the chances of unexpected breaks in integration contracts, it's useful to move to a Consumer Driven Contracts approach. You can facilitate this by letting the supplier team have copies of your integration contract tests so they can run them as part of their build pipeline. Commercial in Confidence | Assurity Consulting Limited 2014 Integrtation Contract Tests (2010): Martin Fowler
  • 22. 2010: Writing Consumer-Driven Contracts? Commercial in Confidence | Assurity Consulting Limited 2014
  • 23. Micro Services Commercial in Confidence | Assurity Consulting Limited 2014
  • 24. Micro Services Commercial in Confidence | Assurity Consulting Limited 2014
  • 25. Timeline - 2013 Commercial in Confidence | Assurity Consulting Limited 2014
  • 26. Pact Commercial in Confidence | Assurity Consulting Limited 2014 Testing Interactions with Web Services without Integration Tests In Ruby: REA Engineering Blog
  • 27. Pact Consumer sets up expectations on a mock service provider. Mock service returns the expected responses. The requests, and their expected responses, are then written to a "pact“ file Commercial in Confidence | Assurity Consulting Limited 2014 The requests in the pact file are later replayed against the provider. Actual responses are checked to make sure they match the expected responses. Integrated Tests Are A Scam (2010): J.B. Rainsberger
  • 28. Pact Commercial in Confidence | Assurity Consulting Limited 2014 Testing with Pact: Pact Wiki
  • 29. Pact Commercial in Confidence | Assurity Consulting Limited 2014 Simplifying Micro-Services Testing with Pacts: Ron Holshausen
  • 30. Pact Features Pact Wiki Commercial in Confidence | Assurity Consulting Limited 2014
  • 31. Pact We now have fast unit-like tests on each side of the integration point instead of tedious integration tests. Commercial in Confidence | Assurity Consulting Limited 2014 Testing Interactions with Web Services without Integration Tests In Ruby: REA Engineering Blog
  • 32. Timeline - 2013 Commercial in Confidence | Assurity Consulting Limited 2014
  • 33. Why Integration Test Are Still A Scam… Commercial in Confidence | Assurity Consulting Limited 2014 Cumulative # Required; Slow & Brittle Doesn’t Provide Coverage Expected Encourage Sloppy Coding Integrated Tests Are A Scam
  • 34. Timeline - 2014 Commercial in Confidence | Assurity Consulting Limited 2014
  • 35. Trial Pact & Pacto Consumer-Driven Contracts are a testing approach to help service interfaces evolve with confidence without unknowingly breaking consumers. The similarly named Pact and Pacto are two new open-source tools which allow testing interactions between service providers and consumers in isolation against a contract. Both have grown out of projects which are building RESTful microservices and show great promise. Commercial in Confidence | Assurity Consulting Limited 2014 ThoughtWorks Technology Radar: July 2014
  • 36. Do Things Differently? Commercial in Confidence | Assurity Consulting Limited 2014
  • 37. References • Blog Posts > Contract Testing, J.B. Rainsberger: http://blog.thecodewhisperer.com/2005/03/02/in-brief-contract-tests/ > Integrated Tests Are A Scam, J.B. Rainsberger: http://blog.thecodewhisperer.com/2010/10/16/integrated-tests-are-a-scam/ > IntegrationContractTests, Martin Fowler: http://martinfowler.com/bliki/IntegrationContractTest.html > Testing Interactions with WebServices without Integration Tests in Ruby, REA Techblog: http://techblog.realestate.com.au/testing-interactions-with-web-services-without-integration-tests-in-ruby/ > Simplifying Micro-Service testing with Pacts, Ron Holshausen: http://dius.com.au/2014/05/19/simplifying-micro-service-testing-with-pacts/ • Articles > Consumer-Driven Contracts – A Service Evolution Pattern, Ian Robinson: http://www.martinfowler.com/articles/consumerDrivenContracts.html > Thoughtworks Technology Radar: http://www.thoughtworks.com/radar > Design By Contract: http://c2.com/cgi/wiki?DesignByContract • Presentations > Agile 2009 - Integration Tests Are A Scam, J.B. Rainsberger: http://www.infoq.com/presentations/integration-tests-scam > Integration Tests Are A Scam (Slides 2010), J.B. Rainsberger: http://www.slideshare.net/agileee/notes-5407051 > DevConFu 2013 – Integrated Tests Are A Scam, J.B. Rainsberger: http://vimeo.com/80533536 > Micro-Service Architecture, Fred George: http://www.slideshare.net/fredgeorge/micro-service-architecure > Practical Microserices (YOW 2013), Sam Newman: http://www.slideshare.net/spnewman/practical-microservices-yow-2013 > Practical Considerations for Micro-Service Architectures, Sam Newman: http://yow.eventer.com/yow-2013-1080/practical-considerations-for-microservice-architectures-by-sam-newman-1389 • Tools > Pact: https://github.com/realestate-com-au/pact/wiki − Provider State Example: https://github.com/realestate-com-au/pact/blob/master/example/zoo-app/spec/service_providers/animal_service_client_spec.rb − Generated Documentation Example: https://github.com/realestate-com-au/pact/blob/master/example/zoo-app/doc/pacts/markdown/Zoo%20App%20-%20Animal%20Service.md > Pacto: http://thoughtworks.github.io/pacto/ Commercial in Confidence | Assurity Consulting Limited 2014