PM Articles > Alan S. Koch > Automated Testing - DevOps Enabler

Automated Testing - DevOps Enabler

by Alan S. Koch, PMP

"Automate everything you can." This DevOps principle propels automated testing into a primary enabling position for any organization that embarks on a DevOps journey. No longer an option. No longer something we should do. Either we automate testing or the bright promise of DevOps will remain out of reach.

In this article, we will examine the multiple ways that automated testing is the linchpin that enables the flow of software through the DevOps pipeline. And we will see how it changes -- but does not eliminate -- manual testing. (After all, "everything you can" is not everything.)

What DevOps Is and Is Not

This article builds on the foundation we laid in the prior one, "What DevOps Is and Is Not." If you have not yet read that article, I recommend that you do so now.

…I mean it! Please click the link above and read that article first. I'll wait while you do that…

OK. With that under our belts, let's talk about Automated Testing.

Automate Everything You Can

It should be clear that when we say "automate everything you can," automated testing is included. Most development shops recognize that test automation would be valuable for them, but many haven't found a way to get past the cost of the investment.

With DevOps, test automation is no longer optional. The value we get from automating most of our testing is necessary to achieving the promises of DevOps: innovation and speed combined with operational stability.

Let's look at Gene Kim's Three Ways to see why automated testing is necessary to each. (If you are not familiar with Gene Kim's Three Ways, then you really do need to read the prior article referenced above.)

The First Way: Flow

When we think about the left-to-right flow described by the First Way, we think mainly about the flow of software from Dev to Ops.

In their book Continuous Delivery, Jez Humble and David Farley visualized this flow as a deployment pipeline.

Deployment Pipeline

Figure 1. Deployment Pipeline, from Continuous Delivery, by Jez Humble and David Farley.

This pipeline is a value stream of activities that kicks off every time any developer commits (checks in) a change. (Note that the pipeline graphic pictured above is prototypical, and each organization's pipeline would likely be different from what is pictured.)

In keeping with the objectives of the First Way, release candidates should flow through the pipeline quickly:

  • Humble and Farley specify that the commit stage where all of the basic checking takes place should ideally complete in about five minutes, and under no circumstances should it take more than ten minutes. Clearly, to achieve that goal the unit testing that is part of that stage must be fully automated.
  • In the next two stages, they explicitly specify automated testing and say that each of them should take no more than an hour or so.
  • Next, they show a manual testing stage. (Not all organizations have a manual testing stage in their deployment pipelines.) With all of the automated testing that has preceded this stage, it is clear that manual testing would not represent an extended period of time.

There are two prominent features of the deployment pipeline:

  • Automation is necessary in order to move release candidates through the pipeline in a reasonable amount of time. Achieving flow (the objective of the First Way) requires automation of as much of the pipeline as we can.
  • Testing is a prominent part of every stage of the pipeline right up to release. Test followed by test followed by test!

Although other parts of the deployment pipeline must also be automated, automated testing is what makes it work. If testing is manual, flow cannot be achieved.

The Second Way: Feedback

Continuous Deliveryshows another view of the deployment pipeline in the form of the sequence diagram below.

Akoch-20170406-2

Figure 2. Sequence diagram, from Continuous Delivery.

This view makes it clear that a release candidate progresses through the pipeline only if it passes all tests and other checks. Any fail ends the journey of that release candidate. The development team must make any changes needed to fix the problem and check them in -- creating a new release candidate and starting the pipeline over again.

This sequence diagram also clarifies that each stage of the pipeline provides feedback to the development team, pass or fail. And that feedback comes quickly. The developer sees the results of the automated build and unit test within five or ten minutes -- enough time to get a cup of coffee, but not enough time to have begun working on something else. The feedback from the other test phases comes within an hour or two.

This sort of fast feedback on the quality and correctness of the developers' work can only be achieved with automated tests.

The Third Way: Continual Learning

Automated testing doesn't just enable flow and feedback; it also provides a key input for continual learning and continual improvement. That is because the Third Way represents a completely new attitude toward failures of all kinds, including the defects that are (or should have been) found in test.

Every defect that our testing uncovers will trigger more than just a fix. It will also be an opportunity for the development team to learn by asking, "What mistake was made that resulted in that defect?" and, "How could we improve our engineering or coding practices to prevent that sort of mistake in the future?" As we embrace the Third Way, our development team will be making fewer and fewer mistakes, meaning there will be fewer defects to find, and more release candidates that pass the tests.

But it is not just the developers who benefit. Any defect that escapes testing gives us the opportunity to improve our testing. When a defect is found in automated acceptance testing, we ask, "How did it escape detection in unit testing? How can we improve our unit tests to catch that sort of defect in the future?" When it is found in manual testing, we ask how it escaped detection in the automated testing and how we can improve automated testing. And of course, when a defect makes it to the actual users, we don't just fix it. We also look carefully at all of the testing in our deployment pipeline and make changes to be sure that sort of defect is never missed again.

We can do this sort of introspection and learning because as we automate everything we can, we free ourselves from manual drudgery, and the time we save can be reinvested in process improvement. As most of us well know, when testing is manual, there is little time to think about getting better!

Automated vs. Manual Testing in DevOps

Some kinds of testing must be manual because a person needs to evaluate the results. Demonstrations, user acceptance, and usability are some examples. But the majority of software testing can be automated -- checking technical goodness, verifying requirements have been met (both functional and most nonfunctional), looking for security holes, and so on.

Any testing we can automate, we should automate. And as we do, we will experience more and more DevOps benefits.

A good starting point for learning is ASPE's Test Automation Boot Camp.

Upcoming Webinar

Alan S. Koch will present a webinar on this topic in April 2017. You can sign up for the webinar here. If the webinar has already happened, you can see the recording here.




Comments
Not all comments are posted. Posted comments are subject to editing for clarity and length.

Post a comment




(Not displayed with comment.)









©Copyright 2000-2017 Emprend, Inc. All Rights Reserved.
About us   Site Map   View current sponsorship opportunities (PDF)
Contact us for more information or e-mail info@projectconnections.com
Terms of Service and Privacy Policy

Stay Connected
Get our latest content delivered to your inbox, every other week. New case studies, articles, templates, online courses, and more. Check out our Newsletter Archive for past issues. Sign Up Now

Got a Question?
Drop us an email or call us toll free:
888-722-5235
7am-5pm Pacific
Monday - Friday
We'd love to talk to you.

Learn more about ProjectConnections and who writes our content. Want to learn more? Compare our membership levels.