meghashyam varanasi - associate director cognizant technology...
TRANSCRIPT
Meghashyam Varanasi - Associate Director
Cognizant Technology Solutions
Amplifying feedback through Microservices and Containers
2
01
02
03
04
05
06
Introduction to the Topic
Micro services Vs Services
Bottom up Testing Pyramid
Functional / Non Functional Testing
QA benefits with Containers
Canary releases & role of container QA
3
Understanding the Topic
3 Principles of DevOps Microservices Containers
Service
Small Autonomous
Choice of Technology
Independent deployment
Traditional
Micro Services
One Block
12
34 5
68
Velocity Variation Visualization
Services Vs. Micro services
Autonomous
Decentralized
Independently Scalable
Technology Diversity
Loosely coupled
Characteristics
• Services are independent, cater to be new projects
and language agnostic
• Bits of code comprise services and are loosely
packed
• Intercom via API, specifically by a REST service
Shortcomings
• Service monitoring adds to overheads
• Tracking service failures is a painstaking job
• API calls are sometimes more of an overhead than the monolith intercommunication
Traditional Services
4
Micro Services
5
Layers of Testing in Micro services
Verify interactions at the boundary of an external service asserting that it meets the contract expected by a consuming service.
Verify that a system meets external requirements and achieves its goals, testing the entire system, from end to end.
Exercise the smallest pieces of testable software in the application to determine whether they behave as expected.
GUI Layer
Limit the scope of the exercised software to a portion of the system under test, manipulating the system through internal code interfaces and using test doubles to isolate the code under test from other components.
E2E
Contract Test
Integrated Systems Test
Unit Test
Component Test[Out Process & In Process]
6
Microservice – Functional Testing at various layers
Unit Testing
• Core unit level functionality testing
• Test the lowest level of code
Component Testing
• Full functionality testing of service
• Similar to White box testing
Contract Testing
• Test the contracts the are agreed with other
components/services
• Interactions are verified at the boundary
Integrated Systems Testing
• Data flows, communication paths, Interactions
among microservices
• Integrations code, Protocol level issues
End to End Testing
• Full-fledged testing by covering the overall application in test, infrastructure related items such as firewalls,
proxies, load balancer
7
Microservice – Non Functional Testing
Performance Testing
• Individual microservices need to be tested as
per the desired levels
• System wide performance testing
Session Management & Cache Testing
• Session handling across the Microservices
• Caching at the Microservice & system level
Fail Over and Recovery Testing
• Build a strategy for fail over and recovery of
individual services & test the same
Load Balancing Testing
• Ensure that the containers are instantiated and
load balanced as per the design (Prod)
8
Parallel Testing with Microservices
Contract Tests
Deployto Test
Contract Tests
Contract Tests
Component Test
QualityScan
(Sonar)
UnitTest
BuildDeployto Dev
Contract Tests
Deployto Prod
Deployto Test
Contract Tests
E2E Tests
Contract Tests
Component Test
QualityScan
(Sonar)
UnitTest
BuildDeployto Dev
Contract Tests
Deployto Test
Contract Tests
Contract Tests
Component Test
QualityScan
(Sonar)
UnitTest
BuildDeployto Dev
Contract Tests
Deployto Test
Contract Tests
Integrated Systems
TestContract Tests
Component Test
QualityScan
(Sonar)
UnitTest
BuildDeployto Dev
Serv
ice
1Se
rvic
e 4
Serv
ice
2Se
rvic
e 3
QG1: Unit Test, Code Coverage ,Static Analysis for critical and major violations
– Warning ThresholdQG2: Contract Test QG3: Contract Test , Static Analysis for critical and major violations
– Error ThresholdQG4: Contract TestQG5: Integration Execution status & Test cases in passed state
Any open Critical or major defectsQG6: E2E Execution status & Test cases in passed state
– Any open Critical or major defects
9
What is a Container
A Technology Problem A Shipping Industry Problem A Shipping Industry Solution
10
Container/ Docker in Pictures – Virtual Machine Vs Container
Virtual Machines Containers
• Containers are an abstraction at the app layer that packages code and dependencies together.
• Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in user space.
• Containers take up less space than VMs (container images are typically tens of MBs in size), and start almost instantly.
• Virtual machines (VMs) are an abstraction of physical hardware turning one server into many servers.
• The hypervisor allows multiple VMs to run on a single machine.
• Each VM includes a full copy of an operating system, one or more apps, necessary binaries and libraries -taking up tens of GBs. VMs can also be slow to boot.
Vs
QA Benefits of Containers
Ease of creating QA environments
• Ability to create and terminate containers at
will helps QA teams to bring up Test
Environment with ease
Run more tests and Test faster`
• Parallel tests can be executed on multiple
containers in the test environment
Improved confidence in the production system
• Lesser environment/configuration mismatch
issues
• Improved confidence in the production system
Run testing in environment with slight variation
• Maintain & Test multiple environments with
slight variation depending on the need
12
Canary Release – Container Advantages
Canary Release - Fail Fast to Amplify Feedback
Canary release is a technique to reduce the risk of introducing a new software version in production by slowly rolling out
the change to a small subset of users before rolling it out to the entire infrastructure and making it available to everybody.
When running multiple versions of an application, one needs a quickly way to create copies of the application and make
configuration changes. This is possible with containers, as they can be spun up in seconds, and abstract away the
application from the operating system. Container is ideal for powering canary releases and testing them with confidence.
Blue Green Deployments
Canary Release
13
References & Appendix
1. https://en.wikipedia.org/wiki/Microservices
2. https://en.wikipedia.org/wiki/Docker_(software)
3. https://en.wikipedia.org/wiki/DevOps
4. https://www.docker.com
5. https://martinfowler.com/bliki/CanaryRelease.html
6. https://martinfowler.com/articles/microservices.html
7. https://www.slideshare.net/jpetazzo/introduction-docker-linux-containers-lxc
8. http://blog.christianposta.com/deploy/blue-green-deployments-a-b-testing-and-canary-releases/
9. https://spring.io/blog/2015/07/14/microservices-with-spring
10. https://dzone.com/articles/microservices-basics
14
Author Biography
Meghashyam Varanasi has about 15 years of experience in IT and ITes
industry. He holds an MBA from IIM Ahmedabad & B.Tech Computer
science degree. He is also AWS, PMP, ITIL certified besides few other
technology and domain certifications. Over the years he has been working
in solving various customer problems in the technology leadership space.
15
Q&A