We’ve been building our knowledge of DevOps, learning how CI/CD pipelines automate testing and deployment. Now, let’s explore a crucial concept that works hand-in-hand with CI/CD: Shift Left testing. This approach changes how we think about testing, making it a proactive part of development, not just a final check.
Understanding Shift Left: Testing From the Start
Imagine we’re building a cake. Traditionally, we might only taste the cake after it’s fully baked and decorated. This is like waiting until the end of development to test software.
Shift Left means we taste the batter before we bake, check the oven temperature during baking, and even taste the frosting before it goes on the cake. We’re testing every ingredient and step along the way.
In software, it means we start testing earlier in the development process. We’re involved from the planning stages, during coding, and throughout the entire lifecycle.
How Our CI/CD Examples Show Shift Left in Action
Let’s revisit our previous article, “Beyond Bug Reports: CI/CD in Action — Scenarios and Our Role in Continuous Delivery/Deployment,” and see how it demonstrates Shift Left:
Automated Testing Right Away (Continuous Integration):
- Remember how our GitHub Actions pipeline runs automated tests as soon as developers push code? This is Shift Left! We’re not waiting for a big “testing phase.”
- We’re catching problems as soon as they’re introduced, like tasting the batter before it’s baked.
Testing in a Staging Environment (Continuous Delivery):
- We talked about testing in a staging environment, which is a copy of the live website. This is also Shift Left. We’re testing before the code goes live, not after.
- This is like testing the cake before serving it to guests.
Emphasis on Automation (Continuous Deployment):
- We learned that in Continuous Deployment, automated tests are crucial. This means we’re building tests that can run quickly and frequently, catching issues early.
- Automation allows us to test as often as we can, like checking the oven temperature during baking.
Our Role as Collaborators:
- We contribute to the development process early by providing feedback on testability, which helps shape the code to be easily testable. Additionally, we engage in activities like requirement reviews, buddy testing, and sharing our tests with developers to prevent unexpected issues after deployment.
- We’re helping to make sure the batter is right, not just tasting the final cake.
Why Shift Left Matters to Us as Testers
- Finding Problems Sooner: Catching bugs early saves time and effort. It’s easier to fix a mistake in the batter than to fix a burnt cake.
- Improving Quality: By testing early, we make quality a priority throughout the development process.
- Faster Feedback: Shift Left gives developers faster feedback, so they can fix problems quickly.
- Better Teamwork: It encourages closer collaboration between us and developers, leading to better communication.
Our Role in a Shift Left World
- Early Test Planning: We’re involved in planning tests from the beginning, considering testability during design.
- Automation Expertise: We help create and maintain automated tests that run as part of the CI/CD pipeline.
- Continuous Feedback: We provide ongoing feedback to developers, helping them improve code quality.
- Quality Advocates: We become champions of quality, ensuring that it’s a priority throughout the development lifecycle.
In Conclusion
Shift Left testing is a powerful approach that empowers us to be proactive quality champions. By working closely with developers and using CI/CD tools, we can ensure that high-quality software is delivered faster and more reliably. We are not just finding bugs at the end, we are preventing them from the start.
Continue learning and happy testing!
Original article: https://medium.com/@uppadhyayraj/beyond-bug-reports-shifting-left-testing-early-and-often-with-ci-cd-8f0d33960bdc