﻿# Shift\-left testing

Shift\-left testing is a software development approach that involves testing at the earliest possible stages of the software's lifecycle\. 

In the [classic SDLC](https://en.wikipedia.org/wiki/Systems_development_life_cycle), system testing is performed during the final stages of development, once the system is complete\. If we visualize the potential life cycle on a timeline, the testing phase is usually to the right of the development phase: 

![shiftleft_term/image1.png](https://import.viva64.com/docx/blog/shiftleft_term/image1.png)

In this model, if issues are detected during testing, the system is sent back to earlier stages for revision\. This increases the time and financial costs of software development\. 

The Shift\-left approach ensures system quality at earlier development stages; in other words, the testing phase is moved to an earlier point in the development timeline:

![shiftleft_term/image2.png](https://import.viva64.com/docx/blog/shiftleft_term/image2.png)

This approach offers advantages of speed and cost\-effectiveness when it comes to fixing errors in developed software\. Testing in the early stages enables developers to immediately detect errors and quickly fix them before moving on to the next stages\. 

There are a few ways to implement the Shift\-left approach:

* evaluating the inconsistency or incompleteness of requirements or system usage scenarios; 
* applying the Secure by Design \(SbD\) approach where security is incorporated into the architecture during the design phase rather than added afterward; 
* applying the [TDD](https://en.wikipedia.org/wiki/Test-driven_development) \(test\-driven development\) principle;
* applying the [BDD](https://en.wikipedia.org/wiki/Behavior-driven_development) \(behavior\-driven development\) principle;
* analyzing the code under development \([code reviews](https://pvs-studio.com/en/blog/terms/0073/), use of linters, [static](https://pvs-studio.com/en/blog/terms/0046/) and [dynamic code analyzers](https://pvs-studio.com/en/blog/terms/0070/)\);
* automating tests in CI/CD solutions\.