Webhook Testing Strategy

Beyond The Callback:
Webhook Testing For Modern
Applications
By Dimpy Adhikary, Quality Analyst, Thoughtworks
Agenda
01 - Introduction to Webhook
Why/What/How
02 - Webhook Demo
Simple webhook implementation
03 - Challenges in Webhook
What can go wrong
04 - Webhook Testing Strategy
How to test a webhook based application
ECOMMERCE
Inventory Management
Use Cases
MARKETING AUTOMATION
Personalized Campaign
HEALTHCARE SERVICES
Patient Data Sharing
FINANCIAL SERVICES
Loan Application
Process
Why Webhook
ECOMMERCE
What is Webhook
Source app Payload Destination App
Event Webhook URL
Webhook is a user specified HTTP callback that get
triggered by some event to connect and share data between two applications.
How Webhook Works
Register For
The Event In
Source App
Received Data
And Taking Action In
Source App
Repeat
The Process
Waiting For
The Event In Destination
App
Setting Up The
Webhook (Callback URL)
In Source App
Event
Is triggered In
Source App
ECOMMERCE
Polling Vs Webhook
Polling Webhooks
Request origin Client Server
Trigger Client-initiated Server-initiated
Frequency Scheduled or continuous Event-driven
Efficiency Less efficient More efficient
Scalability Less scalable More scalable
Weather Notification - Webhook Demo
Prerequisite:
- Python (pip install flask,requests)
- Curl
● Users can subscribe to receive weather updates for specific cities.
● When the weather conditions match their preferences, a webhook is sent
to the user's registered endpoint.
Implementation:
- sender.py - Send webhook
notification
- receiver.py - Listen for incoming
weather notification.
Simulation of the event: curl -X POST -H "Content-Type: application/json" -d '{"city": "city1",
"weather": "sunny", "user_endpoints": {"city1": "http://localhost:3000/receive_weather_notification",
"city2": "http://localhost:3000/receive_weather_notification"}}'
http://localhost:5000/simulate_weather_update
Challenges in Webhook
Payload
- Contract change
- Missing data
- Invalid data
Configuration
- IP white listing
- Incorrect URL/payload format
- Token expiry
- Incorrect token/credentials
- Wrong event association
- Incorrect rate limiting
Error Handling
- Unhandled errors
- No error retry
mechanism
- No error notification
Challenges in Webhook
Performance
- Slow webhook processing
- Timeout error
- Resource exhaustion
- Scalability issues
Resilience
- Availability
- Idempotence
- External dependencies
- Async communication
- Network failures
Security
- Unauthorized access
- Data breaches
- Replay attacks
- DoS attacks
Compliance
- Data privacy regulations
(GDPR)
- Financial regulations (PCI)
- Industry-specific
regulations (HIPPA)
Testing
Strategy
Functional Testing
- Configuration
- Error handling
- Integration
- User journey
Reliability Testing
- Simulating failures
- Infra testing
- Retry mechanism
- Monitoring
Performance Testing
- Load/Stress/Volume testing
Contract testing
- Payload/schema
- Consumer/provider
driven
Compliance Testing
- Data compliance
- PCI/PII
Security Testing
- OWASP top 10
- Attack simulation
1 von 10

Recomendados

High Availability by Design von
High Availability by DesignHigh Availability by Design
High Availability by DesignDavid Prinzing
408 views14 Folien
02 api gateway von
02 api gateway02 api gateway
02 api gatewayJanani Velmurugan
235 views20 Folien
Server-Sent Events in Action von
Server-Sent Events in ActionServer-Sent Events in Action
Server-Sent Events in ActionAndrei Rusu
12.4K views21 Folien
How to build customizable multitenant web applications - IPC11 Spring Edition von
How to build customizable multitenant web applications - IPC11 Spring EditionHow to build customizable multitenant web applications - IPC11 Spring Edition
How to build customizable multitenant web applications - IPC11 Spring EditionStephan Hochdörfer
16.3K views89 Folien
Event Driven Streaming Analytics - Demostration on Architecture of IoT von
Event Driven Streaming Analytics - Demostration on Architecture of IoTEvent Driven Streaming Analytics - Demostration on Architecture of IoT
Event Driven Streaming Analytics - Demostration on Architecture of IoTLei Xu
1.7K views32 Folien
IRJET- An Overview of Web Sockets: The Future of Real-Time Communication von
IRJET- An Overview of Web Sockets: The Future of Real-Time CommunicationIRJET- An Overview of Web Sockets: The Future of Real-Time Communication
IRJET- An Overview of Web Sockets: The Future of Real-Time CommunicationIRJET Journal
14 views4 Folien

Más contenido relacionado

Similar a Webhook Testing Strategy

Petr Dvořák: Mobilní webové služby pohledem iPhone developera von
Petr Dvořák: Mobilní webové služby pohledem iPhone developeraPetr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developeraWebExpo
398 views57 Folien
Service workers and their role in PWAs von
Service workers and their role in PWAsService workers and their role in PWAs
Service workers and their role in PWAsIpsha Bhidonia
72 views53 Folien
Event-Based API Patterns and Practices von
Event-Based API Patterns and PracticesEvent-Based API Patterns and Practices
Event-Based API Patterns and PracticesLaunchAny
47 views41 Folien
API Security - Null meet von
API Security - Null meetAPI Security - Null meet
API Security - Null meetvinoth kumar
2.1K views18 Folien
Are You Ready For More Visitors Cognizant Gomez Jan20 von
Are You Ready For More Visitors   Cognizant  Gomez Jan20Are You Ready For More Visitors   Cognizant  Gomez Jan20
Are You Ready For More Visitors Cognizant Gomez Jan20Compuware APM
844 views25 Folien
Magical Performance tuning with Gomez von
Magical Performance tuning with GomezMagical Performance tuning with Gomez
Magical Performance tuning with Gomezmcsaha
674 views25 Folien

Similar a Webhook Testing Strategy(20)

Petr Dvořák: Mobilní webové služby pohledem iPhone developera von WebExpo
Petr Dvořák: Mobilní webové služby pohledem iPhone developeraPetr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developera
WebExpo398 views
Service workers and their role in PWAs von Ipsha Bhidonia
Service workers and their role in PWAsService workers and their role in PWAs
Service workers and their role in PWAs
Ipsha Bhidonia72 views
Event-Based API Patterns and Practices von LaunchAny
Event-Based API Patterns and PracticesEvent-Based API Patterns and Practices
Event-Based API Patterns and Practices
LaunchAny47 views
API Security - Null meet von vinoth kumar
API Security - Null meetAPI Security - Null meet
API Security - Null meet
vinoth kumar2.1K views
Are You Ready For More Visitors Cognizant Gomez Jan20 von Compuware APM
Are You Ready For More Visitors   Cognizant  Gomez Jan20Are You Ready For More Visitors   Cognizant  Gomez Jan20
Are You Ready For More Visitors Cognizant Gomez Jan20
Compuware APM844 views
Magical Performance tuning with Gomez von mcsaha
Magical Performance tuning with GomezMagical Performance tuning with Gomez
Magical Performance tuning with Gomez
mcsaha674 views
Don't call us - we'll push - cross tier push architecture (JavaOne 2011) von Lucas Jellema
Don't call us - we'll push - cross tier push architecture (JavaOne 2011)Don't call us - we'll push - cross tier push architecture (JavaOne 2011)
Don't call us - we'll push - cross tier push architecture (JavaOne 2011)
Lucas Jellema2.3K views
Statying Alive - Online and OFfline von Erik Hellman
Statying Alive - Online and OFflineStatying Alive - Online and OFfline
Statying Alive - Online and OFfline
Erik Hellman1.5K views
Difference between Client Polling vs Server Push vs Websocket vs Long Polling von jeetendra mandal
Difference between Client Polling vs Server Push vs Websocket vs Long PollingDifference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
jeetendra mandal373 views
Building Event Driven API Services Using Webhooks von Cloud Elements
Building Event Driven API Services Using WebhooksBuilding Event Driven API Services Using Webhooks
Building Event Driven API Services Using Webhooks
Cloud Elements5.1K views
Live Streaming & Server Sent Events von tkramar
Live Streaming & Server Sent EventsLive Streaming & Server Sent Events
Live Streaming & Server Sent Events
tkramar7.5K views
[WSO2Con EU 2018] Building Reactive Applications Using Event Driven Architecture von WSO2
[WSO2Con EU 2018] Building Reactive Applications Using Event Driven Architecture[WSO2Con EU 2018] Building Reactive Applications Using Event Driven Architecture
[WSO2Con EU 2018] Building Reactive Applications Using Event Driven Architecture
WSO2319 views
Events, Picos, and Microservices von Phil Windley
Events, Picos, and MicroservicesEvents, Picos, and Microservices
Events, Picos, and Microservices
Phil Windley6.8K views
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd von Sencha
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha1.1K views
EWD 3 Training Course Part 6: What Happens when a QEWD Application is Started von Rob Tweed
EWD 3 Training Course Part 6: What Happens when a QEWD Application is StartedEWD 3 Training Course Part 6: What Happens when a QEWD Application is Started
EWD 3 Training Course Part 6: What Happens when a QEWD Application is Started
Rob Tweed1K views

Último

Initiating and Advancing Your Strategic GIS Governance Strategy von
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance StrategySafe Software
184 views68 Folien
This talk was not generated with ChatGPT: how AI is changing science von
This talk was not generated with ChatGPT: how AI is changing scienceThis talk was not generated with ChatGPT: how AI is changing science
This talk was not generated with ChatGPT: how AI is changing scienceElena Simperl
32 views13 Folien
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... von
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...ShapeBlue
108 views12 Folien
Telenity Solutions Brief von
Telenity Solutions BriefTelenity Solutions Brief
Telenity Solutions BriefMustafa Kuğu
14 views10 Folien
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」 von
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」PC Cluster Consortium
25 views12 Folien
Business Analyst Series 2023 - Week 4 Session 7 von
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7DianaGray10
146 views31 Folien

Último(20)

Initiating and Advancing Your Strategic GIS Governance Strategy von Safe Software
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance Strategy
Safe Software184 views
This talk was not generated with ChatGPT: how AI is changing science von Elena Simperl
This talk was not generated with ChatGPT: how AI is changing scienceThis talk was not generated with ChatGPT: how AI is changing science
This talk was not generated with ChatGPT: how AI is changing science
Elena Simperl32 views
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... von ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue108 views
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」 von PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」
Business Analyst Series 2023 - Week 4 Session 7 von DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10146 views
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf von MichaelOLeary82
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdfAdopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
MichaelOLeary8213 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs von Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash162 views
Measurecamp Brussels - Synthetic data.pdf von Human37
Measurecamp Brussels - Synthetic data.pdfMeasurecamp Brussels - Synthetic data.pdf
Measurecamp Brussels - Synthetic data.pdf
Human37 26 views
Innovation & Entrepreneurship strategies in Dairy Industry von PervaizDar1
Innovation & Entrepreneurship strategies in Dairy IndustryInnovation & Entrepreneurship strategies in Dairy Industry
Innovation & Entrepreneurship strategies in Dairy Industry
PervaizDar135 views
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf von ThomasBronack
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdfBronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf
ThomasBronack31 views
The Coming AI Tsunami.pptx von johnhandby
The Coming AI Tsunami.pptxThe Coming AI Tsunami.pptx
The Coming AI Tsunami.pptx
johnhandby13 views
Future of AR - Facebook Presentation von Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty65 views
The Role of Patterns in the Era of Large Language Models von Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li91 views
Deep Tech and the Amplified Organisation: Core Concepts von Holonomics
Deep Tech and the Amplified Organisation: Core ConceptsDeep Tech and the Amplified Organisation: Core Concepts
Deep Tech and the Amplified Organisation: Core Concepts
Holonomics17 views

Webhook Testing Strategy

  • 1. Beyond The Callback: Webhook Testing For Modern Applications By Dimpy Adhikary, Quality Analyst, Thoughtworks
  • 2. Agenda 01 - Introduction to Webhook Why/What/How 02 - Webhook Demo Simple webhook implementation 03 - Challenges in Webhook What can go wrong 04 - Webhook Testing Strategy How to test a webhook based application
  • 3. ECOMMERCE Inventory Management Use Cases MARKETING AUTOMATION Personalized Campaign HEALTHCARE SERVICES Patient Data Sharing FINANCIAL SERVICES Loan Application Process Why Webhook
  • 4. ECOMMERCE What is Webhook Source app Payload Destination App Event Webhook URL Webhook is a user specified HTTP callback that get triggered by some event to connect and share data between two applications.
  • 5. How Webhook Works Register For The Event In Source App Received Data And Taking Action In Source App Repeat The Process Waiting For The Event In Destination App Setting Up The Webhook (Callback URL) In Source App Event Is triggered In Source App
  • 6. ECOMMERCE Polling Vs Webhook Polling Webhooks Request origin Client Server Trigger Client-initiated Server-initiated Frequency Scheduled or continuous Event-driven Efficiency Less efficient More efficient Scalability Less scalable More scalable
  • 7. Weather Notification - Webhook Demo Prerequisite: - Python (pip install flask,requests) - Curl ● Users can subscribe to receive weather updates for specific cities. ● When the weather conditions match their preferences, a webhook is sent to the user's registered endpoint. Implementation: - sender.py - Send webhook notification - receiver.py - Listen for incoming weather notification. Simulation of the event: curl -X POST -H "Content-Type: application/json" -d '{"city": "city1", "weather": "sunny", "user_endpoints": {"city1": "http://localhost:3000/receive_weather_notification", "city2": "http://localhost:3000/receive_weather_notification"}}' http://localhost:5000/simulate_weather_update
  • 8. Challenges in Webhook Payload - Contract change - Missing data - Invalid data Configuration - IP white listing - Incorrect URL/payload format - Token expiry - Incorrect token/credentials - Wrong event association - Incorrect rate limiting Error Handling - Unhandled errors - No error retry mechanism - No error notification
  • 9. Challenges in Webhook Performance - Slow webhook processing - Timeout error - Resource exhaustion - Scalability issues Resilience - Availability - Idempotence - External dependencies - Async communication - Network failures Security - Unauthorized access - Data breaches - Replay attacks - DoS attacks Compliance - Data privacy regulations (GDPR) - Financial regulations (PCI) - Industry-specific regulations (HIPPA)
  • 10. Testing Strategy Functional Testing - Configuration - Error handling - Integration - User journey Reliability Testing - Simulating failures - Infra testing - Retry mechanism - Monitoring Performance Testing - Load/Stress/Volume testing Contract testing - Payload/schema - Consumer/provider driven Compliance Testing - Data compliance - PCI/PII Security Testing - OWASP top 10 - Attack simulation