Shift-Left vs Shift-Right Software Testing Strategies

James Mitchell
By -
0

Shift-left testing moves quality checks during development phases where issues are less costly to fix. Shift-right testing verifies software under real user conditions in production. It is a common practice for teams to view these testing practices as contradicting, but they are not. The teams that successfully deliver consistent, high quality software utilize both practices, knowing precisely the areas of overlap for each testing practice.

Most of the time, their version of "shifting left" is running the same set of integration tests that they scheduled to run late in the development lifecycle, early in the development lifecycle. The only thing that changes is when the tests are scheduled to run. The same bugs still exist, the same slow feedback occurs, and now developers must deal with test case failures for integration tests that are run even more prematurely.

The implementation of testing strategies fails in practice due to solid conceptual frameworks combined with vague and uninformed recommendations.

In this article, I describe the true meaning of shift-left/right testing, and cover the valid and invalid areas of direct comparison of the two strategies. Based on my years of experience, I also explain how I approach this in the enterprise and IT spaces.

Shift-Left vs Shift-Right Software Testing Strategies

 

The Common Mistakes in these Testing Strategies

I will first outline the most common errors in the implementation of these strategies that I have encountered, regardless of the size of the engineering organization.

Most teams tend to shift-left or shift-right in response to a specific event such as a major incident in production, a failed deployment, or a QA backlog that caused a deadline to be missed. Such an entry point has a major influence on the rest of the process. For instance, teams are likely to adopt a shift-left strategy, based on the last most painful event, rather than on where the most defects are likely to originate throughout the process.
This often results in teams that have experienced a major incident in production to focus almost exclusively on shift-right monitoring and ignore the continuous integration (CI) pipeline. Teams that have experienced a major backlog in QA shift-left and focus mostly on improving unit test coverage, but ignore production observability. Both scenarios fail to provide visibility throughout the entire process and create blind spots to the next most painful event.
The most appropriate entry point is a failure distribution audit. Leveraging shift-left and shift-right is an investment. However, for the next four to six weeks, categorize production incidents and escaped defects by root cause and determine where the highest concentration of bugs are along the failure spectrum and at what stage they are detected. This data is critical in developing the most effective strategy, and is likely more important than any incident that has elicited significant attention from executives.  
This step has been omitted in almost all of the guidance that I have seen in regard to DevOps and QA process improvement. However, it is the most important step in preventing organizations from wasting significant amounts of resources on a testing infrastructure focused on the wrong failure modes.

What Is Shift-Left Testing in Software Development?

In testing’s traditional position, final development of code is done and subsequently handed to QA teams for final testing. Shift-left Testing brings Quality Assurance activities much earlier in the Software Development Lifecycle.

Shift-left derives from picturing the activities and phases in the Software Development Lifecycle (SDLC) as a horizontal line, with the phases of Requirements on the left and Deployment and Production activities on the right. Testing left means that testing activities are done as close as possible to Requirements and Coding.

Core Shift-left practices are:
  • Developers self-test code (unit tests) as code is developed, rather than waiting to build the entire feature
  • Static code analysis is done in the developer’s IDE and Continuous Integration (CI) pipelines
  • Test Driven Development (TDD) is the practice of writing tests prior to code implementation
  • Integration tests are executed with every code commit made
  • Service Virtualization is used to enable testing of system functions prior to completion of all dependent systems 

Incorporating Shift-left Testing offers clear economic advantages. According to research done by IBM’s Systems Sciences Institute, finding and fixing process defects in Testing is 6 times more expensive than finding and fixing defects in Construction. It’s 15 times more expensive if the defect reaches Production. Generally, if a defect is found and fixed on the same context in which it was developed, it will take minutes. If the same defect is found in later development (like three sprints later), it is now the responsibility of the same developer to reconstruct the context and rationale for the defect. The time to fix is exponentially longer.
The objective is not improved speed of defect detection. The actual objective is for fewer defects to be created. If your static analysis tool identifies fewer problems as your defect escape rate reduces, then shift-left is working. If you are merely detecting the same amount of defects a bit earlier, nothing has been shifted.

What Does Shift-Right Testing Mean in Software Development?

In Shift-Right testing, the validation of quality actually occurs in production where genuine users and genuine systems operate under genuine conditions. Testing does not conclude at deployment. The testing continues within the working environment.

No staging environment can fully replicate production. The actual volume of data, user behavior, the state of all third-party integrations, the actual network conditions can create situations that testing prior to production cannot fully prepare for. Shift-Right testing is designed to consider that gap.
The main shift-right practices are: 
  • Feature flags: Code is deployed with the features turned off. The features may be turned on for controlled segments and monitored.
  • Canary deployments: Full releases may be done after monitoring for error rate or latency when only a portion of the traffic is sent to the new version.
  • Chaos engineering: Some of the failures are intentionally introduced to production systems to see how the system recovers from the failures and how resilient the system is.
  • Synthetic monitoring: User journeys are script monitored and run on the production system to see if there are regressions on critical paths.
  • Real user monitoring (RUM): User journeys are monitored to see the interaction and time it takes to complete the journey and note any error events.
  • A/B testing: Not only is it important to see if the new features work, but also to see if new features improve the user journey and the user outcome.
Shift-right testing concerns how users really experience the system and shift-left testing concerns how the system is built. It is important to address both, and one does not replace the other.


Shift-Left vs Shift-Right: A Direct Comparison

Factor

Shift-Left

Shift-Right

When it happens

Requirements, development, CI/CD

Staging, production, post-deployment

Primary goal

Prevent defects before they enter the codebase

Validate real-world behavior under actual conditions

Main activities

Unit tests, static analysis, TDD, integration tests

Canary releases, feature flags, chaos engineering, RUM

Feedback source

Code, test results, acceptance criteria

Real users, production telemetry, error logs

Cost of fixing issues

Lowest — caught before release

Higher, but grounded in real data

Risk focus

Building the thing correctly

Building the right thing for real users

Tooling examples

Jest, JUnit, Parasoft, SonarQube, CI runners

Datadog, LaunchDarkly, PagerDuty, Grafana

What it misses alone

Production-specific failures, real user patterns

Bugs that should never have left development

The typical split in mature teams: 70–80% of testing effort sits left (development, CI/CD, staging), with 20–30% focused right (production monitoring, synthetic testing, real user monitoring), according to data from Virtuoso QA. That ratio shifts based on risk profile and regulatory requirements.

Why "Shift Left First" Is Often the Wrong Starting Point

What is being advised to engineering teams working on quality is to first concentrate on shift-left practices first. The unit testing and continuous integration practices should improve first and only then should practices that improve the monitoring of the production environment be adopted.
I do not agree with this process.
If you shift-left automate without recognizing what bugs make it to production, you are optimizing without context. For example, you may build exhaustive unit tests for authentication flows, but subsequently discover 80% of production incidents stem from third-party API failures, which unit tests would not catch. Months of effort will have been spent testing the wrong systems.
I suggest you shift-left build production observability. This can even be at a very basic level. Build this before you build out the rest of the observability stack. First, establish error tracing, latency monitoring, and alerting in production. Proceed to operate this for 4 to 6 weeks. After this, examine where the majority of failures originate from. With this in mind, you may now determine what should be tested earlier in the development lifecycle and where automated testing should be concentrated.
It may be viewed unfavorably to build the “right” infrastructure with the “left” program in a nascent state, but this is the most precise way to design your testing framework. Without this, you are working off educated guesses.

The Shift-Left Mistake That Kills Team Adoption

The most common reason teams fail with shift-left tooling is not because they chose the wrong tools, but rather because the new implementation creates friction in the developer workflow without enough developer side benefits.
More notable than the tools being used shift-left, is the fact that teams adopt the tools at an additional separate process layer.
Building static analysis tools that provide reports for developers outside of their regular workflow report will lead to misuse of the tool. Due to the pressure of time, unit tests that exist in a separate code repository are ignored. Coverage thresholds, presented as CI failures, create noise, not quality, when there is no clear guide for developers on what needs to be done to solve the failure.
This creates self-destructive testing behavior. Complaints about the tools stop innovation. Future planning iterations include a sub-task called "renewing our testing strategy," which perpetuates the cycle.
 
The ideal testing setup includes the following:
  • Static analysis that runs in the IDE, which identifies issues as the code is written, not from a separate queue
  • Unit testing that is implemented with the code that is developed, and the code is owned by a person or group
  • CI that provides testing feedback in less than ten minutes so that developers are not disrupted by the workflow before the feedback is provided
  • A focus on the defection escape rate rather than the coverage percentage
Coverage percentage misses the mark for a successful shift left testing strategy. Tracking the percentage of coverage versus the number of production incidents that test code is a high volume builds an impactful coverage dashboard, but does not address the problem. Assess the defect escape rate. Measure the time from the introduction of a defect to when the defect is identified. Measure the cost of the defect through each stage of its lifecycle. These metrics provide an assessment of the testing strategy.

What the $2.41 Trillion Figure Actually Tells You 

The cost of suboptimal software quality in the United States reportedly reached $2.41 trillion in 2022, according to the Consortium for Information and Software Quality (CISQ). Of that total, technical debt was responsible for $1.52 trillion.
I refer to this statistic not for its dramatic value, but for its clarity concerning the nature of the costs. Most of that amount is not comprised of service outages or other high-impact events. What is most represented is rework, delivery delays, and maintenance burdens which are the result of undetected defects that were discovered late in the software development life cycle.
This statistic makes the economic case for shifting left very clear and very real. Undetected bugs that make it to the Testing and Verification (T&V) stage are more costly to fix than if they had been addressed in the Development (Dev) stage. The same holds true for bugs that make it to the Production stage. The cost is real and persistent across development sprints and manifests in a significant burden to the software development team, preventing them from creating new capabilities.
While shift-right testing provides some value, as it captures what shift-left testing has neglected, the focus should always be on shift-left because that is where the economics are most favorable. The least expensive opportunity to fix a bug in the software development life cycle is when the developer is currently working on that piece of code.

My Concrete Recommendation: Matching Strategy to Failure Profile

There exists no global metric for shift-left vs. shift-right balance. The correct ratio for your team depends where the software fails.

Start with shift-right (the production side of observability), and adjust shift-left based on your findings.

  1. At the minimum, implement error tracking and basic performance monitoring. Sentry and Datadog can be deployed with very little effort, and they provide a baseline to work from.
  2. Run the setup for a period of four to six weeks, and during that time, classify incidents into coding errors, integration failures, data errors, environment issues, and unexpected user behavior.
  3. For each failure category ask the question, “Did this failure have the potential to be caught; and if so, how?” Would this have been caught by unit testing, integration testing, static analysis, or service virtualization?
  4. Construct your shift-left strategy around those outcomes. Consider test coverage and tools in the areas that are causing production failures.
  5. Adjust the ratio every quarter, and as Shift-Left matures and defect escape rate decreases, the production incidents will transform. Adjust as needed.
Shift-left is your best investment choice when: 
  • Defects usually get pushed down to late testing phases and result in costly rework.
  • Requirements become unclear or continuously change throughout the development phase.
  • Your team has a large pool of developers, but your QA resources are limited.

Use shift-right when: 
  • Your software passes all tests in the test environment, yet it fails in production under certain conditions.
  • You need to validate user behavior, not just the correctness of the software.
  • You are in a controlled environment where validation in production is a must, along with validation in the pre-production environment.

Most teams are at around 70% to 80% effort left, and around 20% to 30% effort right. The time it takes to get to that balance is not insignificant. Before you determine how to allocate testing resources, begin with an understanding of your failure distribution. This will help you the most.

Frequently Asked Questions

What is Shift Left Testing and how is it different than Shift Right Testing?

Testing methods cannot be ranked. Shift Left testing minimizes defect costs by identifying defects during the development phase. Shift Right testing assesses the product's behavior as experienced by the actual users. To rely solely on Shift Left testing will produce a lack of testing for production failures. To rely solely on Shift Right testing exposes users to needless bugs. Most established teams utilize both sides of testing with the majority of focus on Shift Left testing, as the more common failure type focuses on development.

What is Shift Left Testing?

The phrase 'shift left testing' refers to the incorporation of more quality assurance steps in the earlier stages of the development lifecycle. Shift Left Testing steps can be visualized on a left to right timeline with the steps and activities on the left and production activities on the right. Shift left activities include unit testing that is performed as the code is developed, the inclusion of static analysis on the developer's IDE, and the creation and execution of tests that are triggered by code commits. The intent is to identify defects while they are less costly to fix.

Can small teams do shift-left and shift-right testing?

Yes. However, at a smaller scale, the required investment in tools is different. For example, a team could easily adopt shift-left testing using a unit testing framework and a CI tool, and adopt shift-right testing using the free tier of an error monitoring service, such as Sentry. The concepts of shift-left and shift-right testing are applicable at every team size. The main limitation for a small team is not the ability, but the need to be able to iterate on the product. Start with basic observability of the production system, use the insights to determine where to focus testing efforts, and iterate from that point.

What tools help with shift-right testing?

Shift-right testing, which is testing in production, is different from testing that is done pre-production, and as such, requires a different set of tools. Some of the tools that may be used include real-time application performance monitoring tools such as Datadog and Grafana, feature flags and controlled rollout tools such as LaunchDarkly and Split, alerting and incident response tools such as PagerDuty, chaos engineering tools such as Gremlin, and error tracking tools such as Sentry. The tools used are largely dependent upon whether the focus of shift-right testing is on validating observability, or testing the bounds of resilience.

Expert Take

Shift-left and shift-right are not competing strategies. They work best when combining a number of failure modes throughout the SDLC. Adjusting testing strategies to become left or right focused will result in potentially costly generic gaps at either end.
The cost of poor software quality (CISQ, 2022) is a rework and maintenance cost of $2.41 trillion each year. This is not from extreme production downtimes, but continuous defects that are discovered too late in the process. The cost of a defect reduced in the development phase vs. the QA phase is significantly less. The cost of a defect reduced in the QA phase vs. the Production phase is also significantly greater.
As noted, I most often observe the unsuccessful application of shift-left testing at the level of process, not tool, concerns. Most commonly found in agile teams, this failure is often treated as a scheduling issue: upcoming iterations of testing are scheduled for earlier points on the testing time horizon, but the means of integrating testing into the development cycle are left unchanged. Tests are simply run at an earlier time, but the defect escape rate remains unchanged.
Building observability of your production level systems will solve most of these problems. Real failure data will guide you with the greatest return on investment. Moving target metrics for coverage are often wild guesses, with some falling within useful ranges, but most failing to deliver.
Defect escape rate as opposed to coverage metrics is the best shift-left testing metric. Stakes testing measures are an expression of concern over how much of code is executed. Escape rate measures testing of code before defective logic escapes to production. These measures are systemically different, and conflating the two, this has caused an upsurge in fitting test and logging systems, without significant impact on production incident levels.
James Mitchell

James Mitchell

He is the Founder and Editor-in-Chief of Techisane. He holds a Master of Science (MS) in Computer Science and a CISSP certification, with eight years of experience in enterprise technology. He began his career working with IT infrastructure before advancing into IT security and consulting. Mitchell brings firsthand experience to his writing, drawing on technologies he has implemented, tested, and worked with in real-world environments.

Tags:

Post a Comment

0 Comments

Post a Comment (0)
3/related/default