Shifting Testing Left: How to Get it Right
Shifting Testing Left: How to Get it Right
Shift-left testing needs the right mix of technology and culture.
Join the DZone community and get the full member experience.Join For Free
If your business depends on web and mobile applications to connect with customers and drive transactions — and what business doesn’t these days? — then a great deal of your success or failure as a company hinges on your ability to continuously deliver a flawless digital experience. It’s no surprise then that shift left testing is fast becoming the foundation of the agile development process.
After all, the very idea behind agile development is to enable teams to continually push code and update apps — something you simply can’t do if you’re constantly uncovering bugs at the tail end of the delivery pipeline. Teams thus have no choice but to find ways to run a high volume and wide variety of tests as early in the development cycle as possible.
Of course, shifting testing left is far more complex and nuanced than it sounds. Successful shift-left testing requires the right mix of technology and culture, and not necessarily in that order. Let’s take a closer look at the best practices necessary to get shifting left done right.
Change the Culture
There’s an argument to be made that in the digital era, no group is more critical to a company’s success than its developers. With that great power comes great responsibility, however, and no group is under more pressure to deliver — and deliver repeatedly — than those same developers. So while the idea of adding more to their collective plates might seem counterintuitive, it’s imperative that you do just that.
To successfully shift testing left, development teams need to eventually evolve beyond the legacy notion that developers write code on one end of the process and QA teams run tests on the other. Instead, nurture a culture in which continuous testing is everyone’s responsibility, including developers, and in which developers and QA teams work side-by-side (ideally within the same team and reporting structure) with the shared goal of testing code the instant it’s written.
Early pipeline tests need to be both fast and frequent. What they don’t need to be, however, is comprehensive. You don’t call in the home inspector before the house is finished being built, and you don’t need to run full, end-to-end regression tests when you’ve only just begun writing code. What you need instead are simple-yet-reliable tests that can be run quickly and repeatedly in order to keep developers working productively and the delivery pipeline moving forward.
That’s why headless testing should be part of any modern shift-left testing strategy. Headless testing, which involves running tests without rendering a UI and using containers rather than spinning up VMs, checks all the shift-left boxes. The feedback is fast, the economics are favorable, and the process is lightweight and thus easily repeatable.
While headless testing offers a promising new option for early pipeline testing, what it doesn’t offer is a replacement for traditional cross-browser testing. Remember, shifting left is not an all-or-nothing proposition. It’s a new paradigm through which to view the key pillars of effective continuous testing. Think of headless testing as your starting pitcher, and cross-browser testing as your closer. To win the game and get your apps across the finish line, you’ll still need to leverage cross-browser extensively testing in the later stages of development.
Evolve Beyond Functional
To date, most efforts to shift testing left have revolved around functional tests, or tests designed to ascertain whether the components of an application function as intended. This is indeed a great foundation from which to work, but it doesn’t paint the entire picture. In the digital era, the speed and visual appeal of an app are just as important to consumers as its functionality.
Look, we’ve all been there when a web or mobile app takes forever to load, or the images and text don’t appear correctly on a given browser or mobile device. The app technically “functions” fine, but the experience is far from what’s needed to drive the kind of repeat and referral customers on which businesses thrive.
A successful shift-left strategy thus requires a more complete approach, one in which functional testing is paired with non-functional testing (such as performance testing and visual testing) to give development teams a holistic view into the functionality, usability, and aesthetics of the app they’re gearing up to deliver. Fall short in just one area, and your customers will surely let you know about it.
No Time Like the Present
In business and technology, being the first mover can often be the difference between success or failure. Shift-left testing is no exception. While a growing majority of organizations are keenly aware of the need to ramp up efforts to shift testing left, most are still in the nascent stages of doing so. The window is still open for progressive businesses to prioritize shift-left testing and wield it as a competitive advantage in the digital marketplace.
Opinions expressed by DZone contributors are their own.