SlideShare a Scribd company logo
1 of 70
Download to read offline
1
Microservices.
Test smarter, not harder.
Beth Skurrie (DiUS)
@bethesque
#VoxxedAus2019
A big problem
Problem:
Long time to market
Microservices!
Solved a problem!
New problem...
WHAT WE ARE KNOWN FOR
6
Microservices
Solved problems New problems
● E2E integration tests
○ Slow tests
○ Easy to break
○ Hard to fix
○ Scale badly
○ Lots of set up
○ Flakey tests ignored
○ Takes dev time away
from features
● Feature time to market
A STORY @bethesque
7
@bethesque
To E2E test, or not to E2E test?
A STORY
8
@bethesque
What if there was another way?
9
C P
mock
ANOTHER WAY @bethesque
Consumer tests Provider tests
Integration test
WHAT WE ARE KNOWN FOR
10
Test symmetry
Solved problems New problems
● Hard to keep both sides in
sync
● Fast feedback
● Few dependencies
● No dedicated environment
● Reliable
● Easy to debug
ANOTHER WAY @bethesque
11
C P
mock
ANOTHER WAY @bethesque
12
C P
mock
ANOTHER WAY @bethesque
PPCC
mock
contract
ANOTHER WAY @bethesque
Consumer tests Provider tests
Integration test
14
Message Contract
OTHER TOOLS
C P
contract
@bethesque
WHAT WE ARE KNOWN FOR
15
Contracts
Solved problems New problems
● ???● Keeping tests in sync
ANOTHER WAY @bethesque
How long between writing the
code and finding the bug?
Local
tests
Isolated CI
tests
Deploy E2E
tests
5 mins 15 mins 45 mins 1 hour +
Find
bug
here!
Not
here!
@bethesque
Find integration bugs
early and quickly
Contracts tests
ANOTHER WAY @bethesque
Know before you
commit
Contracts tests
ANOTHER WAY @bethesque
Make changes with
speed and confidence
Contracts tests
ANOTHER WAY @bethesque
Deploy independently
Contracts tests
ANOTHER WAY @bethesque
Better API design
(Consumer)
Contracts tests
ANOTHER WAY @bethesque
Are not functional tests
Contracts tests
ANOTHER WAY @bethesque
Are not an API
specification
Contracts tests
ANOTHER WAY @bethesque
Are not good for “public”
APIs (many, unknown
consumers)
(Consumer)
Contracts tests
ANOTHER WAY @bethesque
Are not a silver bullet!
Contracts tests
ANOTHER WAY @bethesque
27
@bethesque
Business value
Code correctness
28
@bethesque
The Testing Pyramid of Hell
29
@bethesque
WHAT WE ARE KNOWN FOR
30
Speed up your releases
Do less Do more
● Contract testing
● Aggregated logging
● Metrics
● Semantic monitoring
● Alerting
● Correlation IDs
● Integration testing
ANOTHER WAY @bethesque
My contract
testing journey
32
@bethesque
● Open source
● Multiple languages
○ JVM
○ .NET
○ Javascript
○ Python
○ Go
○ + more
pact.io
● HTTP contracts
● Message contracts
33
A B
mock
C P
contract
A CONTRACT TESTING JOURNEY @bethesque
34
A CONTRACT TESTING JOURNEY @bethesque
35
@bethesque
Too many microservices?
You need another microservice!
A CONTRACT TESTING JOURNEY
36
Pact Broker
A CONTRACT TESTING JOURNEY @bethesque
37
@bethesque
Problem 1: Contract exchange
Solution: Pact Broker
A CONTRACT TESTING JOURNEY
38
@bethesque
WHEN
the provider receives
<some request>
THEN
it will return
<some response>
A CONTRACT TESTING JOURNEY
39
@bethesque
WHEN
the provider receives
a GET request for /alligators/Mary
THEN
it will return
a 200 OK response
with a JSON body {“name”: “Mary”}
A CONTRACT TESTING JOURNEY
40
@bethesque
WHEN
the provider receives
a GET request for /alligators/Mary
THEN
it will return
a 404 Not Found
response
a 200 OK
response
A CONTRACT TESTING JOURNEY
41
@bethesque
GIVEN
<the provider is in a certain state>
WHEN
the provider receives
<some request>
THEN
it will return
<some response>
A CONTRACT TESTING JOURNEY
42
@bethesque
Problem 2: Data setup, code coverage
Solution: Provider states
A CONTRACT TESTING JOURNEY
A contract testing
journey
● Automate the contract exchange
● You still need to think about test
data
A CONTRACT TESTING JOURNEY @bethesque
44
@bethesque
Problem 3: brittle tests
A CONTRACT TESTING JOURNEY
45
@bethesque
Problem 3: brittle tests
Solution: flexible matching
A CONTRACT TESTING JOURNEY
A contract testing
journey
● Automate the contract exchange
● You still need to think about test data
● Contracts should focus on the
messages, not the technology
● Contracts should be as flexible as
possible - but no more
A CONTRACT TESTING JOURNEY @bethesque
47
@bethesque
Problem 4: Dealing with
contract changes
A CONTRACT TESTING JOURNEY
48
@bethesque
The other service needs to know when a
contract has changed
Contracts are not a substitute for good
communication between teams
A CONTRACT TESTING JOURNEY
49
@bethesque
Pact Broker webhooks
A CONTRACT TESTING JOURNEY
50
@bethesque
Contracts are STILL not a substitute for
good communication between teams
A CONTRACT TESTING JOURNEY
● Automate the contract exchange
● You still need to think about test data
● Contracts should focus on the
messages, not the technology
● Contracts should be as flexible as
possible - but no more
● The provider needs to know when a
contract has changed
● Remember: contracts are not a
substitute for good communication
between teams
A contract testing
journey
A CONTRACT TESTING JOURNEY @bethesque
52
A CONTRACT TESTING JOURNEY @bethesque
53
@bethesque
Problem 5: Communicating
verification results back to
consumer
A CONTRACT TESTING JOURNEY
54
@bethesque
Pact Broker verifications
A CONTRACT TESTING JOURNEY
55
@bethesqueA CONTRACT TESTING JOURNEY
56
@bethesqueA CONTRACT TESTING JOURNEY
57
@bethesque
If you can’t deploy your services
independently,
you don’t have microservices.
You have a distributed monolith.
A CONTRACT TESTING JOURNEY
Contract
tests
E2E
tests
58
@bethesque
If you can’t deploy your services
independently,
you don’t have microservices.
You have a distributed monolith.
A CONTRACT TESTING JOURNEY
59
@bethesque
If you can’t deploy your services
independently,
you don’t have microservices.
You have a distributed monolith.
A CONTRACT TESTING JOURNEY
Warning!
Do not build a
distributed monolith
60
Consumer
version
Provider
version
Verification
result
11 54 success
12 54 failure
12 55 success
13 56 success
13 57 failure
“The Matrix”
A CONTRACT TESTING JOURNEY @bethesque
61
Consumer
version
Provider
version
Verification
result
11 ✓ 54 PROD. success
12 54 failure
12 55 success
13 56 success
13 57 unknown
Can I deploy?
A CONTRACT TESTING JOURNEY @bethesque
62
A CONTRACT TESTING JOURNEY @bethesque
63
A CONTRACT TESTING JOURNEY @bethesque
64
@bethesque
What about Swagger/OAS?
OTHER TOOLS
65
Provider contracts
OTHER TOOLS @bethesque
66
Consumer contracts
OTHER TOOLS @bethesque
67
A B
mock/write
C P
pact swagger
verify
verify
Pact+Swagger
OTHER TOOLS @bethesque
● OAS support
● Improved Broker workflow
What are the next
problems to
solve for
Pact?
ANOTHER WAY @bethesque
WHAT WE ARE KNOWN FOR
69
Contracts
Solved problems New problems
● ???● Shipping code faster
@bethesque
70
pact.io
pactflow.io
slack.pact.io
@pact_up
Microservices.
Test smarter, not harder
Beth Skurrie (DiUS)
@bethesque
#VoxxedAus2019

More Related Content

What's hot

Sample Solution Blueprint
Sample Solution BlueprintSample Solution Blueprint
Sample Solution Blueprint
Mike Alvarado
 
Testing capability ppt
Testing capability pptTesting capability ppt
Testing capability ppt
anilreddyqa
 

What's hot (20)

Test data management
Test data managementTest data management
Test data management
 
Explore Microsoft Power Platform Center of Excellence
Explore Microsoft Power Platform Center of ExcellenceExplore Microsoft Power Platform Center of Excellence
Explore Microsoft Power Platform Center of Excellence
 
Bizweb Microservices Architecture
Bizweb Microservices ArchitectureBizweb Microservices Architecture
Bizweb Microservices Architecture
 
Tcoe team
Tcoe teamTcoe team
Tcoe team
 
Managed It Services
Managed It ServicesManaged It Services
Managed It Services
 
Agile Solution Architecture and Design
Agile Solution Architecture and DesignAgile Solution Architecture and Design
Agile Solution Architecture and Design
 
Xray for Jira - How to automate your QA process
Xray for Jira - How to automate your QA processXray for Jira - How to automate your QA process
Xray for Jira - How to automate your QA process
 
Sample Solution Blueprint
Sample Solution BlueprintSample Solution Blueprint
Sample Solution Blueprint
 
Comparison of Top CMS Systems
Comparison of Top CMS SystemsComparison of Top CMS Systems
Comparison of Top CMS Systems
 
Test Estimation using Test Case Point Analysis method
Test Estimation using Test Case Point Analysis methodTest Estimation using Test Case Point Analysis method
Test Estimation using Test Case Point Analysis method
 
Introducing Sitecore - The Experience Platform
Introducing Sitecore - The Experience PlatformIntroducing Sitecore - The Experience Platform
Introducing Sitecore - The Experience Platform
 
QA metrics in Agile (GUIDE)
QA metrics in Agile (GUIDE)QA metrics in Agile (GUIDE)
QA metrics in Agile (GUIDE)
 
Development Best Practices
Development Best PracticesDevelopment Best Practices
Development Best Practices
 
Testing capability ppt
Testing capability pptTesting capability ppt
Testing capability ppt
 
Test Data Management and Its Role in DevOps
Test Data Management and Its Role in DevOpsTest Data Management and Its Role in DevOps
Test Data Management and Its Role in DevOps
 
Event Driven Architecture (EDA) Reference Architecture
Event Driven Architecture (EDA) Reference ArchitectureEvent Driven Architecture (EDA) Reference Architecture
Event Driven Architecture (EDA) Reference Architecture
 
Introduction to Spring Cloud
Introduction to Spring Cloud           Introduction to Spring Cloud
Introduction to Spring Cloud
 
DevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with DynatraceDevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with Dynatrace
 
Power Platform Governance Center of Excellence
Power Platform Governance Center of ExcellencePower Platform Governance Center of Excellence
Power Platform Governance Center of Excellence
 
Elastic-Engineering
Elastic-EngineeringElastic-Engineering
Elastic-Engineering
 

Similar to Microservices. Test smarter, not harder. Voxxed Days 2019

Similar to Microservices. Test smarter, not harder. Voxxed Days 2019 (20)

Microservices: test smarter not harder (LAST Conference 2018)
Microservices: test smarter not harder (LAST Conference 2018)Microservices: test smarter not harder (LAST Conference 2018)
Microservices: test smarter not harder (LAST Conference 2018)
 
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd   seven years afterIan Cooper webinar for DDD Iran: Kent beck style tdd   seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
 
5 Steps to Detecting Issues Earlier in Your Release Cycles
 5 Steps to Detecting Issues Earlier in Your Release Cycles 5 Steps to Detecting Issues Earlier in Your Release Cycles
5 Steps to Detecting Issues Earlier in Your Release Cycles
 
Effective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentEffective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile Environment
 
BoSUSA23 | Chris Spiek & Justin Dickow | Autobooks Product & Engineering
BoSUSA23 | Chris Spiek & Justin Dickow | Autobooks Product & EngineeringBoSUSA23 | Chris Spiek & Justin Dickow | Autobooks Product & Engineering
BoSUSA23 | Chris Spiek & Justin Dickow | Autobooks Product & Engineering
 
Software quality - no more bugs!
Software quality - no more bugs!Software quality - no more bugs!
Software quality - no more bugs!
 
Protractor: Tips & Tricks
Protractor: Tips & TricksProtractor: Tips & Tricks
Protractor: Tips & Tricks
 
Indy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-muleIndy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-mule
 
Westrich spock-assets-gum
Westrich spock-assets-gumWestrich spock-assets-gum
Westrich spock-assets-gum
 
Delivering react app with confidence: Testing Pyramid
Delivering react app with confidence: Testing PyramidDelivering react app with confidence: Testing Pyramid
Delivering react app with confidence: Testing Pyramid
 
2019-01-8 - Consumer Driven Contracts at Codefreeze
2019-01-8 - Consumer Driven Contracts at Codefreeze2019-01-8 - Consumer Driven Contracts at Codefreeze
2019-01-8 - Consumer Driven Contracts at Codefreeze
 
Consumer driven contracts
Consumer driven contractsConsumer driven contracts
Consumer driven contracts
 
How to Better Manage Technical Debt While Innovating on DevOps
How to Better Manage Technical Debt While Innovating on DevOpsHow to Better Manage Technical Debt While Innovating on DevOps
How to Better Manage Technical Debt While Innovating on DevOps
 
Blockchain in enterprise - Challenges, Considerations and Designs
Blockchain in enterprise - Challenges, Considerations and DesignsBlockchain in enterprise - Challenges, Considerations and Designs
Blockchain in enterprise - Challenges, Considerations and Designs
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Magento Live 2014 Customer Expectation Presentation
Magento Live 2014 Customer Expectation PresentationMagento Live 2014 Customer Expectation Presentation
Magento Live 2014 Customer Expectation Presentation
 
Intro to TDD & BDD
Intro to TDD & BDDIntro to TDD & BDD
Intro to TDD & BDD
 
ITB2015 - Behavior Driven Development, Automation and Continuous Integration
ITB2015 - Behavior Driven Development, Automation and Continuous IntegrationITB2015 - Behavior Driven Development, Automation and Continuous Integration
ITB2015 - Behavior Driven Development, Automation and Continuous Integration
 
2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd
 
Pull requests do's and don'ts
Pull requests do's and don'tsPull requests do's and don'ts
Pull requests do's and don'ts
 

Recently uploaded

Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 

Recently uploaded (20)

TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 

Microservices. Test smarter, not harder. Voxxed Days 2019