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

SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...
SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...
SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...SolarWinds
 
Code Quality Lightning Talk
Code Quality Lightning TalkCode Quality Lightning Talk
Code Quality Lightning TalkJonathan Gregory
 
Deep-Dive to Application Insights
Deep-Dive to Application Insights Deep-Dive to Application Insights
Deep-Dive to Application Insights Gunnar Peipman
 
4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴Terry Cho
 
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...SlideTeam
 
Observabilidade: Será que você está fazendo do jeito certo?
Observabilidade: Será que você está fazendo do jeito certo?Observabilidade: Será que você está fazendo do jeito certo?
Observabilidade: Será que você está fazendo do jeito certo?Janssen Lima
 
CI/CD Best Practices for Your DevOps Journey
CI/CD Best  Practices for Your DevOps JourneyCI/CD Best  Practices for Your DevOps Journey
CI/CD Best Practices for Your DevOps JourneyDevOps.com
 
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)Lucas Jellema
 
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...Amazon Web Services
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Amazon Web Services
 
Python 테스트 시작하기
Python 테스트 시작하기Python 테스트 시작하기
Python 테스트 시작하기Hosung Lee
 
Odoo External API
Odoo External APIOdoo External API
Odoo External APIOdoo
 
Deploying WSO2 API Manager in Production-Grade Kubernetes
Deploying WSO2 API Manager in Production-Grade KubernetesDeploying WSO2 API Manager in Production-Grade Kubernetes
Deploying WSO2 API Manager in Production-Grade KubernetesWSO2
 
Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1SmartBear
 
NashTech - Azure Application Insights
NashTech - Azure Application InsightsNashTech - Azure Application Insights
NashTech - Azure Application InsightsPhi Huynh
 

What's hot (20)

"DevOps > CI+CD "
"DevOps > CI+CD ""DevOps > CI+CD "
"DevOps > CI+CD "
 
SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...
SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...
SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...
 
Code Quality Lightning Talk
Code Quality Lightning TalkCode Quality Lightning Talk
Code Quality Lightning Talk
 
Deep-Dive to Application Insights
Deep-Dive to Application Insights Deep-Dive to Application Insights
Deep-Dive to Application Insights
 
Bizweb Microservices Architecture
Bizweb Microservices ArchitectureBizweb Microservices Architecture
Bizweb Microservices Architecture
 
4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴
 
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
 
Observabilidade: Será que você está fazendo do jeito certo?
Observabilidade: Será que você está fazendo do jeito certo?Observabilidade: Será que você está fazendo do jeito certo?
Observabilidade: Será que você está fazendo do jeito certo?
 
Keycloak SSO basics
Keycloak SSO basicsKeycloak SSO basics
Keycloak SSO basics
 
CI/CD Best Practices for Your DevOps Journey
CI/CD Best  Practices for Your DevOps JourneyCI/CD Best  Practices for Your DevOps Journey
CI/CD Best Practices for Your DevOps Journey
 
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
 
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
Python 테스트 시작하기
Python 테스트 시작하기Python 테스트 시작하기
Python 테스트 시작하기
 
Odoo External API
Odoo External APIOdoo External API
Odoo External API
 
How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Deploying WSO2 API Manager in Production-Grade Kubernetes
Deploying WSO2 API Manager in Production-Grade KubernetesDeploying WSO2 API Manager in Production-Grade Kubernetes
Deploying WSO2 API Manager in Production-Grade Kubernetes
 
Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1
 
NashTech - Azure Application Insights
NashTech - Azure Application InsightsNashTech - Azure Application Insights
NashTech - Azure Application Insights
 

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

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
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...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

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