SlideShare a Scribd company logo
1 of 91
MicroservicesMicroservices
&&
PainPain
David Dawson
CEO GoMicro.Services
London Microservices User Group
Founder & Lead
david.dawson@gomicro.services
@davidthecoder
What are
Microservices?
Isolation
Aspiration
Microservice
Architecture?
What is
Architecture?
Architecture
vs
Design
Limitless Options
For Design
Only a few
Architectures
What is
Architecture?
Architecture
Is Philosophy
Microservices
Philosophy
All done?
What Pains
You?
Testing?
Testing
Microservices
Testing
Microservices
Testing
Aspiration &
Network Isolation
A brief history of
Testing
The Swamp
Of Manual
Testing
xUnit,
“Classical”
TDD
circa 1989..
Aka
Stateist
TDD
What does this
look like?
Code Under
Test
Dep
(Stub?)
Dep
(Stub?)
Code Under
Test
Dep
(Stub?)
Dep
(Stub?)
invoke
Code Under
Test
Dep
(Stub?)
Dep
(Stub?)
assert
correct
response
invoke
Code Under
Test
Dep
(Stub?)
Dep
(Stub?)
assert
correct
response
invoke
algorithmic
Circa 2008-10(ish)
London
School
of TDD
Aka
“Mockist”
TDD
What does this
look like?
Code Under
Test
Dep
(Mock)
Dep
(Mock)
Code Under
Test
Dep
(Mock)
Dep
(Mock)
invoke
Code Under
Test
Dep
(Mock)
Dep
(Mock)
assert
correct
interaction
invoke
Code Under
Test
Dep
(Mock)
Dep
(Mock)
assert
correct
interaction
invoke
communication
Microservices?
Microservice
Design?
Entity Oriented
Microservices
1 * GET /awesome
2 * POST /hello
1 * GET /awesome
2 * POST /hello
Start up Mock Dependencies
Start service under test
Exercise ServiceExercise Service
Verify Mock Interactions
1 * GET /awesome
2 * POST /hello
Client Libraries, then Mock
Pro
Simple, In Process
Con
Doesn't exercise the full
Stack
Protocol Replay
Pro
Simple, In Process
Con
Schema Drift
Not Really a Mock
https://github.com/ozeias/go-vcr
https://relishapp.com/vcr/vcr/docs
http://freeside.co/betamax/
Mock Processes
Pro
Full Stack
Con
Schema Drift
Hard to Orchestrate
The Network Hates You
Remote Control
Set Expectations
Verify Expectations
Making Mock (/ Stub)
Processes
Orchestrating
Docker
Compose
docker-compose.yml
rabbitmq:
image: rabbitmq:3.5.4-management
service-under-test:
build: .
links:
- rabbitmq
test-with-deps:
image: simplicityitself/test-with-deps
links:
- rabbitmq
volumes:
- ./test-results:/app/test-results/
Orchestrating
Docker
Compose
docker-compose.yml
rabbitmq:
image: rabbitmq:3.5.4-management
service-under-test:
build: .
links:
- rabbitmq
test-with-deps:
image: simplicityitself/test-with-deps
links:
- rabbitmq
volumes:
- ./test-results:/app/test-results/
Orchestrating
Docker
Compose
docker-compose.yml
rabbitmq:
image: rabbitmq:3.5.4-management
service-under-test:
build: .
links:
- rabbitmq
test-with-deps:
image: simplicityitself/test-with-deps
links:
- rabbitmq
volumes:
- ./test-results:/app/test-results/
Orchestrating
Docker
Compose
docker-compose.yml
rabbitmq:
image: rabbitmq:3.5.4-management
service-under-test:
build: .
links:
- rabbitmq
test-with-deps:
image: simplicityitself/test-with-deps
links:
- rabbitmq
volumes:
- ./test-results:/app/test-results/
Orchestrating
Docker
Compose
> docker-compose run test-with-deps
> docker-compose stop
> ls test-results/
xunit.xml
Microservice
Design?
Flow Oriented
Microservices
Events
Order Placed
Events
Order Placed
Payment Taken
Events
Order Placed
Payment Taken
Email Sent
Events
Order Stream
Notification Stream
Payment Stream
Events
Order Stream Events
Order Stream Events
Order Stream Events
Order Stream Events
Order Stream Events
Order Stream Events
An Entity
Order Stream Events
Order
Service
Order Stream Events
Order
Service
Fraud
Service
Order Stream Events
Order
Service
Fraud
Service
Fulfillment
Order Stream
Notification Stream
Payment Stream
Events
Order Stream
Notification Stream
Payment Stream
Order Stream
Notification Stream
Payment Stream
Order Stream
Notification Stream
Payment Stream
Order Stream
Notification Stream
Payment Stream
Order Placed
Payment Taken
Email Sent Email Sent
Dependencies
Dependencies
Order Placed
Payment Taken
Email Sent Email Sent
Dependencies
Order Placed
Order Creation Service
Payment Taken
Payment Processor
Email Sent
Email
Gateway
Email Sent
Email
Gateway
Order Placed
Payment Taken
Email Sent Email Sent
Testing
Order Placed
Testing
Order Placed
Payment Taken
Email Sent Email Sent
A TEST
Testing!
Order Placed
Email Sent
A TEST Mock Payment
Service?
Order Stream
Notification Stream
Payment Stream
Testing!
Order Placed
Payment Taken
Email Sent Email Sent
A TEST
Testing!
Order Placed
Payment Taken
Email Sent Email Sent
Set initial event chain state
Run service
Assert event chain end state
Event based test
Event Store
Event Chains (Graph DB is good)
Best for testing system state
mutation (commands)
Event based test
You'll need...
Classical
&
Mockist
For Microservices
Algorithmic
&
Interaction
For Microservices
David Dawson @davidthecoder
Thanks
david.dawson@gomicro.services

More Related Content

Similar to Microservices Pain: Testing

.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for Enterprises
Wade Wegner
 
Software Modeling and the Future of Engineering (ICMT/STAF Keynote at York)
 Software Modeling and the Future of Engineering (ICMT/STAF Keynote at York) Software Modeling and the Future of Engineering (ICMT/STAF Keynote at York)
Software Modeling and the Future of Engineering (ICMT/STAF Keynote at York)
Jean Bézivin
 
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard WorkTaming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Joseph Yoder
 

Similar to Microservices Pain: Testing (20)

TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDD
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for Enterprises
 
Patterns for Open Source Success
Patterns for Open Source SuccessPatterns for Open Source Success
Patterns for Open Source Success
 
A Framework for Open Source Software Success
A Framework for Open Source Software SuccessA Framework for Open Source Software Success
A Framework for Open Source Software Success
 
Functional solid
Functional solidFunctional solid
Functional solid
 
Stuff About CQRS
Stuff About CQRSStuff About CQRS
Stuff About CQRS
 
Microservices and Azure App Services
Microservices and Azure App ServicesMicroservices and Azure App Services
Microservices and Azure App Services
 
Sunny Tech 2019 - Craft Forever
Sunny Tech 2019 - Craft ForeverSunny Tech 2019 - Craft Forever
Sunny Tech 2019 - Craft Forever
 
Unit Testing like a Pro - The Circle of Purity
Unit Testing like a Pro - The Circle of PurityUnit Testing like a Pro - The Circle of Purity
Unit Testing like a Pro - The Circle of Purity
 
DSR microservices
DSR microservicesDSR microservices
DSR microservices
 
Micro services Architecture with Vortex -- Part I
Micro services Architecture with Vortex -- Part IMicro services Architecture with Vortex -- Part I
Micro services Architecture with Vortex -- Part I
 
Elastically scalable architectures with microservices. The end of the monolith?
Elastically scalable architectures with microservices. The end of the monolith?Elastically scalable architectures with microservices. The end of the monolith?
Elastically scalable architectures with microservices. The end of the monolith?
 
DSR Microservices (Day 1, Part 1)
DSR Microservices (Day 1, Part 1)DSR Microservices (Day 1, Part 1)
DSR Microservices (Day 1, Part 1)
 
(automatic) Testing: from business to university and back
(automatic) Testing: from business to university and back(automatic) Testing: from business to university and back
(automatic) Testing: from business to university and back
 
Software Modeling and the Future of Engineering (ICMT/STAF Keynote at York)
 Software Modeling and the Future of Engineering (ICMT/STAF Keynote at York) Software Modeling and the Future of Engineering (ICMT/STAF Keynote at York)
Software Modeling and the Future of Engineering (ICMT/STAF Keynote at York)
 
Desenvolvendo um Framework com TDD - Um Diário de Bordo - Agile Trends 2014
Desenvolvendo um Framework com TDD - Um Diário de Bordo - Agile Trends 2014Desenvolvendo um Framework com TDD - Um Diário de Bordo - Agile Trends 2014
Desenvolvendo um Framework com TDD - Um Diário de Bordo - Agile Trends 2014
 
Microservices for the rest of us
Microservices for the rest of usMicroservices for the rest of us
Microservices for the rest of us
 
Testing, Learning and Professionalism — 20171214
Testing, Learning and Professionalism — 20171214Testing, Learning and Professionalism — 20171214
Testing, Learning and Professionalism — 20171214
 
SQL Saturday 28 - .NET Fundamentals
SQL Saturday 28 - .NET FundamentalsSQL Saturday 28 - .NET Fundamentals
SQL Saturday 28 - .NET Fundamentals
 
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard WorkTaming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
 

More from David Dawson

More from David Dawson (8)

Reactive APIs using Muon: for muCon 2017
Reactive APIs using Muon: for muCon 2017Reactive APIs using Muon: for muCon 2017
Reactive APIs using Muon: for muCon 2017
 
Reactive APIs using Muon
Reactive APIs using MuonReactive APIs using Muon
Reactive APIs using Muon
 
Reactive APIs using Muon
Reactive APIs using MuonReactive APIs using Muon
Reactive APIs using Muon
 
Practical Event Systems - Microservices for the Data Architect
Practical Event Systems - Microservices for the Data ArchitectPractical Event Systems - Microservices for the Data Architect
Practical Event Systems - Microservices for the Data Architect
 
Intro to Muon - How to build Polyglot Message and Event Microservices
Intro to Muon - How to build Polyglot Message and Event MicroservicesIntro to Muon - How to build Polyglot Message and Event Microservices
Intro to Muon - How to build Polyglot Message and Event Microservices
 
Effective Microservices Design using Events and Event Sourcing
Effective Microservices Design using Events and Event SourcingEffective Microservices Design using Events and Event Sourcing
Effective Microservices Design using Events and Event Sourcing
 
Assorted Learnings of Microservices
Assorted Learnings of MicroservicesAssorted Learnings of Microservices
Assorted Learnings of Microservices
 
Hexagonal Architecture using Grails
Hexagonal Architecture using GrailsHexagonal Architecture using Grails
Hexagonal Architecture using Grails
 

Recently uploaded

Recently uploaded (20)

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
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
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
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
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
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
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
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...
 

Microservices Pain: Testing

Editor's Notes

  1. Isolation! Aspiration Evolution Ability to change
  2. Dan North Bounded/ Centred Community
  3. Not the solution! An approach to solving the problem. Tools to engage the world Sounds familiar.
  4. h
  5. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  6. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  7. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  8. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  9. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  10. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  11. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  12. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  13. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  14. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  15. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  16. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  17. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  18. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  19. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  20. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  21. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  22. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  23. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  24. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  25. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  26. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  27. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  28. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  29. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  30. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  31. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  32. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  33. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  34. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  35. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  36. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  37. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  38. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  39. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  40. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  41. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  42. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  43. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  44. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  45. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  46. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  47. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  48. Ask the audience. One big one.
  49. Ask the audience. One big one.
  50. Ask the audience. One big one.
  51. Ask the audience. One big one.
  52. Ask the audience. One big one.
  53. Ask the audience. One big one.
  54. Ask the audience. One big one.
  55. Ask the audience. One big one.
  56. Ask the audience. One big one.
  57. Ask the audience. One big one.
  58. Ask the audience. One big one.
  59. Ask the audience. One big one.
  60. Ask the audience. One big one.
  61. Ask the audience. One big one.
  62. Ask the audience. One big one.
  63. Ask the audience. One big one.
  64. Ask the audience. One big one.
  65. Ask the audience. One big one.
  66. Ask the audience. One big one.
  67. Ask the audience. One big one.
  68. Ask the audience. One big one.
  69. Ask the audience. One big one.
  70. Ask the audience. One big one.
  71. Ask the audience. One big one.
  72. Ask the audience. One big one.
  73. Ask the audience. One big one.
  74. Ask the audience. One big one.
  75. Ask the audience. One big one.
  76. Ask the audience. One big one.
  77. Isolate an algorithmic, functional piece. More suited to functional style, rather than encapsulated OO/ Entity style
  78. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  79. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  80. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  81. Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  82. TALK TO MUNIB!