SlideShare a Scribd company logo
1 of 30
Mocking and Monitoring
(for) your APIs
Hello!
I am Pricilla Bilavendran
I am here because, I love to talk about APIs and spreading API literacy
among Test engineers!!
2
We will discuss about
◈ Introduction to Mock Servers
◈ Mock Process
◈ Mocking types and tools
◈ Advantages of mocks
◈ Introduction to API Monitoring
◈ Why monitoring?
◈ Tools available
◈ Demo
3
What, When, Why and How?
1. “Mock” your APIs
4
5
Mockingbird
When we talk about Mocks
Mock Objects
In OOPS, mock object is
a simulated object
6
Mock Testing
With the help of mock
objects, simulation is
done for the integration
testing of the individual
components
Is mocking good or bad?
😉
Ofcourse, it is bad with
people and unacceptable.
But it’s good for your API
testing process.
7
8
What is a Mock Server?
◈ Simulate real server
◈ Not real server (call is fake)
◈ Gives the mocked response
How does it work?
Finalize your
expected
response
Configure
your Mock
Server
Server sends
the same
response
9
Types of Mock Servers
10
Public
◈ Accessible to everyone
◈ No Auth required
Private
◈ Only to the intended
user and requires
authentication
◈ Sensitive data
When to use Mock Servers?
◈ New APIs feedback before real development
◈ Under-developed applications/APIs
◈ Unstable server
◈ Integration tests/chaining of APIs
◈ External dependencies
◈ Reduce load to real server
11
“
Don’t watch the clock; do what it does. Keep going
- Sam Levenson
12
Advantages of Mocks
◈ Analysis of responses and provide feedbacks
◈ Testers to write assertions
◈ Development continues when the external service
fails
◈ Avoids data sharing and data privacy is maintained
◈ Supports to test the endpoints individually
13
Tools used
◈ Postman
◈ Stoplight
◈ Wiremock
◈ Mocky.io
◈ Mockoon
14
15
Tips to improve the Mocks
◈ Validate JSON payload before mocking it
◈ Select your tool wisely
◈ Understand the type of project
◈ Public/Private
Creating Mock Servers in Postman
16
Mock Responses using mocky.io
17
What, When, Why and How?
2. “Monitor” your APIs
18
◈ Collecting and Analyzing data
◈ Performance and Availability of the API
◈ Security
19
What is API Monitoring?
Top Monitoring Metrics
◈ Overall availability (99.999%)
◈ Response Time
◈ Request Per min
◈ Latency
◈ TTFB/TTLB
◈ Errors per min
20
“
Without logging and monitoring, breaches cannot
be detected - OWASP
21
As per “The 2021 Data Breach Investigations
Report”, 20% of the breaches stay
undiscovered for months. This helps the
hackers to cross layer-by-layer
22
Why API Monitoring?
◈ Understand the trend
◈ Find the security leaks/threats
◈ Outages detection and quick actions
◈ Happy customers
23
Tools available
◈ RapidAPI
◈ ReadyAPI
◈ Postman
◈ New Relic
◈ AWS CloudWatch
24
Best Practices
◈ Analyze the trend
◈ Document the deviations
◈ Never skip the dependencies
◈ CI/CD
◈ Tool Selection
◈ Configure alerting
25
26
Monitoring Vs Observability
Collection of Metrics Technical solutions
Debugging
27
DEMO
28
References
❖ https://mock-server.com/
❖ https://learning.postman.com/docs/designing-and-developing-your-
api/mocking-data/setting-up-mock/
❖ https://learning.postman.com/docs/monitoring-your-api/intro-
monitors/#:~:text=Postman%20Monitors%20give%20you%20continuous,and
%20validate%20critical%20API%20flows.
❖ https://www.postman.com/product/integrations/
Thanks!
Any questions?
You can find me at:
@pricillabelwin
29
Credits
Special thanks to all the people who made and
released these awesome resources for free:
◈ Presentation template by SlidesCarnival
◈ Photographs by Unsplash
◈ Backgrounds by SubtlePatterns
30

More Related Content

Similar to Mocking and Monitoring your APIs.pptx

To Open Banking and Beyond: Developing APIs that are Resilient to every new I...
To Open Banking and Beyond: Developing APIs that are Resilient to every new I...To Open Banking and Beyond: Developing APIs that are Resilient to every new I...
To Open Banking and Beyond: Developing APIs that are Resilient to every new I...
Curiosity Software Ireland
 

Similar to Mocking and Monitoring your APIs.pptx (20)

API Security Best Practices and Guidelines
API Security Best Practices and GuidelinesAPI Security Best Practices and Guidelines
API Security Best Practices and Guidelines
 
Landmines in the API Landscape
Landmines in the API LandscapeLandmines in the API Landscape
Landmines in the API Landscape
 
Hacking and Defending APIs - Red and Blue make Purple.pdf
Hacking and Defending APIs - Red and Blue make Purple.pdfHacking and Defending APIs - Red and Blue make Purple.pdf
Hacking and Defending APIs - Red and Blue make Purple.pdf
 
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
 
London Adapt or Die: Securing your APIs the Right Way!
London Adapt or Die: Securing your APIs the Right Way!London Adapt or Die: Securing your APIs the Right Way!
London Adapt or Die: Securing your APIs the Right Way!
 
Your API Sucks! Why developers hang up and how to stop that.
Your API Sucks! Why developers hang up and how to stop that.Your API Sucks! Why developers hang up and how to stop that.
Your API Sucks! Why developers hang up and how to stop that.
 
To Open Banking and Beyond: Developing APIs that are Resilient to every new I...
To Open Banking and Beyond: Developing APIs that are Resilient to every new I...To Open Banking and Beyond: Developing APIs that are Resilient to every new I...
To Open Banking and Beyond: Developing APIs that are Resilient to every new I...
 
Common Security API Issues and How to Mitigate Them Using Postman
Common Security API Issues and How to Mitigate Them Using PostmanCommon Security API Issues and How to Mitigate Them Using Postman
Common Security API Issues and How to Mitigate Them Using Postman
 
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
 
Apidays Paris 2023 - Building an Inventory, Maria Teresa Pereira, KPMG Portugal
Apidays Paris 2023 - Building an Inventory,  Maria Teresa Pereira, KPMG PortugalApidays Paris 2023 - Building an Inventory,  Maria Teresa Pereira, KPMG Portugal
Apidays Paris 2023 - Building an Inventory, Maria Teresa Pereira, KPMG Portugal
 
"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi"The working architecture of NodeJs applications" Viktor Turskyi
"The working architecture of NodeJs applications" Viktor Turskyi
 
Mobile testing - the releationship between tests, business goals and design c...
Mobile testing - the releationship between tests, business goals and design c...Mobile testing - the releationship between tests, business goals and design c...
Mobile testing - the releationship between tests, business goals and design c...
 
2022 APIsecure_A day in the life of an API; Fighting the odds
2022 APIsecure_A day in the life of an API; Fighting the odds2022 APIsecure_A day in the life of an API; Fighting the odds
2022 APIsecure_A day in the life of an API; Fighting the odds
 
Why your APIs should fly first class
Why your APIs should fly first classWhy your APIs should fly first class
Why your APIs should fly first class
 
API Testing and Hacking (1).pdf
API Testing and Hacking (1).pdfAPI Testing and Hacking (1).pdf
API Testing and Hacking (1).pdf
 
API Testing and Hacking.pdf
API Testing and Hacking.pdfAPI Testing and Hacking.pdf
API Testing and Hacking.pdf
 
API Testing and Hacking.pdf
API Testing and Hacking.pdfAPI Testing and Hacking.pdf
API Testing and Hacking.pdf
 
Postman 101 for developers
Postman 101 for developersPostman 101 for developers
Postman 101 for developers
 
Monitoring Solutions for APIs
Monitoring Solutions for APIsMonitoring Solutions for APIs
Monitoring Solutions for APIs
 
apidays LIVE Singapore 2021 - Why verifying user identity Is not enough In 20...
apidays LIVE Singapore 2021 - Why verifying user identity Is not enough In 20...apidays LIVE Singapore 2021 - Why verifying user identity Is not enough In 20...
apidays LIVE Singapore 2021 - Why verifying user identity Is not enough In 20...
 

More from Pricilla Bilavendran

More from Pricilla Bilavendran (6)

The Unuttered, and the Unaware Unconscious Biases.pdf
The Unuttered, and the Unaware Unconscious Biases.pdfThe Unuttered, and the Unaware Unconscious Biases.pdf
The Unuttered, and the Unaware Unconscious Biases.pdf
 
Land of Utopia for Testers Does it exists.pdf
Land of Utopia for Testers Does it exists.pdfLand of Utopia for Testers Does it exists.pdf
Land of Utopia for Testers Does it exists.pdf
 
Testing your APIs Performance.pptx
Testing your APIs Performance.pptxTesting your APIs Performance.pptx
Testing your APIs Performance.pptx
 
API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
 
Unleash the Speaker in YOU.pptx
Unleash the Speaker in YOU.pptxUnleash the Speaker in YOU.pptx
Unleash the Speaker in YOU.pptx
 
Just let it _Flow_.pptx
Just let it _Flow_.pptxJust let it _Flow_.pptx
Just let it _Flow_.pptx
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Mocking and Monitoring your APIs.pptx

  • 2. Hello! I am Pricilla Bilavendran I am here because, I love to talk about APIs and spreading API literacy among Test engineers!! 2
  • 3. We will discuss about ◈ Introduction to Mock Servers ◈ Mock Process ◈ Mocking types and tools ◈ Advantages of mocks ◈ Introduction to API Monitoring ◈ Why monitoring? ◈ Tools available ◈ Demo 3
  • 4. What, When, Why and How? 1. “Mock” your APIs 4
  • 6. When we talk about Mocks Mock Objects In OOPS, mock object is a simulated object 6 Mock Testing With the help of mock objects, simulation is done for the integration testing of the individual components
  • 7. Is mocking good or bad? 😉 Ofcourse, it is bad with people and unacceptable. But it’s good for your API testing process. 7
  • 8. 8 What is a Mock Server? ◈ Simulate real server ◈ Not real server (call is fake) ◈ Gives the mocked response
  • 9. How does it work? Finalize your expected response Configure your Mock Server Server sends the same response 9
  • 10. Types of Mock Servers 10 Public ◈ Accessible to everyone ◈ No Auth required Private ◈ Only to the intended user and requires authentication ◈ Sensitive data
  • 11. When to use Mock Servers? ◈ New APIs feedback before real development ◈ Under-developed applications/APIs ◈ Unstable server ◈ Integration tests/chaining of APIs ◈ External dependencies ◈ Reduce load to real server 11
  • 12. “ Don’t watch the clock; do what it does. Keep going - Sam Levenson 12
  • 13. Advantages of Mocks ◈ Analysis of responses and provide feedbacks ◈ Testers to write assertions ◈ Development continues when the external service fails ◈ Avoids data sharing and data privacy is maintained ◈ Supports to test the endpoints individually 13
  • 14. Tools used ◈ Postman ◈ Stoplight ◈ Wiremock ◈ Mocky.io ◈ Mockoon 14
  • 15. 15 Tips to improve the Mocks ◈ Validate JSON payload before mocking it ◈ Select your tool wisely ◈ Understand the type of project ◈ Public/Private
  • 16. Creating Mock Servers in Postman 16
  • 17. Mock Responses using mocky.io 17
  • 18. What, When, Why and How? 2. “Monitor” your APIs 18
  • 19. ◈ Collecting and Analyzing data ◈ Performance and Availability of the API ◈ Security 19 What is API Monitoring?
  • 20. Top Monitoring Metrics ◈ Overall availability (99.999%) ◈ Response Time ◈ Request Per min ◈ Latency ◈ TTFB/TTLB ◈ Errors per min 20
  • 21. “ Without logging and monitoring, breaches cannot be detected - OWASP 21
  • 22. As per “The 2021 Data Breach Investigations Report”, 20% of the breaches stay undiscovered for months. This helps the hackers to cross layer-by-layer 22
  • 23. Why API Monitoring? ◈ Understand the trend ◈ Find the security leaks/threats ◈ Outages detection and quick actions ◈ Happy customers 23
  • 24. Tools available ◈ RapidAPI ◈ ReadyAPI ◈ Postman ◈ New Relic ◈ AWS CloudWatch 24
  • 25. Best Practices ◈ Analyze the trend ◈ Document the deviations ◈ Never skip the dependencies ◈ CI/CD ◈ Tool Selection ◈ Configure alerting 25
  • 26. 26 Monitoring Vs Observability Collection of Metrics Technical solutions Debugging
  • 28. 28 References ❖ https://mock-server.com/ ❖ https://learning.postman.com/docs/designing-and-developing-your- api/mocking-data/setting-up-mock/ ❖ https://learning.postman.com/docs/monitoring-your-api/intro- monitors/#:~:text=Postman%20Monitors%20give%20you%20continuous,and %20validate%20critical%20API%20flows. ❖ https://www.postman.com/product/integrations/
  • 29. Thanks! Any questions? You can find me at: @pricillabelwin 29
  • 30. Credits Special thanks to all the people who made and released these awesome resources for free: ◈ Presentation template by SlidesCarnival ◈ Photographs by Unsplash ◈ Backgrounds by SubtlePatterns 30

Editor's Notes

  1. Unmonitored mail box