Continuous Testing WP
Continuous Testing WP
Continuous Testing WP
IN PRACTICE
Completing the Continuous
Delivery Process
Table of Contents
INTRODUCTION: 1
CONTINUOUS DELIVERY IS THE NORMAL
PART 1:
2
WHY CONTINUOUS DELIVERY?
PART 2:
4
TESTING: THE FINAL BARRIER FOR CONTINUOUS DELIVERY
PART 3:
5
CONTINUOUS DELIVERY WITHOUT CONTINUOUS TESTING
PART 4:
7
HOW CONTINUOUS TESTING FACILITIES CONTINUOUS DELIVERY
PART 5:
11
CONTINUOUS TESTING IN PRECTICE: REQUIREMENTS CHECKLIST
CONCLUSION 13
REFERENCES 14
INTRODUCTION:
CONTINUOUS DELIVERY IS THE NEW NORMAL
Continuous Delivery (CD) is rapidly emerging as the new normal in software development, with
approximately 80% of SaaS companies and 51% of non-SaaS companies adopting this practice1.
Dominant online companies like Amazon, Facebook, and Google have been implementing
aggressive Continuous Delivery workows for years, and deploying release to production
numerous times a week or even multiple times a day. As such, companies failing to make the leap
to Continuous Delivery are falling behind and putting themselves at a signicant competitive
disadvantage.
Despite the widespread, rapid, and perpetually increasing adoption of this practice, it is
apparent that there are deep-rooted barriers preventing companies from the actualization of a
True Continuous Delivery process. Today, the toughest and most challenging barrier is testing.
This whitepaper covers the rise of Continuous Delivery, the key barriers and pain points leading
companies towards inevitable failure, and how to overcome these challenges through
Continuous Testing.
1
?
PART 1:
WHY CONTINUOUS DELIVERY?
Jez Humble, co-author of the Jolt Award winning book on Continuous Delivery, describes the
practice as follows:
Continuous delivery is a set of principles and practices to reduce the cost, time, and risk of
delivering incremental changes to users.2
Continuous Delivery is the Agile Ages answer to traditional waterfall methodologies - the
dominant mode just a few years ago.
In the Waterfall Age, product iterations were linear and sequential, moving from product
marketing specication, through to design, development, QA/testing, and nally deployment
and maintenance. As the name Waterfall indicates, the process can only move forward. Once
a phase in the lifecycle is completed, it proceeds to the next phase and its almost impossible to
turn back.
2
There are numerous aws with this approach. By the time an application gets to testing, its very
difcult to go back and resolve an issue that was caused in the design or implementation stage.
As such, delays are common and application releases and updates usually take many months to
complete.
Continuous Delivery plays a critical role in todays Agile Age. Without it, there is no agility. In an
ideal Continuous Delivery process, the test, support and development teams work closely and
collaboratively to automate and streamline the build, test and release process. Iterations are
short, manual handoffs are eliminated, risks are minimized, and releases are fast and frequent.
As a result, a successful Continuous Delivery process can reduce the time-to-market for new
releases from several months to a matter of days or even hours.
3
PART 2:
TESTING: CONTINUOUS DELIVERYS FINAL BARRIER
Key barriers have been overcome through the widespread adoption of Continuous Integration
(CI) and Continuous Deployment. Continuous Integration, enabled by tools like Jenkins,
TeamCity, and Travis, gave IT organizations the rst component of Continuous Delivery.
Developers integrate code into a shared repository and verify each check-in with an automated
build, enabling the rapid detection and resolution of problems.
As software changes over time, the number of tests required to ensure its quality increases
signicantly. IT organizations do not have the time or manpower to run all the necessary tests
every time a new feature is added. As a result, most companies only execute a small fraction of
these required tests resulting in software quality compromises or an increased
time-to-release.
4
PART 3:
WITHOUT CONTINUOUS TESTING:
WHERE CONTINUOUS DELIVERY FAILS
Testing should be a cross-functional operation which involves the entire technical team
throughout the product lifecycle.
To demonstrate the pain that testing can bring at every step of the Continuous Delivery process,
this paper examines the product pipeline of a mid-sized organization adopting the practice.
Devop teams use a Continuous Integration solution such as Jenkins to run daily builds,
including various post-build tests, to validate the quality of the build.
QA testers validate release candidates prior to their deployment in production with a handful of
automation tools (e.g. JMeter, Loadrunner).
Operations validate releases that were just deployed in production, and monitor the application
further in a post-production environment.
5
Below is a typical example of how these tests points are executed by various roles throughout
the organization.
Developers
Developers perform
unit & module testing
DevOps
Operations/DevOps run a set
of tests on the build (such as
in Continuous Integration)
QA
QA run a more
comprehensive & holistic
set of pre-production tests
Operations
Operations run the same tests
upon deployment and in
post-production - and a monitoring
solution to test on an ongoing basis.
As the example above illustrates, different tools are used by each role in the organization to
perform a wide range of tests. When it comes to testing, the cohesiveness and consistency
between each role is little to none. Each tool needs a script to perform a test, and the script
usually requires the application to be reverse-engineered. For example: it may need to record
the operation and convert this recording into a script the testing tool can understand and
execute.
This issue is exacerbated when the application is updated regularly, as the scripts also need to be
updated. This workow is extremely hard to maintain and will ultimately result in inadequate
testing and a longer time to release.
6
PART 4:
HOW CONTINUOUS TESTING FACILITATES
CONTINUOUS DELIVERY
Continuous Testing involves applying the methods and concepts of agile development to the
testing and QA process, resulting in a more efcient testing process.
For Continuous Testing to succeed, it requires an automated end-to-end testing solution that
integrates into the existing development process, eliminating errors and facilitating true
continuity throughout the development lifecycle.
This paper has already covered the roles and test points in a typical Continuous Delivery
process.
Now, we present these same roles and test points when Continuous Testing is properly
integrated into Continuous Delivery.
DEVELOPERS
Testing must start with the developers, testing the performance and functionality of their own
code by creating and running tests using open source tools such as JMeter or Selenium,
commercial tools like Perfecto mobile or code, i.e Ruby or Python. Tests include API, Functional,
Performance, UI, and more. Regression tests can also be added to the set to ensure functionality
is not compromised and specic scenarios are tested.
Test congurations need to be committed with every code commit. The test conguration
references all tests associated with a certain version of a software module.
To ensure this will be a widely adopted practice, the creation and running of such tests should be
easy, fast, and require minimum prior education and/or experience. Developers can successfully
create and execute these tests without help from consultants, professional services and support
development workows, such as version control, bug tracking systems etc.
7
Once the CI environment is congured to use the right set of tests, developers receive an
automatic message whenever a build fails. They receive sufcient test artifacts to identify the
cause of failure and the tools to be able to keep running the tests until a pass indication is given.
This process should be as fully automated as possible.
Another important item to consider is the speed in which execution needs to happen. Not only is
it important to ensure comprehensive coverage when testing, but it needs to be accomplished
within a reasonable timeframe. Of course, the denition of a reasonable timeframe is purely
subjective. Therefore, its best to attempt to complete the CI process as fast as possible.
QA (PRE-PRODUCTION)
QA needs to validate a release candidate prior to production. As such, they need to run
comprehensive tests to ensure a release candidate is ready for deployment. There are numerous
tests, which include: regression, functional, load, soak, and more. Today, QA testers build scripts
and use tools according to a predened test plan.
As there are sets of tests associated with the release candidates, the QA tester doesnt need to
understand the internals of each release. Any pre-production test should consider the set of
module test congurations and be able to run the right set of tests associated with the release
candidate in the pre-production environment. Again, tests should run in parallel and end as soon
as possible with a clear pass/fail indication, allowing the process to continue smoothly as the
number of tests increase. When congured correctly, they can run continuously and without
human intervention. When theres a failure, the developer should receive a message with the
artifacts and ability to keep running the tests until a pass indication is given.
8
In a Continuous Delivery process, monitoring is yet another form of Continuous Testing. In a
post-production environment, Operations can leverage the set of tests associated with a specic
release to monitor the health of the application on an ongoing basis. There is no need to reverse
engineer, create a script or adapt the script with every change. A comprehensive set of tests can
run 24/7 and send automatic alerts on failures.
Testing that was once cumbersome, complicated and time consuming can be completely
streamlined, ensuring a predictable time-to-release and superior software quality.
9
THE TESTING PROCESS - FROM DEVELOPMENT TO OPERATIONS
Version Control
Repository
Commit Code +
Test Conguration
Developer
Devop
Re-use Build
Comprehensive Testing Test Conguration
Test / Automate
QA
Continuous Deployment
Re-use Release
Acceptance Test Test Conguration
OPs
OPs
Red Arrow = Test Failed Green Arrow = Test Succeeded Blue Arrow = Sent to Testing
10
PART 5:
CONTINUOUS TESTING IN PRACTICE: REQUIREMENTS CHECKLIST
A successful continuous testing process requires the right tools and processes to be adopted
across the various teams within the organization. Without the proper tools in place, the process
will fail.
BlazeMeter developed the following checklist based on its experience helping clients adopt
continuous testing. The checklist provides the features and functionality required for the
continuous testing process to succeed, enabling teams to run tests at scale while also providing
smooth integrations with various CI environments.
11
AUTOMATION
The ability to run any test conguration, a test, or a set of tests using simple API calls
The option to run as many tests as required in parallel
Availability of all test data via a REST API
REPORTING
A seamless integration with existing reporting solutions (e.g. Jenkins Performance Trend)
The option to group tests by builds
The ability to give jobs a pass or fail status and group accordingly
Pass/fail trend reports
Deep dive reports for diagnostics and analysis, which can overlay data from third
party systems (e.g. NewRelic, CloudWatch) for a comprehensive picture.
12
CONCLUSION
To compete in todays environment, its critical to act and react fast in order to keep up with the
rapid pace of change. As such, Continuous Delivery is more than just a new working process, its
a strategic capability that provides organizations with a strong competitive advantage. This
advantage is rapidly becoming the new benchmark; companies that dont adopt agile processes
like Continuous Delivery risk falling beneath todays standards of acceptability.
However, the path to a successful Continuous Delivery process is still incomplete. Continuous
Integration paved the way, rapidly followed by Continuous Deployment. Yet testing has
remained the roadblock in Continuous Deliverys path, thwarting attempts to reduce
time-to-market without quality compromises.
The only viable solution for IT organizations is to integrate a fully automated Continuous Testing
process into their software development lifecycle. There is no room in agile processes for
manual handoffs and quality compromises - they must be fully automated and predictable. As
such, Continuous Testing will become increasingly critical as an inherent piece of any successful
Continuous Delivery process.
13
REFERENCES
6. BlazeMeter
7. Sauce Labs