SlideShare a Scribd company logo
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
Microservices Pain: Testing
Microservices Pain: Testing
Microservices Pain: Testing
Microservices Pain: Testing
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
Microservices Pain: Testing
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

PDF
Groovy Architectural Flexibility
PPTX
Introduction to TDD and Mocking
PDF
[教材] 例外處理設計與重構實作班201309
PPTX
Single Responsibility Principle @ Clean Code Alliance Meetup
ODP
Microservices Manchester: Testing Microservices: Pain or Opportunity? By Davi...
ODP
Microservices Past, Present, Future
ODP
DDD & Microservices from the Front Lines: Building Evolvable Software with Ev...
PDF
Mutation and Contract Testing
Groovy Architectural Flexibility
Introduction to TDD and Mocking
[教材] 例外處理設計與重構實作班201309
Single Responsibility Principle @ Clean Code Alliance Meetup
Microservices Manchester: Testing Microservices: Pain or Opportunity? By Davi...
Microservices Past, Present, Future
DDD & Microservices from the Front Lines: Building Evolvable Software with Ev...
Mutation and Contract Testing

Similar to Microservices Pain: Testing (20)

PDF
TDD CrashCourse Part2: TDD
PPTX
Using Boundary-Driven Development to beat code complexity
PPTX
.NET Architecture for Enterprises
PDF
Patterns for Open Source Success
PDF
A Framework for Open Source Software Success
PDF
Functional solid
KEY
Stuff About CQRS
PPTX
Microservices and Azure App Services
PDF
Sunny Tech 2019 - Craft Forever
PDF
Unit Testing like a Pro - The Circle of Purity
PDF
DSR microservices
PDF
Micro services Architecture with Vortex -- Part I
PPTX
Elastically scalable architectures with microservices. The end of the monolith?
PDF
DSR Microservices (Day 1, Part 1)
PDF
(automatic) Testing: from business to university and back
PPTX
Software Modeling and the Future of Engineering (ICMT/STAF Keynote at York)
PDF
TDD-and-Hexagonal-Architecture-in-Microservices-CraftHub.pdf
ODP
Desenvolvendo um Framework com TDD - Um Diário de Bordo - Agile Trends 2014
PDF
Microservices for the rest of us
PDF
Testing, Learning and Professionalism — 20171214
TDD CrashCourse Part2: TDD
Using Boundary-Driven Development to beat code complexity
.NET Architecture for Enterprises
Patterns for Open Source Success
A Framework for Open Source Software Success
Functional solid
Stuff About CQRS
Microservices and Azure App Services
Sunny Tech 2019 - Craft Forever
Unit Testing like a Pro - The Circle of Purity
DSR microservices
Micro services Architecture with Vortex -- Part I
Elastically scalable architectures with microservices. The end of the monolith?
DSR Microservices (Day 1, Part 1)
(automatic) Testing: from business to university and back
Software Modeling and the Future of Engineering (ICMT/STAF Keynote at York)
TDD-and-Hexagonal-Architecture-in-Microservices-CraftHub.pdf
Desenvolvendo um Framework com TDD - Um Diário de Bordo - Agile Trends 2014
Microservices for the rest of us
Testing, Learning and Professionalism — 20171214
Ad

More from David Dawson (8)

ODP
Reactive APIs using Muon: for muCon 2017
ODP
Reactive APIs using Muon
ODP
Reactive APIs using Muon
ODP
Practical Event Systems - Microservices for the Data Architect
ODP
Intro to Muon - How to build Polyglot Message and Event Microservices
ODP
Effective Microservices Design using Events and Event Sourcing
ODP
Assorted Learnings of Microservices
PDF
Hexagonal Architecture using Grails
Reactive APIs using Muon: for muCon 2017
Reactive APIs using Muon
Reactive APIs using Muon
Practical Event Systems - Microservices for the Data Architect
Intro to Muon - How to build Polyglot Message and Event Microservices
Effective Microservices Design using Events and Event Sourcing
Assorted Learnings of Microservices
Hexagonal Architecture using Grails
Ad

Recently uploaded (20)

PPTX
Patient Appointment Booking in Odoo with online payment
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
Cost to Outsource Software Development in 2025
PDF
Nekopoi APK 2025 free lastest update
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Patient Appointment Booking in Odoo with online payment
Design an Analysis of Algorithms I-SECS-1021-03
17 Powerful Integrations Your Next-Gen MLM Software Needs
Operating system designcfffgfgggggggvggggggggg
iTop VPN Free 5.6.0.5262 Crack latest version 2025
CHAPTER 2 - PM Management and IT Context
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
How to Choose the Right IT Partner for Your Business in Malaysia
Download FL Studio Crack Latest version 2025 ?
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
Complete Guide to Website Development in Malaysia for SMEs
Cost to Outsource Software Development in 2025
Nekopoi APK 2025 free lastest update
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf

Microservices Pain: Testing

Editor's Notes

  • #4: Isolation! Aspiration Evolution Ability to change
  • #6: Dan North Bounded/ Centred Community
  • #12: Not the solution! An approach to solving the problem. Tools to engage the world Sounds familiar.
  • #13: h
  • #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
  • #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: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #49: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #50: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #51: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #52: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #53: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #54: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #55: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #56: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #57: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #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: Ask the audience. One big one.
  • #78: Ask the audience. One big one.
  • #79: Ask the audience. One big one.
  • #80: Ask the audience. One big one.
  • #81: Ask the audience. One big one.
  • #82: Ask the audience. One big one.
  • #83: Ask the audience. One big one.
  • #84: Ask the audience. One big one.
  • #85: Ask the audience. One big one.
  • #86: Ask the audience. One big one.
  • #87: Isolate an algorithmic, functional piece. More suited to functional style, rather than encapsulated OO/ Entity style
  • #88: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #89: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #90: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #91: Some say XXX This is what we are going to discuss! Understand a man by walking in his shoes
  • #92: TALK TO MUNIB!