Engineering

Have You Heard About Shift Left?

Have You Heard About Shift Left?

When releasing your development code to production, are you confident everything will work as expected? If your answer is yes, I would be really impressed. Let’s add another variable… what if it’s Friday at 5 pm? Are you still as confident?

Imagine that you are working on a feature, finished your code, added tests, and you’re ready to release. Wouldn’t it be amazing to just hit merge and forget about it? If all validations pass, you are certain your feature works, but also if the validations don’t pass, you can also relax because it will not get to production with bugs. This is indeed amazing but it’s not an easy thing to do. 

Having a process where all members of the team are confident in releasing directly to production depends not only on the way to do things technically, adding validation pipelines, PR checks, etc., it is also about mindset.

What is Shift Left?

Shift Left is not only an evolutionary process, it is also an approach to your software development life cycle. The Shift Left approach integrates testing into every phase of the software development life cycle. But, what does it mean? Essentially, it is having the team thinking about how each step from the feature requirements creation to the release to production is covered under a quality validation. 

Usually, teams validate features until these are deployed in environments like QA, staging, or development, focusing only on functionality. But what about the quality in requirements, code standards, unit tests, documentation, and how features are moved from an SOW or backlog to in progress and then to done? A good QA covers every step in the process, not just one.  

Talking about the phase of running tests and automate validations, is usual having teams with their software development life cycle running tests in one step of their complete process creating a bottleneck. When following Shift Left, automated tests can be distributed, created and executed before getting to staging or even development environments. One of the biggest proposals is to define a process where each feature is delivered as a Definition of Done with its corresponding, linting, unit test and all other automated validations needed like functional or visual as part of the requirements to create a PR, merge and move the actual task to be done. 

Benefits of Shift Left Testing

  • Detects and prevents defects early in the software development life cycle
  • Shorter time to release
  • Lower risks and costs
  • Can use a combination of methodologies and frameworks
  • Get the team working closer to QA

Great! How can I start? First, you must understand that Shift Left is not a special type of testing. It is more about when the testing is done, and it is done earlier in the software development life cycle. With this in mind, you can start considering:  

  • Are requirements clear and do they cover what you need to start working on?
    • Pro Tip: Have a documented Definition of Ready.
  • What is required to move a task from the backlog to in progress, and when is a task considered done?
    • Pro Tip: Have a documented Definition of Done.
  • Am I covering edge cases in my tests for the feature?
    • Pro Tip: Set a minimum coverage threshold.
  • Am I following the code standards?
    • Pro Tip: Add custom rules and a linter to your project.
  • Can validations be automated, what is the best framework?
    • Pro Tip: Use requirements on delivery to define the correct tool stack.
  • Can validations be checked earlier in my development process?
    • Pro Tip:  Don’t just think about the code, but also about the quality of each step of your process. Requirements, documentation, and definitions of done/ready for each step of your software development life cycle are good examples.
  • Can I develop my feature adding test from the beginning?
    • Pro Tip: If you deliver your feature with added automated tests, your feature could be validated in your PR’s automated checks. The team will know if something is wrong even before start reviewing.

Shift Left Is Not a How but a When

In summary, what are the validations, checks and quality steps that would take part of each part of your team process to deliver a feature? It depends, because, each team is different. But if you want to go home on a Friday at 5 pm after releasing to master (production) with peace of mind, then give Shift Left a chance. 

Written by Cristian Ceja
Written by Cristian Ceja

Nellie Luna

Posted by Nellie Luna on November 12, 2019