SlideShare a Scribd company logo
1 of 5
Download to read offline
White Paper © 2016 Newt Global Consulting, LLC
CONTINUOUS INTEGRATION / CONTINUOUS DELIVERY
WHITE PAPER
TESTING MICRO SERVICES PART I OF II
Testing Micro Services is an area that cannot be avoided or procrastinated to any point of time. Each
services’ build before it reaches the deployment stage must be ensured that it passes the test criteria
defined by the project team. While the Project team / Organization focusses on Designing and Developing
Applications using Micro Services, it is also equally important to design Testing Strategies to test those
Micro Services. A combination of testing methods along with tools and frameworks that can provide
support at every layer of testing is key. We may not be able stick to the traditional model of testing, as in
an agile environment changes are very dynamic and with a micro service, we would have to deep dive
into each layer to make sure there is not a hit in the production environment.
White Paper © 2016 Newt Global Consulting, LLC Page 2 of 5
INTRODUCTION
The independent nature of Micro Services possesses significant challenges to the Testing team. Picking
the right tools that are inclined to test the Web API, SDK’s that are built around SOA becomes a necessity
factor in order to automate the Testing process. The Test pyramid gets a little wider and deeper with
Integration Testing, Component Testing and Contract Testing coming into the framework above Unit
Testing. A bottom-up approach to testing improves stability of the micro services as they are developed.
It is also very essential to remain light weight while we are implementing the various tests to test a service,
at the same time make sure that there is a coverage to each layer and layers of service.
Monolithic Micro Services
Fig.: Testing Micro Services
Unit Test Unit TestUnit Test Unit Test
Contract Testing
Contract Testing
Component Testing
Component Testing
REST over HTTPS
White Paper © 2016 Newt Global Consulting, LLC Page 3 of 5
UNIT TESTING
Any function has to be tested at the unit level first, by testing the code written by the Developers for a
particular service. Unit Testing is done usually at class level by testing a small piece of behavior and make
sure the code works correctly at the lowest level. Unit Testing focusses on small test suite by testing the
behavior of modules. Test Doubles looks the interactions and collaborations between an object and its
dependencies.
In a micro service, unit tests are most useful in the service layer, where they can verify business logic
under controlled circumstances against conditions provided by mock collaborators. They are also useful
in domain logic, resources, repositories, and adapters for testing exceptional conditions. Unit Tests have
to be executed frequently, with each build. To follow an automated process, we can configure Unit Tests
on a Continuous Integration server (say Jenkins) that constantly monitors for changes in the code.
COMPONENT TESTING
In micro services, components are services that tests a portion of the system. Tests written at this
granularity makes it possible to thoroughly acceptance the test behavior. This is done by creating an
internal interface inside the unit for testing before reaching the production. Component Testing is also
otherwise called ‘Functional Testing’, where the services test to verify integration of all components is
functionally correct that do not require external dependencies. Testing is done in isolation by using mock
components or by creating a Test Service on the same server and test the complexity contained within
that micro service, but make sure that that final application code reaches the production and not the test
code.
The scope is limited to a single component and Testing is done using the same technology that incoming
requests would use, restful api for example. This method also thoroughly tests the network calls for that
particular service and the results are quick, so that developers can gain confidence that whatever changes
they have made, does not affect any other service or component. Test doubles can be configured to isolate
the micro service from external service that allows error conditions tested in a controlled environment
and repeatable manner. Mock implementations can be avoided by testing against external devices with
recorded responses. Though this practice is more realistic and traditional, there is a complexity involved
in order to maintain the recorded responses for each service.
White Paper © 2016 Newt Global Consulting, LLC Page 4 of 5
CONTRACT TESTING
Test for agreed set of input and output attributes is set to be defined as Contract Testing. In other words,
the boundary of an external service is verified that it meets the contract expected by consuming the
service. Contract Testing makes sure that any additions shouldn’t break the existing functionality of the
service, even as the service changes overtime. The production team are well aware of the impact of the
changes on their consumers by looking at the test suites written by the testing team that are well
packaged and runnable in build pipeline for producing services. In Micro Service there is a contract
involved with each of the service that interacts with the Producer.
Mock frameworks can be used to fake responses from external services that gives the possibility to test
services in an isolated environment without relying on external services. They can also be used as
Integration Contract Testing to validate the parameters that are passed to the external service are
integrated to receive the correct request. When there are different teams that run tests for different
services, which means essentially each team have their own contract testing to be executed. A service
contract can be defined by the maintainer by looking at the different contract tests. Service contract can
be used to manage changes as in when they are introduced.
Scenario:
Consider a service that exposes a resource with three fields, an identifier, a location and an order.
White Paper © 2016 Newt Global Consulting, LLC Page 5 of 5
This service is adopted by three different consumers coupled to different parts of the resource. Consumer
A couples to only the identifier and location field. This does not make any claim regarding the order field.
Whereas Consumer B couples to the identifier and order fields, and does not make assert to the location
field. Consumer C requires all three fields and has a contract test suite that affirms they all are present
and communicating.
When a new consumer adopts the API but requires both location and address, the maintainers can choose
to deprecate the location field and introduce another field containing an object with location components.
The maintainers can check the Service contract, remove the old location field and see which contract test
fail. In this case, Consumer A and C would have to be notified on the change. Post migration, the
deprecated field can be removed from Consumer A and C. For this process to be effective, the service
contract need to be updated on a regular basis with fields that are not important.
This is an example of how an API can be changed over a period of time without breaking the contract of
the consumers. To test this efficiency is known to be Contract Testing. These tests can be automated with
a variety of contract testing tools.

More Related Content

What's hot

Cigniti Independent Software Testing Services
Cigniti Independent Software Testing ServicesCigniti Independent Software Testing Services
Cigniti Independent Software Testing ServicesCigniti Technologies Ltd
 
6 Things To Consider When Selecting Mobile Testing Tools?
6 Things To Consider When Selecting Mobile Testing Tools?6 Things To Consider When Selecting Mobile Testing Tools?
6 Things To Consider When Selecting Mobile Testing Tools?headspin2
 
Zephyr Announces New Release of On-Demand Test Management Platform
Zephyr Announces New Release of On-Demand Test Management PlatformZephyr Announces New Release of On-Demand Test Management Platform
Zephyr Announces New Release of On-Demand Test Management Platformxmeteorite
 
QA Automation testing - Cloud deployed workflow application
QA Automation testing - Cloud deployed workflow applicationQA Automation testing - Cloud deployed workflow application
QA Automation testing - Cloud deployed workflow applicationZado Technologies
 
Extreme Automation Enables DirecTV to ”Shift Left” API Testing
Extreme Automation Enables DirecTV to ”Shift Left” API TestingExtreme Automation Enables DirecTV to ”Shift Left” API Testing
Extreme Automation Enables DirecTV to ”Shift Left” API TestingParasoft
 
Leveraging Jama Connect Effectively in a Multi-Tool Environment
Leveraging Jama Connect Effectively in a Multi-Tool EnvironmentLeveraging Jama Connect Effectively in a Multi-Tool Environment
Leveraging Jama Connect Effectively in a Multi-Tool EnvironmentOpsHub Inc.
 
Software testing
Software testingSoftware testing
Software testingAnu j
 
Reducing Cost and Risk of Effective Compliance in Multi-Tool Ecosystem
Reducing Cost and Risk of Effective Compliance in Multi-Tool EcosystemReducing Cost and Risk of Effective Compliance in Multi-Tool Ecosystem
Reducing Cost and Risk of Effective Compliance in Multi-Tool EcosystemOpsHub Inc.
 
Testing for a Great App and Web Experience | QualiTest Group
Testing for a Great App and Web Experience | QualiTest GroupTesting for a Great App and Web Experience | QualiTest Group
Testing for a Great App and Web Experience | QualiTest GroupQualitest
 
10 Software Testing Trends 2019
10 Software Testing Trends 201910 Software Testing Trends 2019
10 Software Testing Trends 2019Rock Interview
 
TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...
TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...
TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...Michael Kuehne-Schlinkert
 
What is web testing in details
 What is web testing in details What is web testing in details
What is web testing in detailsShital Salve
 
Software Testing Services Manual
Software Testing Services ManualSoftware Testing Services Manual
Software Testing Services ManualAlisha Henderson
 
Banking App Testing - To Evaluate Performance
Banking App Testing - To Evaluate PerformanceBanking App Testing - To Evaluate Performance
Banking App Testing - To Evaluate PerformanceBugRaptors
 
isoTracker Solutions Ltd launches an upgrade to the Complaints module
isoTracker Solutions Ltd launches an upgrade to the Complaints moduleisoTracker Solutions Ltd launches an upgrade to the Complaints module
isoTracker Solutions Ltd launches an upgrade to the Complaints moduleKeen Ley
 
Integration testing with PACT
Integration testing with PACTIntegration testing with PACT
Integration testing with PACTKnoldus Inc.
 

What's hot (19)

Cigniti Independent Software Testing Services
Cigniti Independent Software Testing ServicesCigniti Independent Software Testing Services
Cigniti Independent Software Testing Services
 
6 Things To Consider When Selecting Mobile Testing Tools?
6 Things To Consider When Selecting Mobile Testing Tools?6 Things To Consider When Selecting Mobile Testing Tools?
6 Things To Consider When Selecting Mobile Testing Tools?
 
Zephyr Announces New Release of On-Demand Test Management Platform
Zephyr Announces New Release of On-Demand Test Management PlatformZephyr Announces New Release of On-Demand Test Management Platform
Zephyr Announces New Release of On-Demand Test Management Platform
 
QA Automation testing - Cloud deployed workflow application
QA Automation testing - Cloud deployed workflow applicationQA Automation testing - Cloud deployed workflow application
QA Automation testing - Cloud deployed workflow application
 
Extreme Automation Enables DirecTV to ”Shift Left” API Testing
Extreme Automation Enables DirecTV to ”Shift Left” API TestingExtreme Automation Enables DirecTV to ”Shift Left” API Testing
Extreme Automation Enables DirecTV to ”Shift Left” API Testing
 
Leveraging Jama Connect Effectively in a Multi-Tool Environment
Leveraging Jama Connect Effectively in a Multi-Tool EnvironmentLeveraging Jama Connect Effectively in a Multi-Tool Environment
Leveraging Jama Connect Effectively in a Multi-Tool Environment
 
Software testing
Software testingSoftware testing
Software testing
 
Reducing Cost and Risk of Effective Compliance in Multi-Tool Ecosystem
Reducing Cost and Risk of Effective Compliance in Multi-Tool EcosystemReducing Cost and Risk of Effective Compliance in Multi-Tool Ecosystem
Reducing Cost and Risk of Effective Compliance in Multi-Tool Ecosystem
 
Testing for a Great App and Web Experience | QualiTest Group
Testing for a Great App and Web Experience | QualiTest GroupTesting for a Great App and Web Experience | QualiTest Group
Testing for a Great App and Web Experience | QualiTest Group
 
10 Software Testing Trends 2019
10 Software Testing Trends 201910 Software Testing Trends 2019
10 Software Testing Trends 2019
 
47 b 9e3-b98
47 b 9e3-b9847 b 9e3-b98
47 b 9e3-b98
 
TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...
TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...
TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing Microservices
 
Industrialization of testing
Industrialization of testing Industrialization of testing
Industrialization of testing
 
What is web testing in details
 What is web testing in details What is web testing in details
What is web testing in details
 
Software Testing Services Manual
Software Testing Services ManualSoftware Testing Services Manual
Software Testing Services Manual
 
Banking App Testing - To Evaluate Performance
Banking App Testing - To Evaluate PerformanceBanking App Testing - To Evaluate Performance
Banking App Testing - To Evaluate Performance
 
isoTracker Solutions Ltd launches an upgrade to the Complaints module
isoTracker Solutions Ltd launches an upgrade to the Complaints moduleisoTracker Solutions Ltd launches an upgrade to the Complaints module
isoTracker Solutions Ltd launches an upgrade to the Complaints module
 
Integration testing with PACT
Integration testing with PACTIntegration testing with PACT
Integration testing with PACT
 

Viewers also liked (18)

Whitepaper : Event Driven Micro Services
Whitepaper : Event Driven Micro ServicesWhitepaper : Event Driven Micro Services
Whitepaper : Event Driven Micro Services
 
PLAN DE GESTION TICS IE JOSE AGUSTIN MACKENCIE
PLAN DE GESTION TICS IE JOSE AGUSTIN MACKENCIEPLAN DE GESTION TICS IE JOSE AGUSTIN MACKENCIE
PLAN DE GESTION TICS IE JOSE AGUSTIN MACKENCIE
 
Curriculumdoc
CurriculumdocCurriculumdoc
Curriculumdoc
 
Whitepaper : Building an Efficient Microservices Architecture
Whitepaper : Building an Efficient Microservices ArchitectureWhitepaper : Building an Efficient Microservices Architecture
Whitepaper : Building an Efficient Microservices Architecture
 
Ejercicio 3 tema 8
Ejercicio  3 tema 8Ejercicio  3 tema 8
Ejercicio 3 tema 8
 
Tema 5 ejercicio 1
Tema 5 ejercicio 1Tema 5 ejercicio 1
Tema 5 ejercicio 1
 
Presentación1
Presentación1Presentación1
Presentación1
 
Ejercicio 5
Ejercicio 5Ejercicio 5
Ejercicio 5
 
Trabajo fraudes en internet
Trabajo fraudes en internetTrabajo fraudes en internet
Trabajo fraudes en internet
 
Autonomo 2
Autonomo 2Autonomo 2
Autonomo 2
 
PLAN DE GESTION TICS IE JOSE AGUSTIN MACKENCIE
PLAN DE GESTION TICS IE JOSE AGUSTIN MACKENCIEPLAN DE GESTION TICS IE JOSE AGUSTIN MACKENCIE
PLAN DE GESTION TICS IE JOSE AGUSTIN MACKENCIE
 
Whitepaper : Microservices In or Out
Whitepaper : Microservices   In or OutWhitepaper : Microservices   In or Out
Whitepaper : Microservices In or Out
 
Nomina
NominaNomina
Nomina
 
Convergencia Electronica
Convergencia Electronica Convergencia Electronica
Convergencia Electronica
 
Baudrillard and Zoonen
Baudrillard and ZoonenBaudrillard and Zoonen
Baudrillard and Zoonen
 
Ejercicio 4
Ejercicio 4Ejercicio 4
Ejercicio 4
 
Quarks
QuarksQuarks
Quarks
 
з досвіду роботи вчителя.
з досвіду роботи вчителя.з досвіду роботи вчителя.
з досвіду роботи вчителя.
 

Similar to Whitepaper : Testing Micro Services Part I & Part 2

Testing Microservices
Testing MicroservicesTesting Microservices
Testing MicroservicesNagarro
 
journal of engineering and applied science.pdf
journal of engineering and applied science.pdfjournal of engineering and applied science.pdf
journal of engineering and applied science.pdfKSAravindSrivastava
 
research journal publication
research journal publication research journal publication
research journal publication chaitanya451336
 
research journal publication
research journal publication research journal publication
research journal publication chaitanya451336
 
scopus indexed journals list.pdf
scopus indexed journals list.pdfscopus indexed journals list.pdf
scopus indexed journals list.pdfKSAravindSrivastava
 
journal of engineering and applied science.pdf
journal of engineering and applied science.pdfjournal of engineering and applied science.pdf
journal of engineering and applied science.pdfKSAravindSrivastava
 
ijlbpr_64ab991977359.pdf
ijlbpr_64ab991977359.pdfijlbpr_64ab991977359.pdf
ijlbpr_64ab991977359.pdfchaitanya451336
 
Continuous Testing of Service-Oriented Applications Using Service Virtualization
Continuous Testing of Service-Oriented Applications Using Service VirtualizationContinuous Testing of Service-Oriented Applications Using Service Virtualization
Continuous Testing of Service-Oriented Applications Using Service Virtualizationiosrjce
 
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
 
Test Automation in a Microservices Architecture.pdf
Test Automation in a Microservices Architecture.pdfTest Automation in a Microservices Architecture.pdf
Test Automation in a Microservices Architecture.pdfRiley Claire
 
Ensuring Effective Performance Testing in Web Applications.pdf
Ensuring Effective Performance Testing in Web Applications.pdfEnsuring Effective Performance Testing in Web Applications.pdf
Ensuring Effective Performance Testing in Web Applications.pdfkalichargn70th171
 
Some practical considerations and a
Some practical considerations and aSome practical considerations and a
Some practical considerations and aijseajournal
 
CTD for client signoff and early requirements validation - 11th IEEE SW Eng...
CTD for client signoff and early requirements validation   - 11th IEEE SW Eng...CTD for client signoff and early requirements validation   - 11th IEEE SW Eng...
CTD for client signoff and early requirements validation - 11th IEEE SW Eng...Saritha Route
 
Implementing a testing strategy
Implementing a testing strategyImplementing a testing strategy
Implementing a testing strategyDaniel Giraldo
 
An Ultimate Guide to Continuous Testing in Agile Projects.pdf
An Ultimate Guide to Continuous Testing in Agile Projects.pdfAn Ultimate Guide to Continuous Testing in Agile Projects.pdf
An Ultimate Guide to Continuous Testing in Agile Projects.pdfKMSSolutionsMarketin
 

Similar to Whitepaper : Testing Micro Services Part I & Part 2 (20)

Testing Microservices
Testing MicroservicesTesting Microservices
Testing Microservices
 
Testing.pptx
Testing.pptxTesting.pptx
Testing.pptx
 
journal of engineering and applied science.pdf
journal of engineering and applied science.pdfjournal of engineering and applied science.pdf
journal of engineering and applied science.pdf
 
ugc journal.pdf
ugc journal.pdfugc journal.pdf
ugc journal.pdf
 
research journal publication
research journal publication research journal publication
research journal publication
 
research journal publication
research journal publication research journal publication
research journal publication
 
ugc carelist.pdf
ugc carelist.pdfugc carelist.pdf
ugc carelist.pdf
 
ugc journal.pdf
ugc journal.pdfugc journal.pdf
ugc journal.pdf
 
scopus indexed journals list.pdf
scopus indexed journals list.pdfscopus indexed journals list.pdf
scopus indexed journals list.pdf
 
journal of engineering and applied science.pdf
journal of engineering and applied science.pdfjournal of engineering and applied science.pdf
journal of engineering and applied science.pdf
 
ijlbpr_64ab991977359.pdf
ijlbpr_64ab991977359.pdfijlbpr_64ab991977359.pdf
ijlbpr_64ab991977359.pdf
 
M017258892
M017258892M017258892
M017258892
 
Continuous Testing of Service-Oriented Applications Using Service Virtualization
Continuous Testing of Service-Oriented Applications Using Service VirtualizationContinuous Testing of Service-Oriented Applications Using Service Virtualization
Continuous Testing of Service-Oriented Applications Using Service Virtualization
 
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
 
Test Automation in a Microservices Architecture.pdf
Test Automation in a Microservices Architecture.pdfTest Automation in a Microservices Architecture.pdf
Test Automation in a Microservices Architecture.pdf
 
Ensuring Effective Performance Testing in Web Applications.pdf
Ensuring Effective Performance Testing in Web Applications.pdfEnsuring Effective Performance Testing in Web Applications.pdf
Ensuring Effective Performance Testing in Web Applications.pdf
 
Some practical considerations and a
Some practical considerations and aSome practical considerations and a
Some practical considerations and a
 
CTD for client signoff and early requirements validation - 11th IEEE SW Eng...
CTD for client signoff and early requirements validation   - 11th IEEE SW Eng...CTD for client signoff and early requirements validation   - 11th IEEE SW Eng...
CTD for client signoff and early requirements validation - 11th IEEE SW Eng...
 
Implementing a testing strategy
Implementing a testing strategyImplementing a testing strategy
Implementing a testing strategy
 
An Ultimate Guide to Continuous Testing in Agile Projects.pdf
An Ultimate Guide to Continuous Testing in Agile Projects.pdfAn Ultimate Guide to Continuous Testing in Agile Projects.pdf
An Ultimate Guide to Continuous Testing in Agile Projects.pdf
 

More from Newt Global Consulting LLC

More from Newt Global Consulting LLC (6)

Why Cloud and DevOps are interlinked?
Why Cloud and DevOps are interlinked?Why Cloud and DevOps are interlinked?
Why Cloud and DevOps are interlinked?
 
Webinar : Microservices and Containerization
Webinar : Microservices and ContainerizationWebinar : Microservices and Containerization
Webinar : Microservices and Containerization
 
Webinar : Docker in Production
Webinar : Docker in ProductionWebinar : Docker in Production
Webinar : Docker in Production
 
Webinar Docker Tri Series
Webinar Docker Tri SeriesWebinar Docker Tri Series
Webinar Docker Tri Series
 
Demystify DevOps
Demystify DevOpsDemystify DevOps
Demystify DevOps
 
Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
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
 
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
 
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
 
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
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
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
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
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
 
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
 
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
 
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...
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
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...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Whitepaper : Testing Micro Services Part I & Part 2

  • 1. White Paper © 2016 Newt Global Consulting, LLC CONTINUOUS INTEGRATION / CONTINUOUS DELIVERY WHITE PAPER TESTING MICRO SERVICES PART I OF II Testing Micro Services is an area that cannot be avoided or procrastinated to any point of time. Each services’ build before it reaches the deployment stage must be ensured that it passes the test criteria defined by the project team. While the Project team / Organization focusses on Designing and Developing Applications using Micro Services, it is also equally important to design Testing Strategies to test those Micro Services. A combination of testing methods along with tools and frameworks that can provide support at every layer of testing is key. We may not be able stick to the traditional model of testing, as in an agile environment changes are very dynamic and with a micro service, we would have to deep dive into each layer to make sure there is not a hit in the production environment.
  • 2. White Paper © 2016 Newt Global Consulting, LLC Page 2 of 5 INTRODUCTION The independent nature of Micro Services possesses significant challenges to the Testing team. Picking the right tools that are inclined to test the Web API, SDK’s that are built around SOA becomes a necessity factor in order to automate the Testing process. The Test pyramid gets a little wider and deeper with Integration Testing, Component Testing and Contract Testing coming into the framework above Unit Testing. A bottom-up approach to testing improves stability of the micro services as they are developed. It is also very essential to remain light weight while we are implementing the various tests to test a service, at the same time make sure that there is a coverage to each layer and layers of service. Monolithic Micro Services Fig.: Testing Micro Services Unit Test Unit TestUnit Test Unit Test Contract Testing Contract Testing Component Testing Component Testing REST over HTTPS
  • 3. White Paper © 2016 Newt Global Consulting, LLC Page 3 of 5 UNIT TESTING Any function has to be tested at the unit level first, by testing the code written by the Developers for a particular service. Unit Testing is done usually at class level by testing a small piece of behavior and make sure the code works correctly at the lowest level. Unit Testing focusses on small test suite by testing the behavior of modules. Test Doubles looks the interactions and collaborations between an object and its dependencies. In a micro service, unit tests are most useful in the service layer, where they can verify business logic under controlled circumstances against conditions provided by mock collaborators. They are also useful in domain logic, resources, repositories, and adapters for testing exceptional conditions. Unit Tests have to be executed frequently, with each build. To follow an automated process, we can configure Unit Tests on a Continuous Integration server (say Jenkins) that constantly monitors for changes in the code. COMPONENT TESTING In micro services, components are services that tests a portion of the system. Tests written at this granularity makes it possible to thoroughly acceptance the test behavior. This is done by creating an internal interface inside the unit for testing before reaching the production. Component Testing is also otherwise called ‘Functional Testing’, where the services test to verify integration of all components is functionally correct that do not require external dependencies. Testing is done in isolation by using mock components or by creating a Test Service on the same server and test the complexity contained within that micro service, but make sure that that final application code reaches the production and not the test code. The scope is limited to a single component and Testing is done using the same technology that incoming requests would use, restful api for example. This method also thoroughly tests the network calls for that particular service and the results are quick, so that developers can gain confidence that whatever changes they have made, does not affect any other service or component. Test doubles can be configured to isolate the micro service from external service that allows error conditions tested in a controlled environment and repeatable manner. Mock implementations can be avoided by testing against external devices with recorded responses. Though this practice is more realistic and traditional, there is a complexity involved in order to maintain the recorded responses for each service.
  • 4. White Paper © 2016 Newt Global Consulting, LLC Page 4 of 5 CONTRACT TESTING Test for agreed set of input and output attributes is set to be defined as Contract Testing. In other words, the boundary of an external service is verified that it meets the contract expected by consuming the service. Contract Testing makes sure that any additions shouldn’t break the existing functionality of the service, even as the service changes overtime. The production team are well aware of the impact of the changes on their consumers by looking at the test suites written by the testing team that are well packaged and runnable in build pipeline for producing services. In Micro Service there is a contract involved with each of the service that interacts with the Producer. Mock frameworks can be used to fake responses from external services that gives the possibility to test services in an isolated environment without relying on external services. They can also be used as Integration Contract Testing to validate the parameters that are passed to the external service are integrated to receive the correct request. When there are different teams that run tests for different services, which means essentially each team have their own contract testing to be executed. A service contract can be defined by the maintainer by looking at the different contract tests. Service contract can be used to manage changes as in when they are introduced. Scenario: Consider a service that exposes a resource with three fields, an identifier, a location and an order.
  • 5. White Paper © 2016 Newt Global Consulting, LLC Page 5 of 5 This service is adopted by three different consumers coupled to different parts of the resource. Consumer A couples to only the identifier and location field. This does not make any claim regarding the order field. Whereas Consumer B couples to the identifier and order fields, and does not make assert to the location field. Consumer C requires all three fields and has a contract test suite that affirms they all are present and communicating. When a new consumer adopts the API but requires both location and address, the maintainers can choose to deprecate the location field and introduce another field containing an object with location components. The maintainers can check the Service contract, remove the old location field and see which contract test fail. In this case, Consumer A and C would have to be notified on the change. Post migration, the deprecated field can be removed from Consumer A and C. For this process to be effective, the service contract need to be updated on a regular basis with fields that are not important. This is an example of how an API can be changed over a period of time without breaking the contract of the consumers. To test this efficiency is known to be Contract Testing. These tests can be automated with a variety of contract testing tools.