DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. DevOps and The Shift-Left Principle

DevOps and The Shift-Left Principle

Catch bugs quicker and make more secure products with a shift-left security strategy.

Saurabh Gupta user avatar by
Saurabh Gupta
CORE ·
Jun. 24, 19 · Analysis
Like (4)
Save
Tweet
Share
13.54K Views

Join the DZone community and get the full member experience.

Join For Free

image title


generally, when we talk about devops, we are mostly focused on faster and continuous deployment, automation, and monitoring the system for errors and failures.

at times, what we often neglect is the testing part of a devops implementation.

today i am going to discuss the “ shift-left” principle and how to do it the devops way. i know that it is not a new concept, but for those of you who do not know the “shift-left” principle, let me try to elaborate.

what do we actually mean by “shifting left”?

consider a regular software lifecycle, which typically moves from left to right:

design >> develop >> test >> deployment >> production monitoring

the shift-left concept emphasis that the more effort that is shifted towards the left, or earlier, in the lifecycle process, the fewer the chances of errors or failures. in other words, it talks about identifying bugs and errors at an early stage and preventing them rather than solving them later. as we know, “ prevention is always better than the cure.”

the goal is to have better quality application code, shorter testing cycles and deployment time, and an error-free production environment. no one wants unwelcome surprises during deployment, and an unstable production environment is the worst nightmare for a devops team.

shift-left in a devops way

so when we talk about “shift left” in a devops context, we normally refer to these devops processes as:

  1. continuous testing
  2. continuous deployment
  3. continuous security (often a part of devsecops)

software testing itself is not a single process; there are several types of testing involved, and we do have the concept of shift-left testing as well. using devops automation tools, a shift-left approach can have the following benefits:

  • less code errors while deployment.
  • increased test coverage by able to run more tests at the same time.
  • short testing and deployment cycles and faster delivery.
  • a more stable production environment, as bugs are identified and fixed at earlier stages itself.


how to "shift-left"

there are many ways on how to implement a “shift-left” approach and vaies from organization to organization. in general, some of the ways to follow a “shift-left” principle in devops are:

  1. design, review, and freeze your architecture decisions early in the cycle, so that developers get the right understanding before even starting to code.
  2. do not make too many frequent changes in your architecture, as this confuses the development team.
  3. the development team should follow a tdd approach, to identify the potential bugs in initial stages itself.
  4. the development team should be in-sync with the ops team. as far as the dev environment setup is concerned, it should be as close to a real production environment as possible.
  5. the testing/qa teams should also work closely with the dev teams, so that they can understand the flow and write test cases wherever possible. this will also ensure high code coverage.
  6. the qa/testing team should try to automate all the test cases, using the devops automation tools. with all test suites automated, the chances of manual errors would be minimum.
  7. also, the testing/qa environment should be continuously in sync with the live production environment, or if possible a replica (if budget permits).
  8. the continuous deployment tools should have another set of test suites to run before the final deployment happens.

by following the above pointers, we should be able to have a “shift-left” based devops implementation, which will ensure that we are able to identify and fix any potential bugs or errors before deployment itself,  ensuring a more confident, bug-free deployment and stable production system.

remember the key idea is to, “identify and fix the errors, before they can reach a production environment.” the sooner the better.

DevOps

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Use Terraform to Provision an AWS EC2 Instance
  • Building a Scalable Search Architecture
  • Microservices Discovery With Eureka
  • The 12 Biggest Android App Development Trends in 2023

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: