build a remote testing capability! dockerize your testing ......testing • qa best practice in...
TRANSCRIPT
Build a remote testing capability!
Dockerize your testing to enable virtual
environments
Ref: 2020 Docker Inc
Webinar
Today’s Webinar
Bryon LowenTessolve -Software testing lead
Mounika KoduriTessolve – SDET
Sankar D RaoTessolve – SDET
Agenda• Benefits of Dockerizing your
testing• QA best practice in using Docker
environments• Tips in creating your virtual
Docker containers• How to integrate SonarQube for
code coverage • Understand Docker driven test
automation
Benefits of Dockerizing your testing
Why Docker?
• Docker accelerates your workflow
• Developing apps today requires so much more than writing code.
• Complexity:
• Multiple languages
• Frameworks
• Architectures
• Interfaces
Incredible adoption in just 4 years!
Ref: 2020 Docker Inc
Docker Benefits• Agility
• Portability
• Security
• Cost savings
Why Docker is Hot!• Its simple
• Developers love it
Dev / test of legacy apps
New app dev
Code agility, CI/CD pipeline
DevOps adoption
Microservices & cloud
Docker Ecosystem
QA best practice in
using Docker environments
Historical limitations of app deployment
• Slow
• Costs
• Wasted resources
• Difficult to scale
• Difficult to migrate
• Vendor lock in
Application
Operating System
Physical server
Hypervised-based Virtualization
© 2019, Vipin Joshi. All Rights Reserved
Unlocking Containers
• A standardized unit of software that allows developers to isolate their app from its environment
• De facto standard to build and share containerized apps
• For Quality assurance:
• Clean builds
• Separate sections
• Is the defect a bug or env
Docker containers
Containers and VMs together
Conference: A Hybrid Genetic Programming: Boxiong Tan . All Rights Reserved
Benefits of Docker containers
Creating your virtual Docker
containers
Excellent Use Cases for Containers
Ready to Run Application Stacks
New App Dev & Microservices
One-Time Run jobs and Analytics
Build your own Paas
Front-End App Servers
Increase server density
Create secure sandboxes
Create your own SaaS
Automated application deployment
Continuous Integration and Deployment
Lightweight Desktop Virtualization
Docker Dictionary
• Images:
• Base image
• Child image
• Containers
• Docker daemon
• Docker client
• Docker hub
Docker Architecture
Containers as a Service
Docker CLI – Common / useful commands
• docker build : build docker image from Dockerfile
• docker run : run docker image• docker logs : show log data for a running
or stopped container
• docker ps : list running docker containers (analogous to ps)
• docker ps –a : list all containers including not running
• docker images : list all images on the local volume
• docker rm : remove/delete a container | docker rmi : remove/delete an image
• docker tag : name a docker image
• docker login : login to registry
• docker push/pull : push or pull volumes to/from Docker Registries
• docker inspect : return container run time configuration parameter metadata
Dockerfile
Demo -Docker commands hands-on
Docker Compose
Docker Tool for defining and running multi-container Docker applicationsReference file defined in YAMLdocker-compose.yml
$ docker-compose up -d
Allocation of images to hosts
Swarm Master
How to integrate
SonarQube for code coverage
Tracking and improving
software quality with
Overview
● Code quality (what, why
and when)
● SonarQube introduction
● How does it work?
● Integration with Maven
Project.
What is code quality?
“It’s an indicator about how quickly
developers can add business value to
a software system”
Why measure?
● Source code is the heart of each system
● Developers don’t write new software. They
maintain “legacy” systems
● A system is (almost) never “finished”
● You can’t improve if you don’t measure
● Broken window theory
When you should measure?
● From project day #1
● Continuously
● Prevent vs post-actions
● Prioritize and plan
What SonarQube is?
● Free & open source “Code Quality Platform”
● Provides moment-in-time quality snapshots
● Gives trends of lagging and leading
indicators
● Tracks developers’ seven deadly sins (seven
axes of quality )
How does it work?
● Analyzes source code and byte code
● Computes hundreds of metrics
● Associates metrics with analysis
snapshots
● Shows the results in dashboards
and widgets accessible by any
browser
SonarQube for everything
● Initially developed only for Java projects
● Today supports over twenty languages
Open Source : C++, C#, Flex, Groovy, Android,
Javascript, PHP, Python, XML,
Web(xhtml, jsp , jsf, )
Commercial : ABAP, C, C++, Cobol, Natural, PL/SQL, Visual
Basic
… and for everyone
● For developers. Is my code “good”? How can I improve it?
● For testers / QA staff. Which parts of the system lack unit
testing?
● For architects. Is the initial design “broken”? How about
complexity?
● For managers. Give me the numbers!! Are we going up or down?
Sonar Integration with
Maven Project
● Download and install SonarQube from URL
● Define sonar properties, jacoco.exec file path,
sonar dependency plugins Jacoco-maven-plugin,
Maven-compiler-plugin and maven-surefire-plugin)
● Push code coverage to sonar server using below
command from local/jenkins
mvn clean install sonar:sonar -
Dsonar.host.url=http://10.80.200.8 -
Dsonar.jacoco.reportPath=target/jacoco.exec
Sonar Properties
Sonar Plugins
Code Coverage & Quality Gate
Code Measures
Understand Docker driven
test automation
Test Automation Pre Req’s
● Docker Setup
● Sonar Integration with Maven/Gradle.. etc.
● Jenkins Job creation with Docker Swarm Cluster
for Unit / Integration Testing.
● Run the job and get the code quality report
through email.
Docker Driven Test
Automation Flow Chart
Docker Driven Unit Test
Reports
Docker Driven
Unit + Integration Test Reports
Summary
Q & A
Summary
• Docker accelerates your workflow
• Containers are a standardized unit of software
• For Quality assurance:
• Clean builds
• Separate sections
• Is the defect a bug or environment issue
• Integrate SonarQube to enable code coverage & quality
• Use docker environments to drive quality automation pipeline
Q & A
Thankyou