SlideShare a Scribd company logo
1 of 13
Download to read offline
Microservices
Testing Strategy
Rajni Singh,
Manager, Quality Assurance
What are
Microservices?
Micro-services is an
architecture
consisting of focused,
small services that
together create a
complete application
or task.
Every instance of a microservice
represents a single responsibility
within the solution.
Key features of
microservices architecture:
• Self-contained and
componentized
• Decentralized data
management
• Resilient to failures
• Built around a single
business need
• Reasonably small
micros
Important testing scenarios
A good use case of a microservices architecture would
include the following scenarios:
1. The system is too big and complex that it becomes
difficult to manage.
2. The system is expected to handle high traffic & load
and needs to be scalable.
3. Testing between internal microservices and a third-
party services.
4. Testing for microservices which needs to be exposed
to the public domain.
Challenges in testing microservices
• Timely availability of all the services for testing.
• Complicated extraction of logs during testing and data validation.
• Identifying the scope of testing at each service level and
integration testing as each component operate on separate
services and rely on each other to cover their module and
integration with an external service.
• The availability of testing environment considering the
development strategy is agile.
• Distributed and independent nature of a microservice
architecture results in the isolation of each component of the
architecture from the rest. Thus it needs individual testing and
cover all independent services.
• Monitoring multiple log files, databases, and servers increases
the complexity of tracking down issues or verifying processes.
Microservices testing strategy
Bottom-up testing approach is an optimized solution
which includes:
• Test the domain
• Tests closer to the code
• Integrate Early
• Use Mocks / Stubs
• Focus is on Test Pyramid
• Helps visualize/categorize test coverage
better
Microservices
testing types
UI testing
Integration testing
End to end testing
Contract testing
Unit testing
Exploratory testing
Scopeoftesting
Executiontime
Number of tests
• Focuses on one unit (class/module) of a domain
• Verifies functionality of one unit
• White box & API testing
Unit testing helps us in the following
ways:
• Isolates the logic in places where
setting-up all the cases and covering
edge scenarios is much easier than at a
service level.
• Internal dependencies are stubbed and
mocked.
• Non-functional requirements such as
end-user authentication, throttling,
monitoring, etc. are implemented at
each and every microservice level.
Unit testing
A1
G3
X1 Z2
D1
C3
A9 D6
B4 D7
B1 X2
Individual
module/Class
testing
• Individual microservice signatures (end points) are the focus with other services that will consume the service under test.
• Test doubles (mocks) are used to simulate the behavior of consumer microservices.
• One end-point at a time is tested.
• Each service is treated as a black box.
• Tests are end-to-end within the bounds of the service.
• Assertion are on response e.g. JSON body.
Contract testing helps:
• Stub-out dependencies.
• Ensure defect identification within
workflows.
• Identify defect for each service in isolation.
• Decrease complexity to test individual
services.
• Stabilize services and providers.
• Set-up test data easily.
• Get instant feedback on individual service.
• Identify unused interface at initial level.
Contract testing
Mock Authentication
Service
Mock Catalog
Service
Mock Payment
Service
Mock Fulfilment
Service
Cart Service
POST /cart/{:product_id}
HTTP Request
JSON
HTTP Response
Test Client
• An integration test verifies the communication paths and interactions between components to detect interface defects. This
is a critical part of testing a microservices for proper inter-service communication.
• Integration testing is done with data stores and external components.
Integration Testing Helps
• Inter-service communication issues.
• Provide additional coverage from unit and
contract testing for each integration point.
• Identify defsect for the following cases of
integration point:
o Integration with data stores
o Gateway Integration
o Inter-service/external component
integration
Integration testing
Resource
Domain
External
Client
ORM
Stubbed
Service
Data Store
• End-to-end testing verifies that the entire process flows correctly, including all services and DB integration.
• End-to-end testing is more business facing as system is deployed and treated as a black box.
• It verifies environment setup, configuration, firewall, proxies, load balancer are correctly configured as well.
End-to-end testing helps:
• Ensure complete correctness and
health of the application.
• Reduce future risk due to coverage
gap.
• Analyze user experience while
using end-to-end workflow and
various aspects of the application.
End-to-end testing
Authentication
Service
Catalog Service
Payment Service
Fulfilment Service
Cart Service
Place and order
Verify that the
order is placed
Mock Mastercard
Mock Logistics
• User interface testing is most important as it tests the system as an end-user and the end user input is random and very
erratic.
• All the databases, interfaces, internal and third-party services must work together seamlessly to get the expected results.
• This is done to verify and validate the user interface.
User Interface testing helps:
• Provide perspective of end user and
therefore can identify the hidden
issue which was not identified earlier
during functional testing.
• Compatibility with multiple browsers
and devices.
UI testing
UI
Cart Service
Authentication
Service
Payment Service
Fulfilment
Service
Mock Mastercard Mock Logistics
Tools to test
microservices
Tool Type of Testing Type of License
SOAP UI
API
Free open source version and Pro Version
Rest- Assured Open source
Postman Open source
SOAtest Open source
PRACT
Contract Testing Open source
PACTO
Janus
AppDynamics
Monitoring
Free 14-day Trial, then from $230 monthly.
TraceView $39.50/host/month
NewRelic Free plan, then from $149 per month.
Jmeter
Performance
testing
Open source
NeoLoad Licensed
Loadrunner Licensed
• Established best practices like the Test Pyramid
• Common tests across all Microservices can turn into a bottleneck, therefore
should be reduced, for example by performing more consumer-driven
contract tests.
• With suitable tools Stubs can be created from Microservices.
Conclusion
Nagarro drives technology-led business breakthroughs for industry leaders and challengers. When our
clients want to move fast and make things, they turn to us. Some of our clients include Siemens, GE,
Lufthansa, Viacom, Estēe Lauder, ASSA ABLOY, Ericsson, DHL, Mitsubishi, BMW, the City of New York, T-
Systems, SAP and Infor. Working with these clients, we continually push the boundaries of what is possible
to do through technology, and in what time frame.
Today, we are more than 5,000 experts across 20 countries. Together we form Nagarro, the global services
division of Munich-based Allgeier SE.

More Related Content

What's hot

Test Automation
Test AutomationTest Automation
Test Automationrockoder
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API TestingBruno Pedro
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous DeliveryMike McGarr
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testingKanoah
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.pptKomal Garg
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with AgileKen McCorkell
 
CI/CD 101
CI/CD 101CI/CD 101
CI/CD 101djdule
 
Test Automation - Principles and Practices
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and PracticesAnand Bagmar
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts pptRathna Priya
 
RESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsQASymphony
 
Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICDKnoldus Inc.
 
Cypress - Best Practices
Cypress - Best PracticesCypress - Best Practices
Cypress - Best PracticesBrian Mann
 
e2e testing with cypress
e2e testing with cypresse2e testing with cypress
e2e testing with cypressTomasz Bak
 
End to end test automation with cypress
End to end test automation with cypressEnd to end test automation with cypress
End to end test automation with cypressPankajSingh184960
 

What's hot (20)

Test Automation
Test AutomationTest Automation
Test Automation
 
"DevOps > CI+CD "
"DevOps > CI+CD ""DevOps > CI+CD "
"DevOps > CI+CD "
 
Cypress Automation
Cypress  AutomationCypress  Automation
Cypress Automation
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous Delivery
 
Test Automation
Test AutomationTest Automation
Test Automation
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testing
 
Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.ppt
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with Agile
 
CI/CD 101
CI/CD 101CI/CD 101
CI/CD 101
 
Test Automation - Principles and Practices
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and Practices
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
 
API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
 
RESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and Jenkins
 
Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICD
 
Cypress - Best Practices
Cypress - Best PracticesCypress - Best Practices
Cypress - Best Practices
 
e2e testing with cypress
e2e testing with cypresse2e testing with cypress
e2e testing with cypress
 
Katalon Studio Presentation.pptx
Katalon Studio Presentation.pptxKatalon Studio Presentation.pptx
Katalon Studio Presentation.pptx
 
End to end test automation with cypress
End to end test automation with cypressEnd to end test automation with cypress
End to end test automation with cypress
 
Test Automation - Keytorc Approach
Test Automation - Keytorc Approach Test Automation - Keytorc Approach
Test Automation - Keytorc Approach
 

Similar to Testing Microservices

Microservices testing strategy-v2
Microservices testing strategy-v2Microservices testing strategy-v2
Microservices testing strategy-v2rajni singh
 
Micro Service automation by Srijit Jain
Micro Service automation by Srijit JainMicro Service automation by Srijit Jain
Micro Service automation by Srijit JainSoftware Testing Board
 
Testing the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the CloudTesting the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the CloudNagarro
 
Whitepaper : Testing Micro Services Part I & Part 2
Whitepaper : Testing Micro Services Part I & Part 2Whitepaper : Testing Micro Services Part I & Part 2
Whitepaper : Testing Micro Services Part I & Part 2Newt Global Consulting LLC
 
Load and performance testing
Load and performance testingLoad and performance testing
Load and performance testingQualitest
 
Navigating the World of Microservices Testing.pdf
Navigating the World of Microservices Testing.pdfNavigating the World of Microservices Testing.pdf
Navigating the World of Microservices Testing.pdfAnanthReddy38
 
Testing microservices, contract testing
Testing microservices, contract testingTesting microservices, contract testing
Testing microservices, contract testingDaria Golub
 
Rethinking Test Automation: The Case for Moving Beyond the User Interface
Rethinking Test Automation: The Case for Moving Beyond the User InterfaceRethinking Test Automation: The Case for Moving Beyond the User Interface
Rethinking Test Automation: The Case for Moving Beyond the User InterfaceCognizant
 
Software Testing includes Performance testing with Load Runner and the JMeter
Software Testing includes Performance testing with Load Runner and the JMeter Software Testing includes Performance testing with Load Runner and the JMeter
Software Testing includes Performance testing with Load Runner and the JMeter Hima Bindu Kosuru
 
Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014Shelley Lambert
 
Ncerc rlmca202 adm m4 ssm
Ncerc rlmca202 adm m4 ssmNcerc rlmca202 adm m4 ssm
Ncerc rlmca202 adm m4 ssmssmarar
 
Cloud Testing by Suganya M
Cloud Testing by Suganya MCloud Testing by Suganya M
Cloud Testing by Suganya MForziatech
 
Experitest & Hexaware Co-Webinar
Experitest & Hexaware Co-WebinarExperitest & Hexaware Co-Webinar
Experitest & Hexaware Co-WebinarExperitest
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumRick Hightower
 
Laravel Load Testing: Strategies and Tools
Laravel Load Testing: Strategies and ToolsLaravel Load Testing: Strategies and Tools
Laravel Load Testing: Strategies and ToolsMuhammad Shehata
 
Testing throughout the software life cycle - Testing & Implementation
Testing throughout the software life cycle - Testing & ImplementationTesting throughout the software life cycle - Testing & Implementation
Testing throughout the software life cycle - Testing & Implementationyogi syafrialdi
 
Chowdappa Resume
Chowdappa ResumeChowdappa Resume
Chowdappa Resumechowdappa o
 

Similar to Testing Microservices (20)

Microservices testing strategy-v2
Microservices testing strategy-v2Microservices testing strategy-v2
Microservices testing strategy-v2
 
Micro Service automation by Srijit Jain
Micro Service automation by Srijit JainMicro Service automation by Srijit Jain
Micro Service automation by Srijit Jain
 
Testing the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the CloudTesting the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the Cloud
 
Whitepaper : Testing Micro Services Part I & Part 2
Whitepaper : Testing Micro Services Part I & Part 2Whitepaper : Testing Micro Services Part I & Part 2
Whitepaper : Testing Micro Services Part I & Part 2
 
Load and performance testing
Load and performance testingLoad and performance testing
Load and performance testing
 
Navigating the World of Microservices Testing.pdf
Navigating the World of Microservices Testing.pdfNavigating the World of Microservices Testing.pdf
Navigating the World of Microservices Testing.pdf
 
Testing microservices, contract testing
Testing microservices, contract testingTesting microservices, contract testing
Testing microservices, contract testing
 
Rethinking Test Automation: The Case for Moving Beyond the User Interface
Rethinking Test Automation: The Case for Moving Beyond the User InterfaceRethinking Test Automation: The Case for Moving Beyond the User Interface
Rethinking Test Automation: The Case for Moving Beyond the User Interface
 
JMeter
JMeterJMeter
JMeter
 
Software Testing includes Performance testing with Load Runner and the JMeter
Software Testing includes Performance testing with Load Runner and the JMeter Software Testing includes Performance testing with Load Runner and the JMeter
Software Testing includes Performance testing with Load Runner and the JMeter
 
Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014
 
Ncerc rlmca202 adm m4 ssm
Ncerc rlmca202 adm m4 ssmNcerc rlmca202 adm m4 ssm
Ncerc rlmca202 adm m4 ssm
 
Cloud Testing by Suganya M
Cloud Testing by Suganya MCloud Testing by Suganya M
Cloud Testing by Suganya M
 
Madhav_Resume
Madhav_ResumeMadhav_Resume
Madhav_Resume
 
Experitest & Hexaware Co-Webinar
Experitest & Hexaware Co-WebinarExperitest & Hexaware Co-Webinar
Experitest & Hexaware Co-Webinar
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO Forum
 
Microservices-101
Microservices-101Microservices-101
Microservices-101
 
Laravel Load Testing: Strategies and Tools
Laravel Load Testing: Strategies and ToolsLaravel Load Testing: Strategies and Tools
Laravel Load Testing: Strategies and Tools
 
Testing throughout the software life cycle - Testing & Implementation
Testing throughout the software life cycle - Testing & ImplementationTesting throughout the software life cycle - Testing & Implementation
Testing throughout the software life cycle - Testing & Implementation
 
Chowdappa Resume
Chowdappa ResumeChowdappa Resume
Chowdappa Resume
 

More from Nagarro

Intelligent automation beyond test execution
Intelligent automation beyond test executionIntelligent automation beyond test execution
Intelligent automation beyond test executionNagarro
 
Flutter: An open-source UI software development kit
Flutter: An open-source UI software development kitFlutter: An open-source UI software development kit
Flutter: An open-source UI software development kitNagarro
 
Remote Collaboration: Working Canvas
Remote Collaboration: Working Canvas Remote Collaboration: Working Canvas
Remote Collaboration: Working Canvas Nagarro
 
Remote Collaboration: Working and Leading from Home
Remote Collaboration: Working and Leading from HomeRemote Collaboration: Working and Leading from Home
Remote Collaboration: Working and Leading from HomeNagarro
 
Chatbot testing
Chatbot testing Chatbot testing
Chatbot testing Nagarro
 
10 Gründe, warum Ihre Testautomatisierung zum Scheitern verurteilt ist
10 Gründe, warum Ihre Testautomatisierung zum Scheitern verurteilt ist 10 Gründe, warum Ihre Testautomatisierung zum Scheitern verurteilt ist
10 Gründe, warum Ihre Testautomatisierung zum Scheitern verurteilt ist Nagarro
 
Integrating AI in software quality in absence of a well-defined requirements
Integrating AI in software quality in absence of a well-defined requirementsIntegrating AI in software quality in absence of a well-defined requirements
Integrating AI in software quality in absence of a well-defined requirementsNagarro
 
Intelligent Digital Mesh Testing
Intelligent Digital Mesh TestingIntelligent Digital Mesh Testing
Intelligent Digital Mesh TestingNagarro
 
Software Quality without Testing
Software Quality without TestingSoftware Quality without Testing
Software Quality without TestingNagarro
 
Advanced Test Automation: Agile Model
Advanced Test Automation: Agile ModelAdvanced Test Automation: Agile Model
Advanced Test Automation: Agile ModelNagarro
 
Testing @ digital speed
 Testing @ digital speed Testing @ digital speed
Testing @ digital speedNagarro
 
How to get started? Digital Transformation: A Down-to-Earth Approach
How to get started? Digital Transformation: A Down-to-Earth ApproachHow to get started? Digital Transformation: A Down-to-Earth Approach
How to get started? Digital Transformation: A Down-to-Earth ApproachNagarro
 
Connecting the dots – Industrial IoT is more than just sensor deployment
Connecting the dots – Industrial IoT is more than just sensor deploymentConnecting the dots – Industrial IoT is more than just sensor deployment
Connecting the dots – Industrial IoT is more than just sensor deploymentNagarro
 
A walk through the AI Use Cases in the Connected Enterprise
A walk through the AI Use Cases in the Connected EnterpriseA walk through the AI Use Cases in the Connected Enterprise
A walk through the AI Use Cases in the Connected EnterpriseNagarro
 
Cloud-enabled analytics
Cloud-enabled analyticsCloud-enabled analytics
Cloud-enabled analyticsNagarro
 
Why Cloud Computing is mandatory for Connected Enterprise
Why Cloud Computing is mandatory for Connected EnterpriseWhy Cloud Computing is mandatory for Connected Enterprise
Why Cloud Computing is mandatory for Connected EnterpriseNagarro
 
Are Your Mobile Apps Secure? (Part I)
Are Your Mobile Apps Secure? (Part I)Are Your Mobile Apps Secure? (Part I)
Are Your Mobile Apps Secure? (Part I)Nagarro
 
Mobile Apps and Security Attacks: An Introduction
Mobile Apps and Security Attacks: An IntroductionMobile Apps and Security Attacks: An Introduction
Mobile Apps and Security Attacks: An IntroductionNagarro
 
Storytelling in Software Development
Storytelling in Software Development Storytelling in Software Development
Storytelling in Software Development Nagarro
 
End-to-End SharePoint Expertise
End-to-End SharePoint ExpertiseEnd-to-End SharePoint Expertise
End-to-End SharePoint ExpertiseNagarro
 

More from Nagarro (20)

Intelligent automation beyond test execution
Intelligent automation beyond test executionIntelligent automation beyond test execution
Intelligent automation beyond test execution
 
Flutter: An open-source UI software development kit
Flutter: An open-source UI software development kitFlutter: An open-source UI software development kit
Flutter: An open-source UI software development kit
 
Remote Collaboration: Working Canvas
Remote Collaboration: Working Canvas Remote Collaboration: Working Canvas
Remote Collaboration: Working Canvas
 
Remote Collaboration: Working and Leading from Home
Remote Collaboration: Working and Leading from HomeRemote Collaboration: Working and Leading from Home
Remote Collaboration: Working and Leading from Home
 
Chatbot testing
Chatbot testing Chatbot testing
Chatbot testing
 
10 Gründe, warum Ihre Testautomatisierung zum Scheitern verurteilt ist
10 Gründe, warum Ihre Testautomatisierung zum Scheitern verurteilt ist 10 Gründe, warum Ihre Testautomatisierung zum Scheitern verurteilt ist
10 Gründe, warum Ihre Testautomatisierung zum Scheitern verurteilt ist
 
Integrating AI in software quality in absence of a well-defined requirements
Integrating AI in software quality in absence of a well-defined requirementsIntegrating AI in software quality in absence of a well-defined requirements
Integrating AI in software quality in absence of a well-defined requirements
 
Intelligent Digital Mesh Testing
Intelligent Digital Mesh TestingIntelligent Digital Mesh Testing
Intelligent Digital Mesh Testing
 
Software Quality without Testing
Software Quality without TestingSoftware Quality without Testing
Software Quality without Testing
 
Advanced Test Automation: Agile Model
Advanced Test Automation: Agile ModelAdvanced Test Automation: Agile Model
Advanced Test Automation: Agile Model
 
Testing @ digital speed
 Testing @ digital speed Testing @ digital speed
Testing @ digital speed
 
How to get started? Digital Transformation: A Down-to-Earth Approach
How to get started? Digital Transformation: A Down-to-Earth ApproachHow to get started? Digital Transformation: A Down-to-Earth Approach
How to get started? Digital Transformation: A Down-to-Earth Approach
 
Connecting the dots – Industrial IoT is more than just sensor deployment
Connecting the dots – Industrial IoT is more than just sensor deploymentConnecting the dots – Industrial IoT is more than just sensor deployment
Connecting the dots – Industrial IoT is more than just sensor deployment
 
A walk through the AI Use Cases in the Connected Enterprise
A walk through the AI Use Cases in the Connected EnterpriseA walk through the AI Use Cases in the Connected Enterprise
A walk through the AI Use Cases in the Connected Enterprise
 
Cloud-enabled analytics
Cloud-enabled analyticsCloud-enabled analytics
Cloud-enabled analytics
 
Why Cloud Computing is mandatory for Connected Enterprise
Why Cloud Computing is mandatory for Connected EnterpriseWhy Cloud Computing is mandatory for Connected Enterprise
Why Cloud Computing is mandatory for Connected Enterprise
 
Are Your Mobile Apps Secure? (Part I)
Are Your Mobile Apps Secure? (Part I)Are Your Mobile Apps Secure? (Part I)
Are Your Mobile Apps Secure? (Part I)
 
Mobile Apps and Security Attacks: An Introduction
Mobile Apps and Security Attacks: An IntroductionMobile Apps and Security Attacks: An Introduction
Mobile Apps and Security Attacks: An Introduction
 
Storytelling in Software Development
Storytelling in Software Development Storytelling in Software Development
Storytelling in Software Development
 
End-to-End SharePoint Expertise
End-to-End SharePoint ExpertiseEnd-to-End SharePoint Expertise
End-to-End SharePoint Expertise
 

Recently uploaded

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
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
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 

Recently uploaded (20)

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
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...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
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
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 

Testing Microservices

  • 2. What are Microservices? Micro-services is an architecture consisting of focused, small services that together create a complete application or task. Every instance of a microservice represents a single responsibility within the solution. Key features of microservices architecture: • Self-contained and componentized • Decentralized data management • Resilient to failures • Built around a single business need • Reasonably small micros
  • 3. Important testing scenarios A good use case of a microservices architecture would include the following scenarios: 1. The system is too big and complex that it becomes difficult to manage. 2. The system is expected to handle high traffic & load and needs to be scalable. 3. Testing between internal microservices and a third- party services. 4. Testing for microservices which needs to be exposed to the public domain.
  • 4. Challenges in testing microservices • Timely availability of all the services for testing. • Complicated extraction of logs during testing and data validation. • Identifying the scope of testing at each service level and integration testing as each component operate on separate services and rely on each other to cover their module and integration with an external service. • The availability of testing environment considering the development strategy is agile. • Distributed and independent nature of a microservice architecture results in the isolation of each component of the architecture from the rest. Thus it needs individual testing and cover all independent services. • Monitoring multiple log files, databases, and servers increases the complexity of tracking down issues or verifying processes.
  • 5. Microservices testing strategy Bottom-up testing approach is an optimized solution which includes: • Test the domain • Tests closer to the code • Integrate Early • Use Mocks / Stubs • Focus is on Test Pyramid • Helps visualize/categorize test coverage better
  • 6. Microservices testing types UI testing Integration testing End to end testing Contract testing Unit testing Exploratory testing Scopeoftesting Executiontime Number of tests
  • 7. • Focuses on one unit (class/module) of a domain • Verifies functionality of one unit • White box & API testing Unit testing helps us in the following ways: • Isolates the logic in places where setting-up all the cases and covering edge scenarios is much easier than at a service level. • Internal dependencies are stubbed and mocked. • Non-functional requirements such as end-user authentication, throttling, monitoring, etc. are implemented at each and every microservice level. Unit testing A1 G3 X1 Z2 D1 C3 A9 D6 B4 D7 B1 X2 Individual module/Class testing
  • 8. • Individual microservice signatures (end points) are the focus with other services that will consume the service under test. • Test doubles (mocks) are used to simulate the behavior of consumer microservices. • One end-point at a time is tested. • Each service is treated as a black box. • Tests are end-to-end within the bounds of the service. • Assertion are on response e.g. JSON body. Contract testing helps: • Stub-out dependencies. • Ensure defect identification within workflows. • Identify defect for each service in isolation. • Decrease complexity to test individual services. • Stabilize services and providers. • Set-up test data easily. • Get instant feedback on individual service. • Identify unused interface at initial level. Contract testing Mock Authentication Service Mock Catalog Service Mock Payment Service Mock Fulfilment Service Cart Service POST /cart/{:product_id} HTTP Request JSON HTTP Response
  • 9. Test Client • An integration test verifies the communication paths and interactions between components to detect interface defects. This is a critical part of testing a microservices for proper inter-service communication. • Integration testing is done with data stores and external components. Integration Testing Helps • Inter-service communication issues. • Provide additional coverage from unit and contract testing for each integration point. • Identify defsect for the following cases of integration point: o Integration with data stores o Gateway Integration o Inter-service/external component integration Integration testing Resource Domain External Client ORM Stubbed Service Data Store
  • 10. • End-to-end testing verifies that the entire process flows correctly, including all services and DB integration. • End-to-end testing is more business facing as system is deployed and treated as a black box. • It verifies environment setup, configuration, firewall, proxies, load balancer are correctly configured as well. End-to-end testing helps: • Ensure complete correctness and health of the application. • Reduce future risk due to coverage gap. • Analyze user experience while using end-to-end workflow and various aspects of the application. End-to-end testing Authentication Service Catalog Service Payment Service Fulfilment Service Cart Service Place and order Verify that the order is placed Mock Mastercard Mock Logistics
  • 11. • User interface testing is most important as it tests the system as an end-user and the end user input is random and very erratic. • All the databases, interfaces, internal and third-party services must work together seamlessly to get the expected results. • This is done to verify and validate the user interface. User Interface testing helps: • Provide perspective of end user and therefore can identify the hidden issue which was not identified earlier during functional testing. • Compatibility with multiple browsers and devices. UI testing UI Cart Service Authentication Service Payment Service Fulfilment Service Mock Mastercard Mock Logistics
  • 12. Tools to test microservices Tool Type of Testing Type of License SOAP UI API Free open source version and Pro Version Rest- Assured Open source Postman Open source SOAtest Open source PRACT Contract Testing Open source PACTO Janus AppDynamics Monitoring Free 14-day Trial, then from $230 monthly. TraceView $39.50/host/month NewRelic Free plan, then from $149 per month. Jmeter Performance testing Open source NeoLoad Licensed Loadrunner Licensed
  • 13. • Established best practices like the Test Pyramid • Common tests across all Microservices can turn into a bottleneck, therefore should be reduced, for example by performing more consumer-driven contract tests. • With suitable tools Stubs can be created from Microservices. Conclusion Nagarro drives technology-led business breakthroughs for industry leaders and challengers. When our clients want to move fast and make things, they turn to us. Some of our clients include Siemens, GE, Lufthansa, Viacom, Estēe Lauder, ASSA ABLOY, Ericsson, DHL, Mitsubishi, BMW, the City of New York, T- Systems, SAP and Infor. Working with these clients, we continually push the boundaries of what is possible to do through technology, and in what time frame. Today, we are more than 5,000 experts across 20 countries. Together we form Nagarro, the global services division of Munich-based Allgeier SE.