SlideShare a Scribd company logo
1 of 102
Download to read offline
Serverless microservices
Matt Fellows
@matthewfellows
smarter
Test , not harder
2
The new uService
The New Microservice
3
The New Microservice > After
API
External
Events
API
Outside World
Microservice
Interface
API
Master Data
API
Inside bounded context
Event Emitters
API
Materialised view /
cache
Events and
Processing
Data
Event Handlers
Processing
Offline Processing
4
Provisioning
Amazon ML
The New Microservice > After > Example Team 1 Bounded Context
Place Order API
External
Events
Order Status API
Outside World
Internal Events
Microservice
Interface
Data, Events and
Processing
Suggestions API
Publish Event
to external
subscribers
Insights /
Predictions
Customer /
Other Event
Orders
Push API
Inside bounded context
CRM
Materialised view of
customer
Provisioning Event
External
Events
… API
5
Provisioning
The New Microservice > After > Example Team 1 Bounded Context
External
Events
Outside World
Internal Events
Microservice
Interface
Data, Events and
Processing
Publish Event
to external
subscribers
Insights /
Predictions
Place Order API
Customer /
Other Event
Orders
Inside bounded context
Materialised view of
customer
Provisioning Event
CRM
Marketing
Automation
Customer
Support
6
The New Microservice > After > IoT ExampleThe New Microservice > After > Example 2 > IoT Architecture
API Gateway
Sensor A
Sensor B
Sensor C
IoT Rule A
IoT Rule B
IoT Rule C
AWS IoT Core
Sensor Data A
Sensor Data C
Processed Events
Sensor A
Vendor
Device API
Real-time events
Sensor Data B
Analytics
Device Ingest Process Store
8
Testing The New Microservice
How do we test these?
9
Testing The New Microservice > Test Pyramid
https://martinfowler.com/bliki/TestPyramid.html
Testing The New Microservice > Test Pyramid
Mama-mia!
11
Testing The New Microservice > Test Pyramid > Ideal Software Testing Pyramid
https://watirmelon.blog/testing-pyramids/
Don’t forget people - the
ones doing the testing!
Let me make this a bit
clearer for you...
12
Testing The New Microservice > Test Pyramid > Software Testing Trophy
https://kentcdodds.com/blog/write-tests
13
Testing The New Microservice > Test Pyramid > Testing Funnel?
https://medium.com/@copyconstruct/testing-microservices-the-sane-way-9bb31d158c16
14
Testing The New Microservice > Test Pyramid > Round Earth Heuristic
https://www.satisfice.com/blog/archives/4947
Today’s focus
Architecture > Microservices
1. Testability
2. Reduce need for UI / end-to-end testing
3. Observability
Testability
17
Structure
Testability
18
Testability > Lambda Pattern > Ports and Adaptors > Example
Order
Provisioning
Orders CRM
Orders
Testability > Lambda Anti-pattern > Example
MQ Handler
WebSocket
handler
Azure Function
Handler
Google Cloud Fn
Handler
Lambda
Handler
Service
Repository
Port
Adapter
Business Logic Domain Model Collaborators
Testability > Lambda Pattern > Ports and Adaptors
...
Test Harness
Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
Summary
● Separate protocol handling from
business logic
● Business logic shouldn’t change with
introduction of a new protocol
● Enables testability - Port, Adapter and
Business Logic are independently
testable
Testability > Lambda Pattern > Ports and Adaptors > Summary
WHAT WE ARE KNOWN FORTestability > Modularisation
Adapted from https://martinfowler.com/articles/microservice-testing
Adapters
Services
Domain
Repositories
Collaborators
External
Service
Test
modularity
30
How do you test locally?
Testability
WHAT WE ARE KNOWN FOR
31
Options
Testability > Testing Locally
● Use real services
● Stub services (e.g. Localstack)
● Stub SDK (e.g. Moto)
● Local Unit, Integration +
Component tests
32
Testability > Testing Locally
WHAT WE ARE KNOWN FOR
33
Options
● Feature arms race
● Trustworthy?
● Integrated = slower / harder
● All cloud providers?
● Point at the real services
● Stub services (e.g. Localstack)
● Stub SDK (e.g. Moto)
● Local Unit, Integration +
Component tests
Testability > Testing Locally
Challenges
34
Local Integration Test
Testability > Testing Locally
WHAT WE ARE KNOWN FORTestability > Testing Locally
Show me
where?
Adapters
Domain
Repositories
Collaborators
mock
Services
Testability > Testing Locally > Integration Test > Order Service
Look ma, no AWS
Code
Testability > Testing Locally > Integration Test > Order Service
Dependencies
injected
Testability > Testing Locally > Integration Test > Order Service
Look ma, no AWS
Code
Testability > Testing Locally > Integration Test > Order Service
Setup dependencies as
simple interface fakes
Testability > Testing Locally > Integration Test > Order Service
Run the unit under
test
Testability > Testing Locally > Integration Test > Order Service
Assert
42
Local Component Test
Testability > Testing Locally
WHAT WE ARE KNOWN FORTestability > Testing Locally > Component Test > Order Provisioning Service
Show me
where?
Adapters
Services
Domain
Repositories
Collaborators
mock
In-memory database
Testability > Testing Locally > Component Test > Order Provisioning Service
Component test of
handler
Setup dependencies,
inputs and expected
output
Testability > Testing Locally > Component Test > Order Provisioning Service
Testability > Testing Locally > Component Test > Order Provisioning Service
Invoke handler with
kinesis-shaped input
Testability > Testing Locally > Component Test > Order Provisioning Service
Assert the handler
response
Reduce # of e2e tests
Challenges
Integration
● More “white space” - integrations
● Async
○ who is my consumer?
○ delay in feedback
● Third Parties
50
Contract tests
Integration > Contract Tests
Problems with
automated e2e
tests
Integration > Contract Tests > Contracts
● Slow
● Easy to break
● Hard to fix
● Scales badly across teams
● Lots of set up  maintenance
● $$ potentially costly
Integration > Contract Tests > Contracts
Mocks to the rescue?
Integration > Contract Tests > Contracts
Mocks to the rescue?
WHAT WE ARE KNOWN FOR
54
Mocks
Solved problems New problems
● Hard to keep both sides in
sync
● Fast feedback
● Few dependencies
● No dedicated environment
● Reliable
● Easy to debug
Integration > Contract Tests > Contracts
55
Contract
{
“id”: 1234,
“items”:[
...
],
}
Consumer
Provider
Integration > Contract Tests > Contracts
Order API
GET /orders/1234
56
Provisioning
Amazon ML
Integration > Contract Tests > Contracts
Place Order API
External
Events
Order Status API
Outside World
Internal Events
Microservice
Interface
Data, Events and
Processing
Suggestions API
Publish Event
to external
subscribers
Insights /
Predictions
Customer /
Other Event
Orders
Push API
Inside bounded context
CRM
Materialised view of
customer
Provisioning Event
External
Events
… API
57
Provisioning
Amazon ML
Integration > Contract Tests > Contracts Everywhere!
Place Order API
External
Events
Order Status API
Outside World
Internal Events
Microservice
Interface
Data, Events and
Processing
Suggestions API
Publish Event
to external
subscribers
Insights /
Predictions
Customer /
Other Event
Orders
Push API
Inside bounded context
CRM
Materialised view of
customer
Provisioning Event
External
Events
… API
Contract
Contract
Contract
Contract
Contract
Contract
Contract
Contract
Integration > Contract Tests > Contracts
Integration > Contract Tests > Contracts
Mock
Integration > Contract Tests > Contracts
Mock
GET /orders/1234
Integration > Contract Tests > Contracts
Mock
{
“id”: 1234,
“items”:[
...
],
}
GET /orders/1234
Integration > Contract Tests > Contracts
Mock
Integration > Contract Tests > Contracts
Mock
GET /orders/1234
Integration > Contract Tests > Contracts
Mock
{
“id”: 1234,
“items”:[
...
],
}
GET /orders/1234
Integration > Contract Tests > Contracts
Mock ✔
WHAT WE ARE KNOWN FORTestability > Modularisation > Consumer Test
Adapted from https://martinfowler.com/articles/microservice-testing
Adapters
Services
Domain
Repositories
Collaborators
External
Service
Show me
where?
WHAT WE ARE KNOWN FORTestability > Modularisation > Provider Test
Adapted from https://martinfowler.com/articles/microservice-testing
Show me
where?
Adapters
Services
Domain
Repositories
Collaborators
mock
In-memory database
68
Integration > Contract Tests > Contracts
https://martinfowler.com/bliki/TestPyramid.html
Contract
Show me
where?
Bug turnaround -
minutes
Contracts tests
Integration > Contract Tests > Contracts
Know before you
commit
Contracts tests
Integration > Contract Tests > Contracts
Make changes with
speed and confidence
Contracts tests
Integration > Contract Tests > Contracts
Deploy independently
Contracts tests
Integration > Contract Tests > Contracts
Better API design
(Consumer)
Contracts tests
Integration > Contract Tests > Contracts
74
● Open source
● Multiple languages
○ Javascript
○ Go
○ Python
○ JVM
○ .NET
○ + more
pact.io
● HTTP contracts
● Message contracts
● … protocol agnostic!
Integration > Contract Tests > Contracts
75
Contract
{
“id”: 1234,
“items”:[
...
],
}
Consumer
Provider
Integration > Contract Tests > Consumer Contract Test
Order API
GET /orders/1234
Integration > Contract Tests > Contracts > Fetch Order Example
Setup API Host
Integration > Contract Tests > Contracts > Fetch Order Example
Expectations on
Order API made clear
Integration > Contract Tests > Contracts > Fetch Order Example
Expectations on
Order API made clear
Integration > Contract Tests > Contracts > Fetch Order Example
Call the OrderService
+ Assert
Integration > Contract Tests > Contracts > Fetch Order Example
Test state setup
Integration > Contract Tests > Contracts > Fetch Order Example
Test state setup
● Contract tests are faster, easier to
maintain and more reliable than e2e
tests
● Works for both synchronous and async
communication
● Use contract tests to reduce your
end-to-end test reliance
● End-to-end tests closer represent the
user experience
● Contract testing doesn’t replace
functional testing!
Summary
Integration > Contract Tests
Observe the Platform
84
Push responsibility into Platform
Observability
85
Push responsibility into Platform
Observability
86
#1 Log all the things!
Observability
87
#2 Use Middleware
Observability
Handler
Observability > Approach #2 > Middleware
{
"Records": [
{
"EventVersion": "1.0",
"EventSubscriptionArn": "somearn",
"EventSource": "aws:sns",
"Sns": {
...
}
}
]
}
{
"Success": true
}
HandlerHandlerHandler
before after
Request Response
1st middleware
2nd middleware
3rd middleware
Observability > Approach #2 > Middleware
Observability > Approach #2 > Middleware
Observability > Approach #2 > Middleware
92
#3 Push responsibility into Platform
Observability
93
Observability > Approach #1 > IT Ops Automation
Decide
Alarm
Schedule
Notify Pagerduty
Act
Isolate instance from
ASG
Offsite backup
Ship logs to Splunk
Orient
Security Analysis
Application Anomaly /
Canary Detection
Log forwarder
Policy Violation
Observe
Flow Logs
CloudTrail
CloudWatch Logs
Application Event
Configured Rule
Event
subscription
94
Observability > Approach #1 > IT Ops Automation
Decide
Alarm
Act
Ship logs to Splunk
Orient
Log forwarder
Observe
CloudWatch Logs
Event
subscription
WHAT WE ARE KNOWN FOR
95
Examples
● Automatically subscribe log groups and forward to ___
● Allow dynamic DEBUG monitoring (runtime sampling)
● Enable platform tracing (e.g. X-ray, IOPipe, Dashbird)
● Automatically inject correlation IDs
● Anomaly detection
Observability > Approach #1 > IT Ops Automation
● Invest in platform
● Structured + semantic logging is crucial
● Middleware to simplify and template out
specific shaped functions
Summary
Observability > Summary
Wrap it up
Summary
98
Summary
Problems
● Microservices + architecture has evolved
● ...and so must the pyramid!
● More diverse integrations
● More glue, cloud-native code
We’re all digital plumbers!
● Use Ports + Adapters (Hexagonal
architecture) to increase modularity
● Enable better testability and test
modularity
● Mock SDK for local tests
● Component tests can help to reduce
need for e2e tests
There is no single test strategy that will
work for all cases!
Structure...
Summary > Structure
● Contract tests are faster and more
reliable than E2E tests
● Use them to reduce your E2E footprint
● Contract tests enable independent
deployment
● They are not functional tests
Never forget forget the end user!
Reduce E2E...
Summary > Reduce reliance on E2E
● Is the property of understanding a
system as illuminated by its outputs
● Allows us to ask questions
● Helps us discover and respond to
unknown, unknowns
It’s not monitoring, but there is significant
implementation overlap.
Observability...
Summary > Observability
Matt Fellows
@matthewfellows
Serverless microservices
smarter
Pact
@pact_up
@pactflow
slack.pact.io
Test , not harder

More Related Content

What's hot

Designing High Availability for HashiCorp Vault in AWS
Designing High Availability for HashiCorp Vault in AWSDesigning High Availability for HashiCorp Vault in AWS
Designing High Availability for HashiCorp Vault in AWS☁ Bryan Krausen
 
Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s ClustersDeploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s ClustersSyah Dwi Prihatmoko
 
Automated Governance for the DevOps Institutions.pdf
Automated Governance for the DevOps Institutions.pdfAutomated Governance for the DevOps Institutions.pdf
Automated Governance for the DevOps Institutions.pdfVishwas N
 
Application Monitoring using Open Source: VictoriaMetrics - ClickHouse
Application Monitoring using Open Source: VictoriaMetrics - ClickHouseApplication Monitoring using Open Source: VictoriaMetrics - ClickHouse
Application Monitoring using Open Source: VictoriaMetrics - ClickHouseVictoriaMetrics
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesAmazon Web Services
 
What's new in API Connect and DataPower - 2019
What's new in API Connect and DataPower - 2019What's new in API Connect and DataPower - 2019
What's new in API Connect and DataPower - 2019IBM DataPower Gateway
 
Domain Driven Design và Event Driven Architecture
Domain Driven Design và Event Driven Architecture Domain Driven Design và Event Driven Architecture
Domain Driven Design và Event Driven Architecture IT Expert Club
 
Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsJulian Mazzitelli
 
Jenkins vs GitLab CI
Jenkins vs GitLab CIJenkins vs GitLab CI
Jenkins vs GitLab CICEE-SEC(R)
 
Kinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vnKinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vnDotnet Open Group
 
Mastering kubernetes ingress nginx
Mastering kubernetes ingress  nginxMastering kubernetes ingress  nginx
Mastering kubernetes ingress nginxSidhartha Mani
 
Securing your API Portfolio with API Management
Securing your API Portfolio with API ManagementSecuring your API Portfolio with API Management
Securing your API Portfolio with API ManagementCA Technologies
 
Opentelemetry - From frontend to backend
Opentelemetry - From frontend to backendOpentelemetry - From frontend to backend
Opentelemetry - From frontend to backendSebastian Poxhofer
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderSadayuki Furuhashi
 

What's hot (20)

Designing High Availability for HashiCorp Vault in AWS
Designing High Availability for HashiCorp Vault in AWSDesigning High Availability for HashiCorp Vault in AWS
Designing High Availability for HashiCorp Vault in AWS
 
Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s ClustersDeploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
 
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucketIntro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
 
Automated Governance for the DevOps Institutions.pdf
Automated Governance for the DevOps Institutions.pdfAutomated Governance for the DevOps Institutions.pdf
Automated Governance for the DevOps Institutions.pdf
 
Application Monitoring using Open Source: VictoriaMetrics - ClickHouse
Application Monitoring using Open Source: VictoriaMetrics - ClickHouseApplication Monitoring using Open Source: VictoriaMetrics - ClickHouse
Application Monitoring using Open Source: VictoriaMetrics - ClickHouse
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation Slides
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
What's new in API Connect and DataPower - 2019
What's new in API Connect and DataPower - 2019What's new in API Connect and DataPower - 2019
What's new in API Connect and DataPower - 2019
 
Domain Driven Design và Event Driven Architecture
Domain Driven Design và Event Driven Architecture Domain Driven Design và Event Driven Architecture
Domain Driven Design và Event Driven Architecture
 
Rethinking Cloud Proxies
Rethinking Cloud ProxiesRethinking Cloud Proxies
Rethinking Cloud Proxies
 
Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd products
 
DevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -SecurityDevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -Security
 
Gitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCDGitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCD
 
Jenkins vs GitLab CI
Jenkins vs GitLab CIJenkins vs GitLab CI
Jenkins vs GitLab CI
 
Kinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vnKinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vn
 
Mastering kubernetes ingress nginx
Mastering kubernetes ingress  nginxMastering kubernetes ingress  nginx
Mastering kubernetes ingress nginx
 
Securing your API Portfolio with API Management
Securing your API Portfolio with API ManagementSecuring your API Portfolio with API Management
Securing your API Portfolio with API Management
 
Opentelemetry - From frontend to backend
Opentelemetry - From frontend to backendOpentelemetry - From frontend to backend
Opentelemetry - From frontend to backend
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loader
 
BitBucket presentation
BitBucket presentationBitBucket presentation
BitBucket presentation
 

Similar to Serverless microservices: Test smarter, not harder

Deploying large-scale, serverless and asynchronous systems - without integrat...
Deploying large-scale, serverless and asynchronous systems - without integrat...Deploying large-scale, serverless and asynchronous systems - without integrat...
Deploying large-scale, serverless and asynchronous systems - without integrat...DiUS
 
Trends and development practices in Serverless architectures
Trends and development practices in Serverless architecturesTrends and development practices in Serverless architectures
Trends and development practices in Serverless architecturesDiUS
 
Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...
Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...
Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...Chris Richardson
 
Contract testing | Евгений Кузьмин | CODEiD
Contract testing | Евгений Кузьмин | CODEiDContract testing | Евгений Кузьмин | CODEiD
Contract testing | Евгений Кузьмин | CODEiDCODEiD PHP Community
 
Acceptance Test Driven Development at StarWest 2014
Acceptance Test Driven Development at StarWest 2014Acceptance Test Driven Development at StarWest 2014
Acceptance Test Driven Development at StarWest 2014jaredrrichardson
 
SIPfoundry CoLab 2013 - Web Contact Center
SIPfoundry CoLab 2013 - Web Contact CenterSIPfoundry CoLab 2013 - Web Contact Center
SIPfoundry CoLab 2013 - Web Contact CenterSIPfoundry
 
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...Evgeniy Kuzmin
 
Complex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWSComplex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWSBoyan Dimitrov
 
Testing microservices
Testing microservicesTesting microservices
Testing microservicesAnik Kale
 
Trusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy ModelTrusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy ModelAtlassian
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing MicroservicesNagarro
 
Testing strategies for micro services - Ketan Soni, Jesal Mistry, ThoughtWorks
Testing strategies for micro services - Ketan Soni, Jesal Mistry, ThoughtWorksTesting strategies for micro services - Ketan Soni, Jesal Mistry, ThoughtWorks
Testing strategies for micro services - Ketan Soni, Jesal Mistry, ThoughtWorksThoughtworks
 
Using Service Discovery and Service Proxy
Using Service Discovery and Service ProxyUsing Service Discovery and Service Proxy
Using Service Discovery and Service ProxyIBM
 
Complex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWSComplex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWSBoyan Dimitrov
 
Delivering High Performance Ecommerce with Magento Commerce Cloud
Delivering High Performance Ecommerce with Magento Commerce CloudDelivering High Performance Ecommerce with Magento Commerce Cloud
Delivering High Performance Ecommerce with Magento Commerce CloudGuncha Pental
 
Advanced Controls access and user security for superusers con8824
Advanced Controls access and user security for superusers con8824Advanced Controls access and user security for superusers con8824
Advanced Controls access and user security for superusers con8824Oracle
 
the grinder testing certification
the grinder testing certificationthe grinder testing certification
the grinder testing certificationVskills
 
Grand tour of Azure API Management.pdf
Grand tour of Azure API Management.pdfGrand tour of Azure API Management.pdf
Grand tour of Azure API Management.pdfSherman37
 

Similar to Serverless microservices: Test smarter, not harder (20)

Deploying large-scale, serverless and asynchronous systems - without integrat...
Deploying large-scale, serverless and asynchronous systems - without integrat...Deploying large-scale, serverless and asynchronous systems - without integrat...
Deploying large-scale, serverless and asynchronous systems - without integrat...
 
Trends and development practices in Serverless architectures
Trends and development practices in Serverless architecturesTrends and development practices in Serverless architectures
Trends and development practices in Serverless architectures
 
Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...
Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...
Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...
 
Contract testing | Евгений Кузьмин | CODEiD
Contract testing | Евгений Кузьмин | CODEiDContract testing | Евгений Кузьмин | CODEiD
Contract testing | Евгений Кузьмин | CODEiD
 
Acceptance Test Driven Development at StarWest 2014
Acceptance Test Driven Development at StarWest 2014Acceptance Test Driven Development at StarWest 2014
Acceptance Test Driven Development at StarWest 2014
 
SIPfoundry CoLab 2013 - Web Contact Center
SIPfoundry CoLab 2013 - Web Contact CenterSIPfoundry CoLab 2013 - Web Contact Center
SIPfoundry CoLab 2013 - Web Contact Center
 
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
 
Complex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWSComplex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWS
 
Contract based testing
Contract based testingContract based testing
Contract based testing
 
Testing microservices
Testing microservicesTesting microservices
Testing microservices
 
Trusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy ModelTrusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy Model
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing Microservices
 
MSB Deep Dive
MSB Deep DiveMSB Deep Dive
MSB Deep Dive
 
Testing strategies for micro services - Ketan Soni, Jesal Mistry, ThoughtWorks
Testing strategies for micro services - Ketan Soni, Jesal Mistry, ThoughtWorksTesting strategies for micro services - Ketan Soni, Jesal Mistry, ThoughtWorks
Testing strategies for micro services - Ketan Soni, Jesal Mistry, ThoughtWorks
 
Using Service Discovery and Service Proxy
Using Service Discovery and Service ProxyUsing Service Discovery and Service Proxy
Using Service Discovery and Service Proxy
 
Complex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWSComplex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWS
 
Delivering High Performance Ecommerce with Magento Commerce Cloud
Delivering High Performance Ecommerce with Magento Commerce CloudDelivering High Performance Ecommerce with Magento Commerce Cloud
Delivering High Performance Ecommerce with Magento Commerce Cloud
 
Advanced Controls access and user security for superusers con8824
Advanced Controls access and user security for superusers con8824Advanced Controls access and user security for superusers con8824
Advanced Controls access and user security for superusers con8824
 
the grinder testing certification
the grinder testing certificationthe grinder testing certification
the grinder testing certification
 
Grand tour of Azure API Management.pdf
Grand tour of Azure API Management.pdfGrand tour of Azure API Management.pdf
Grand tour of Azure API Management.pdf
 

More from DiUS

Lunch and Learn: You have the data, now what?
Lunch and Learn: You have the data, now what?Lunch and Learn: You have the data, now what?
Lunch and Learn: You have the data, now what?DiUS
 
How to build confidence in your release cycle
How to build confidence in your release cycleHow to build confidence in your release cycle
How to build confidence in your release cycleDiUS
 
Test Smart, not hard
Test Smart, not hardTest Smart, not hard
Test Smart, not hardDiUS
 
10 things-to-inspire-in-10-mins
10 things-to-inspire-in-10-mins10 things-to-inspire-in-10-mins
10 things-to-inspire-in-10-minsDiUS
 
The Diversity Dilemma - Supporting our Sisters in STEM
The Diversity Dilemma - Supporting our Sisters in STEMThe Diversity Dilemma - Supporting our Sisters in STEM
The Diversity Dilemma - Supporting our Sisters in STEMDiUS
 
GameDay - Achieving resilience through Chaos Engineering
GameDay - Achieving resilience through Chaos EngineeringGameDay - Achieving resilience through Chaos Engineering
GameDay - Achieving resilience through Chaos EngineeringDiUS
 
The case for consumer-driven contracts
The case for consumer-driven contractsThe case for consumer-driven contracts
The case for consumer-driven contractsDiUS
 
Deploy with Confidence using Pact Go!
Deploy with Confidence using Pact Go!Deploy with Confidence using Pact Go!
Deploy with Confidence using Pact Go!DiUS
 
Crafting Quality Software
Crafting Quality SoftwareCrafting Quality Software
Crafting Quality SoftwareDiUS
 
Metrics on the front, data in the back
Metrics on the front, data in the backMetrics on the front, data in the back
Metrics on the front, data in the backDiUS
 
Antifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failureAntifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failureDiUS
 
DIY IoT Backend
DIY IoT BackendDIY IoT Backend
DIY IoT BackendDiUS
 
How to Build Hardware Lean
How to Build Hardware LeanHow to Build Hardware Lean
How to Build Hardware LeanDiUS
 
Behaviour Change and Coaching: What we can learn from BJ Fogg
Behaviour Change and Coaching: What we can learn from BJ FoggBehaviour Change and Coaching: What we can learn from BJ Fogg
Behaviour Change and Coaching: What we can learn from BJ FoggDiUS
 
Power in Agile Teams
Power in Agile Teams Power in Agile Teams
Power in Agile Teams DiUS
 
The Diversity Dilemma: Attracting and Retaining Talented Women in Technology-...
The Diversity Dilemma: Attracting and Retaining Talented Women in Technology-...The Diversity Dilemma: Attracting and Retaining Talented Women in Technology-...
The Diversity Dilemma: Attracting and Retaining Talented Women in Technology-...DiUS
 
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary SlidesRise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary SlidesDiUS
 
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...DiUS
 
Agile Australia 2014 | A light saber for your disruptive tool belt: the Busin...
Agile Australia 2014 | A light saber for your disruptive tool belt: the Busin...Agile Australia 2014 | A light saber for your disruptive tool belt: the Busin...
Agile Australia 2014 | A light saber for your disruptive tool belt: the Busin...DiUS
 
Agile Australia 2014 | UX: How to measure more than a gut feel by Amir Ansari
Agile Australia 2014 | UX: How to measure more than a gut feel by Amir AnsariAgile Australia 2014 | UX: How to measure more than a gut feel by Amir Ansari
Agile Australia 2014 | UX: How to measure more than a gut feel by Amir AnsariDiUS
 

More from DiUS (20)

Lunch and Learn: You have the data, now what?
Lunch and Learn: You have the data, now what?Lunch and Learn: You have the data, now what?
Lunch and Learn: You have the data, now what?
 
How to build confidence in your release cycle
How to build confidence in your release cycleHow to build confidence in your release cycle
How to build confidence in your release cycle
 
Test Smart, not hard
Test Smart, not hardTest Smart, not hard
Test Smart, not hard
 
10 things-to-inspire-in-10-mins
10 things-to-inspire-in-10-mins10 things-to-inspire-in-10-mins
10 things-to-inspire-in-10-mins
 
The Diversity Dilemma - Supporting our Sisters in STEM
The Diversity Dilemma - Supporting our Sisters in STEMThe Diversity Dilemma - Supporting our Sisters in STEM
The Diversity Dilemma - Supporting our Sisters in STEM
 
GameDay - Achieving resilience through Chaos Engineering
GameDay - Achieving resilience through Chaos EngineeringGameDay - Achieving resilience through Chaos Engineering
GameDay - Achieving resilience through Chaos Engineering
 
The case for consumer-driven contracts
The case for consumer-driven contractsThe case for consumer-driven contracts
The case for consumer-driven contracts
 
Deploy with Confidence using Pact Go!
Deploy with Confidence using Pact Go!Deploy with Confidence using Pact Go!
Deploy with Confidence using Pact Go!
 
Crafting Quality Software
Crafting Quality SoftwareCrafting Quality Software
Crafting Quality Software
 
Metrics on the front, data in the back
Metrics on the front, data in the backMetrics on the front, data in the back
Metrics on the front, data in the back
 
Antifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failureAntifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failure
 
DIY IoT Backend
DIY IoT BackendDIY IoT Backend
DIY IoT Backend
 
How to Build Hardware Lean
How to Build Hardware LeanHow to Build Hardware Lean
How to Build Hardware Lean
 
Behaviour Change and Coaching: What we can learn from BJ Fogg
Behaviour Change and Coaching: What we can learn from BJ FoggBehaviour Change and Coaching: What we can learn from BJ Fogg
Behaviour Change and Coaching: What we can learn from BJ Fogg
 
Power in Agile Teams
Power in Agile Teams Power in Agile Teams
Power in Agile Teams
 
The Diversity Dilemma: Attracting and Retaining Talented Women in Technology-...
The Diversity Dilemma: Attracting and Retaining Talented Women in Technology-...The Diversity Dilemma: Attracting and Retaining Talented Women in Technology-...
The Diversity Dilemma: Attracting and Retaining Talented Women in Technology-...
 
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary SlidesRise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
 
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...
AWS Summit Melbourne 2014 | The Path to Business Agility for Vodafone: How Am...
 
Agile Australia 2014 | A light saber for your disruptive tool belt: the Busin...
Agile Australia 2014 | A light saber for your disruptive tool belt: the Busin...Agile Australia 2014 | A light saber for your disruptive tool belt: the Busin...
Agile Australia 2014 | A light saber for your disruptive tool belt: the Busin...
 
Agile Australia 2014 | UX: How to measure more than a gut feel by Amir Ansari
Agile Australia 2014 | UX: How to measure more than a gut feel by Amir AnsariAgile Australia 2014 | UX: How to measure more than a gut feel by Amir Ansari
Agile Australia 2014 | UX: How to measure more than a gut feel by Amir Ansari
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Serverless microservices: Test smarter, not harder

  • 2. 2 The new uService The New Microservice
  • 3. 3 The New Microservice > After API External Events API Outside World Microservice Interface API Master Data API Inside bounded context Event Emitters API Materialised view / cache Events and Processing Data Event Handlers Processing Offline Processing
  • 4. 4 Provisioning Amazon ML The New Microservice > After > Example Team 1 Bounded Context Place Order API External Events Order Status API Outside World Internal Events Microservice Interface Data, Events and Processing Suggestions API Publish Event to external subscribers Insights / Predictions Customer / Other Event Orders Push API Inside bounded context CRM Materialised view of customer Provisioning Event External Events … API
  • 5. 5 Provisioning The New Microservice > After > Example Team 1 Bounded Context External Events Outside World Internal Events Microservice Interface Data, Events and Processing Publish Event to external subscribers Insights / Predictions Place Order API Customer / Other Event Orders Inside bounded context Materialised view of customer Provisioning Event CRM Marketing Automation Customer Support
  • 6. 6 The New Microservice > After > IoT ExampleThe New Microservice > After > Example 2 > IoT Architecture API Gateway Sensor A Sensor B Sensor C IoT Rule A IoT Rule B IoT Rule C AWS IoT Core Sensor Data A Sensor Data C Processed Events Sensor A Vendor Device API Real-time events Sensor Data B Analytics Device Ingest Process Store
  • 7.
  • 8. 8 Testing The New Microservice How do we test these?
  • 9. 9 Testing The New Microservice > Test Pyramid https://martinfowler.com/bliki/TestPyramid.html
  • 10. Testing The New Microservice > Test Pyramid Mama-mia!
  • 11. 11 Testing The New Microservice > Test Pyramid > Ideal Software Testing Pyramid https://watirmelon.blog/testing-pyramids/ Don’t forget people - the ones doing the testing! Let me make this a bit clearer for you...
  • 12. 12 Testing The New Microservice > Test Pyramid > Software Testing Trophy https://kentcdodds.com/blog/write-tests
  • 13. 13 Testing The New Microservice > Test Pyramid > Testing Funnel? https://medium.com/@copyconstruct/testing-microservices-the-sane-way-9bb31d158c16
  • 14. 14 Testing The New Microservice > Test Pyramid > Round Earth Heuristic https://www.satisfice.com/blog/archives/4947
  • 15. Today’s focus Architecture > Microservices 1. Testability 2. Reduce need for UI / end-to-end testing 3. Observability
  • 18. 18 Testability > Lambda Pattern > Ports and Adaptors > Example Order Provisioning Orders CRM Orders
  • 19. Testability > Lambda Anti-pattern > Example
  • 20. MQ Handler WebSocket handler Azure Function Handler Google Cloud Fn Handler Lambda Handler Service Repository Port Adapter Business Logic Domain Model Collaborators Testability > Lambda Pattern > Ports and Adaptors ... Test Harness
  • 21. Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
  • 22. Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
  • 23. Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
  • 24. Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
  • 25. Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
  • 26. Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
  • 27. Testability > Lambda Pattern > Ports and Adaptors > Lambda Adapter
  • 28. Summary ● Separate protocol handling from business logic ● Business logic shouldn’t change with introduction of a new protocol ● Enables testability - Port, Adapter and Business Logic are independently testable Testability > Lambda Pattern > Ports and Adaptors > Summary
  • 29. WHAT WE ARE KNOWN FORTestability > Modularisation Adapted from https://martinfowler.com/articles/microservice-testing Adapters Services Domain Repositories Collaborators External Service Test modularity
  • 30. 30 How do you test locally? Testability
  • 31. WHAT WE ARE KNOWN FOR 31 Options Testability > Testing Locally ● Use real services ● Stub services (e.g. Localstack) ● Stub SDK (e.g. Moto) ● Local Unit, Integration + Component tests
  • 33. WHAT WE ARE KNOWN FOR 33 Options ● Feature arms race ● Trustworthy? ● Integrated = slower / harder ● All cloud providers? ● Point at the real services ● Stub services (e.g. Localstack) ● Stub SDK (e.g. Moto) ● Local Unit, Integration + Component tests Testability > Testing Locally Challenges
  • 35. WHAT WE ARE KNOWN FORTestability > Testing Locally Show me where? Adapters Domain Repositories Collaborators mock Services
  • 36. Testability > Testing Locally > Integration Test > Order Service Look ma, no AWS Code
  • 37. Testability > Testing Locally > Integration Test > Order Service Dependencies injected
  • 38. Testability > Testing Locally > Integration Test > Order Service Look ma, no AWS Code
  • 39. Testability > Testing Locally > Integration Test > Order Service Setup dependencies as simple interface fakes
  • 40. Testability > Testing Locally > Integration Test > Order Service Run the unit under test
  • 41. Testability > Testing Locally > Integration Test > Order Service Assert
  • 43. WHAT WE ARE KNOWN FORTestability > Testing Locally > Component Test > Order Provisioning Service Show me where? Adapters Services Domain Repositories Collaborators mock In-memory database
  • 44. Testability > Testing Locally > Component Test > Order Provisioning Service Component test of handler
  • 45. Setup dependencies, inputs and expected output Testability > Testing Locally > Component Test > Order Provisioning Service
  • 46. Testability > Testing Locally > Component Test > Order Provisioning Service Invoke handler with kinesis-shaped input
  • 47. Testability > Testing Locally > Component Test > Order Provisioning Service Assert the handler response
  • 48. Reduce # of e2e tests
  • 49. Challenges Integration ● More “white space” - integrations ● Async ○ who is my consumer? ○ delay in feedback ● Third Parties
  • 51. Problems with automated e2e tests Integration > Contract Tests > Contracts ● Slow ● Easy to break ● Hard to fix ● Scales badly across teams ● Lots of set up maintenance ● $$ potentially costly
  • 52. Integration > Contract Tests > Contracts Mocks to the rescue?
  • 53. Integration > Contract Tests > Contracts Mocks to the rescue?
  • 54. WHAT WE ARE KNOWN FOR 54 Mocks Solved problems New problems ● Hard to keep both sides in sync ● Fast feedback ● Few dependencies ● No dedicated environment ● Reliable ● Easy to debug Integration > Contract Tests > Contracts
  • 55. 55 Contract { “id”: 1234, “items”:[ ... ], } Consumer Provider Integration > Contract Tests > Contracts Order API GET /orders/1234
  • 56. 56 Provisioning Amazon ML Integration > Contract Tests > Contracts Place Order API External Events Order Status API Outside World Internal Events Microservice Interface Data, Events and Processing Suggestions API Publish Event to external subscribers Insights / Predictions Customer / Other Event Orders Push API Inside bounded context CRM Materialised view of customer Provisioning Event External Events … API
  • 57. 57 Provisioning Amazon ML Integration > Contract Tests > Contracts Everywhere! Place Order API External Events Order Status API Outside World Internal Events Microservice Interface Data, Events and Processing Suggestions API Publish Event to external subscribers Insights / Predictions Customer / Other Event Orders Push API Inside bounded context CRM Materialised view of customer Provisioning Event External Events … API Contract Contract Contract Contract Contract Contract Contract Contract
  • 58. Integration > Contract Tests > Contracts
  • 59. Integration > Contract Tests > Contracts Mock
  • 60. Integration > Contract Tests > Contracts Mock GET /orders/1234
  • 61. Integration > Contract Tests > Contracts Mock { “id”: 1234, “items”:[ ... ], } GET /orders/1234
  • 62. Integration > Contract Tests > Contracts Mock
  • 63. Integration > Contract Tests > Contracts Mock GET /orders/1234
  • 64. Integration > Contract Tests > Contracts Mock { “id”: 1234, “items”:[ ... ], } GET /orders/1234
  • 65. Integration > Contract Tests > Contracts Mock ✔
  • 66. WHAT WE ARE KNOWN FORTestability > Modularisation > Consumer Test Adapted from https://martinfowler.com/articles/microservice-testing Adapters Services Domain Repositories Collaborators External Service Show me where?
  • 67. WHAT WE ARE KNOWN FORTestability > Modularisation > Provider Test Adapted from https://martinfowler.com/articles/microservice-testing Show me where? Adapters Services Domain Repositories Collaborators mock In-memory database
  • 68. 68 Integration > Contract Tests > Contracts https://martinfowler.com/bliki/TestPyramid.html Contract Show me where?
  • 69. Bug turnaround - minutes Contracts tests Integration > Contract Tests > Contracts
  • 70. Know before you commit Contracts tests Integration > Contract Tests > Contracts
  • 71. Make changes with speed and confidence Contracts tests Integration > Contract Tests > Contracts
  • 72. Deploy independently Contracts tests Integration > Contract Tests > Contracts
  • 73. Better API design (Consumer) Contracts tests Integration > Contract Tests > Contracts
  • 74. 74 ● Open source ● Multiple languages ○ Javascript ○ Go ○ Python ○ JVM ○ .NET ○ + more pact.io ● HTTP contracts ● Message contracts ● … protocol agnostic! Integration > Contract Tests > Contracts
  • 75. 75 Contract { “id”: 1234, “items”:[ ... ], } Consumer Provider Integration > Contract Tests > Consumer Contract Test Order API GET /orders/1234
  • 76. Integration > Contract Tests > Contracts > Fetch Order Example Setup API Host
  • 77. Integration > Contract Tests > Contracts > Fetch Order Example Expectations on Order API made clear
  • 78. Integration > Contract Tests > Contracts > Fetch Order Example Expectations on Order API made clear
  • 79. Integration > Contract Tests > Contracts > Fetch Order Example Call the OrderService + Assert
  • 80. Integration > Contract Tests > Contracts > Fetch Order Example Test state setup
  • 81. Integration > Contract Tests > Contracts > Fetch Order Example Test state setup
  • 82. ● Contract tests are faster, easier to maintain and more reliable than e2e tests ● Works for both synchronous and async communication ● Use contract tests to reduce your end-to-end test reliance ● End-to-end tests closer represent the user experience ● Contract testing doesn’t replace functional testing! Summary Integration > Contract Tests
  • 84. 84 Push responsibility into Platform Observability
  • 85. 85 Push responsibility into Platform Observability
  • 86. 86 #1 Log all the things! Observability
  • 88. Handler Observability > Approach #2 > Middleware { "Records": [ { "EventVersion": "1.0", "EventSubscriptionArn": "somearn", "EventSource": "aws:sns", "Sns": { ... } } ] } { "Success": true } HandlerHandlerHandler before after Request Response 1st middleware 2nd middleware 3rd middleware
  • 89. Observability > Approach #2 > Middleware
  • 90. Observability > Approach #2 > Middleware
  • 91. Observability > Approach #2 > Middleware
  • 92. 92 #3 Push responsibility into Platform Observability
  • 93. 93 Observability > Approach #1 > IT Ops Automation Decide Alarm Schedule Notify Pagerduty Act Isolate instance from ASG Offsite backup Ship logs to Splunk Orient Security Analysis Application Anomaly / Canary Detection Log forwarder Policy Violation Observe Flow Logs CloudTrail CloudWatch Logs Application Event Configured Rule Event subscription
  • 94. 94 Observability > Approach #1 > IT Ops Automation Decide Alarm Act Ship logs to Splunk Orient Log forwarder Observe CloudWatch Logs Event subscription
  • 95. WHAT WE ARE KNOWN FOR 95 Examples ● Automatically subscribe log groups and forward to ___ ● Allow dynamic DEBUG monitoring (runtime sampling) ● Enable platform tracing (e.g. X-ray, IOPipe, Dashbird) ● Automatically inject correlation IDs ● Anomaly detection Observability > Approach #1 > IT Ops Automation
  • 96. ● Invest in platform ● Structured + semantic logging is crucial ● Middleware to simplify and template out specific shaped functions Summary Observability > Summary
  • 98. Summary 98 Summary Problems ● Microservices + architecture has evolved ● ...and so must the pyramid! ● More diverse integrations ● More glue, cloud-native code We’re all digital plumbers!
  • 99. ● Use Ports + Adapters (Hexagonal architecture) to increase modularity ● Enable better testability and test modularity ● Mock SDK for local tests ● Component tests can help to reduce need for e2e tests There is no single test strategy that will work for all cases! Structure... Summary > Structure
  • 100. ● Contract tests are faster and more reliable than E2E tests ● Use them to reduce your E2E footprint ● Contract tests enable independent deployment ● They are not functional tests Never forget forget the end user! Reduce E2E... Summary > Reduce reliance on E2E
  • 101. ● Is the property of understanding a system as illuminated by its outputs ● Allows us to ask questions ● Helps us discover and respond to unknown, unknowns It’s not monitoring, but there is significant implementation overlap. Observability... Summary > Observability