DevOps and Automated Testing

devops automated testing

Delivering quality software quickly has been a goal of both developers and QA engineers alike for many years, but the definition of ‘quickly’ has changed considerably over the years. In the early 2000s, agile was the name of the game, and 2-week sprints were considered fast. In the early 2020s, delivering software quickly can mean delivering daily, or even multiple times a day.

A number of advancements are responsible for shrinking these timeframes without sacrificing product quality. Automation in the development process has advanced significantly with continuous integration and deployment streamlining the process of pushing new commits. However, for many teams, testing and development are still siloed to different groups that work separately from each other.

This makes development fast but testing slow, which drags on developer velocity. To bridge this gap, many developers have been turning to DevOps to unite testers and developers and to bring the advantages of automation to testing as well as development.

Test Automation and DevOps

Test automation is important because it allows testers and QA engineers to test and deliver results at the same speed as software development. Tools and practices such as continuous integration/continuous deployment (CI/CD) mean that developers may be pushing new commits to a project multiple times a day, each of which will require testing.

Traditionally, testing and development teams were siloed into different departments and worked somewhat independently from one another. In fact, some teams went so far as to create a competitive environment with rivalry between developers and testers. However, when the mutual goal is to develop and deliver quality software, it’s better to work together than against each other to achieve this, which led to the rising popularity of DevOps.

DevOps initially involved uniting developers and IT operations staff. This made it easier to provision, configure and monitor software deployed in cloud environments, as well as paving the way for automated CI/CD pipelines. However, testing was still largely relegated to a separate department with its own practices, which often involved wholly or partially manual testing and represented a bottleneck in the software development life cycle (SDLC).

Test automation can be considered a natural extension of the CI/CD pipeline. Code integration and code deployment are already automated, but both still rely on software testing before new commits can be deployed safely to production. By automating testing, it enables teams to test new products and features at the same speed as development without creating a bottleneck in the delivery process.

Continuous Development

Continuous development refers to the process of creating smaller commits and code changes that are pushed to the main repo on a regular basis. This is in contrast to other development methodologies, such as those that advocate only committing at the end of each workday or upon feature completion. There are several advantages to continuous development as opposed to batching commits. For one, it encourages much shorter SDLCs, as the entire scope of an individual commit is drastically reduced. It also makes pushing and rolling back individual commits much easier and simpler without having side-effects from unrelated changes being batched into large commits, and it means fewer code merge conflicts if several developers are working on the same file. Continuous integration can be practised in isolation, but it is often paired with continuous deployment.

Continuous Testing/Continuous Deployment

Continuous deployment is the latter half of the CI/CD process. When developers switch to continuous development processes, it often makes sense to pair it with continuous deployment. If developers are regularly pushing new features and code changes to the software repo on a continual basis, then it makes sense to also deploy these changes as soon as they are committed. This allows developers to deliver new updates to end-users much faster than the 2-week sprints of agile and other development methodologies. By contrast, CI/CD teams may commit and deploy new changes multiple times a day.

These rapid-pace deployments necessarily require testing, but for many teams, testing is still a siloed process with its own team, tools, and practices. For many teams, testing is a time-consuming process. Certain types of testing are flaky, prone to breaking, and require constant maintenance (such as UI tests and end-to-end testing), which makes automating testing difficult. Flaky and error-prone tests will break the automated delivery pipeline, which impacts the entire DevOps team.

However, automated testing is a necessity in order to work at the same speed as CI/CD and not create a bottleneck in the SDLC. Automated testing requires careful forethought and planning to successfully integrate into the CI/CD process without either breaking or slowing down things, which is why many tools and services are available to help teams do just that.

Test Automation Tools

There are a range of competing tools and services offered to help with test automation. Chances are your team already utilizes a variety of automated testing tools, from using Selenium for cross-browser testing to Puppeteer or CasperJS for headless browser testing.

One particular advantage of using these tools is that they typically support writing tests in the same languages as the software is written in, whether that be Javascript, Rust, Go, Python, Ruby, Java or others. No longer are QA engineers left alone to develop and automate tests. These tools allow developers and other departments to get involved in the development of tests too.

Developers are typically already used to writing unit tests, but unit tests are only one small part of the overall testing process. Integration tests and end-to-end testing are less easily automated compared to unit tests, but no less important. For automating these types of testing, many teams may choose to rely on bespoke services to help develop and run tests that are fully automated.

How Automated Testing Powers DevOps

QA engineers and testers are used to playing a role at the end of the SDLC, when all software changes for a particular cycle have been finished and require testing before being released. DevOps blurs these phases together, meaning that testers no longer represent the end-stage of the process. Instead, testing should be happening continually, even during development. This requires communication and involvement from all departments throughout the SDLC.

In DevOps, testing becomes a team responsibility rather than a specific department’s. It requires all teams working together in communication with each other to successfully automate the development, building, and testing processes, but the advantage of doing so is that it enables developers to make commits early and often with full confidence that they can make code changes quickly and regularly without breaking things.

Start Your Testing Automation Journey

Test automation allows teams to work quickly and deliver code changes and new features on a regular basis with high confidence. When CI/CD teams may commit and merge new code changes several times a day, testing needs to be able to keep up the pace without either blowing up the entire process or causing undue delays.

Certain types of testing are more easily automated than others, much like certain types of testing are more error-prone than others. While bringing teams together under the DevOps umbrella brings in a number of benefits, it also makes it vital that automated tests do not break, or they risk disrupting the entire DevOps process.

In order to begin your testing automation journey, it’s a good idea to seek out advice and support on the best practices and procedures for integrating DevOps and automated testing into your team’s SDLC. Each team’s situation is unique and requires careful consideration in order to implement seamlessly.

If your team is looking to implement automated testing as part of the DevOps process but you’re not quite sure what the best or next step forward should be, then get in touch with a member of ProdPerfect. We have experience working with teams to introduce automated testing that is fast, performant, and high quality.