Companies want to innovate faster, reduce time to market, and improve their product's value. But they often don't understand what holds them back. Moreover, you can make many changes to improve your organization's speed, but what's their overall impact? I've seen organizations cutting corners that affect quality just to be able to deliver value to customers faster. That's not a good approach to adopt. So, what can you do?
In the world of DevOps, a continuous integration (CI) pipeline is the gold-standard for delivering high-quality code and improving trust in your application. However, you won't achieve higher code quality just by implementing a CI pipeline. What matters most are the steps you implement in the CI pipeline that affect your application's overall quality. For instance, automated testing, application builds, or security scans.
This post explores the benefits of continuous integration and how a better alignment between testers and developers improves code quality. You can listen to Carlos Zapata talk about it here or read the summary below.
What Are the Benefits of Continuous Integration?
The most important benefit of continuous integration is to provide almost real-time feedback to developers. Whenever a developer commits code, the CI pipeline builds and tests the code to see if it contains any defects. Of course, this reduces the risk of finding bugs at later stages, such as QA testing or even the production release.
Another benefit is that continuous integration promotes shared coding practices. When you put together a team of several developers, they most likely have different coding standards and practices. A continuous integration pipeline helps you enforce certain coding styles and practices to create more uniform code. Enforcing standards is important to improve the quality of your code.
In the end, a continuous integration pipeline boosts confidence in the code. Of course, don't forget to write sufficient tests to cover all code paths.
How Does a Continuous Integration Pipeline Improve Quality?
In a traditional quality model, testing happens at the latest stages of the software development lifecycle. Instead, a continuous integration pipeline forces your team to shift the quality aspect to the left.
For instance, during the development phase, you can run the following tests:
- Static code analysis to check structural issues with the code
- Unit testing to test the implementation of business logic
- Component testing to verify how components work together
- Smoke testing to verify if the most critical code paths work as expected
Furthermore, a QA pipeline allows you to run other types of quality-related tests, such as feature testing, performance testing, and exploratory testing. All these types of tests contribute to the overall confidence in, and quality of, the code.
The goal of adopting the "shift left" approach is to reduce the number of defects in your production environment to zero. Ideally, you want to find all bugs before you release a new product update.
Screenshot from Carlos Zapata’s “How Our “Build Quality In” Initiative Delivered Zero Defect Release” presentation
Why Does Aligning Developers and Testers Improve Quality?
It makes a lot of sense to align developers and testers to improve code quality. Developers should share knowledge about the application, design decisions, and implementation details with testers so they can create more accurate tests. By sharing knowledge, they give testers a deeper understanding of the application, which helps them find defects more quickly.
On top of that, it's vital that the QA team (testers) designs acceptance criteria and shares them with the development team before the start of a development sprint. This way, developers know which tests the code needs to pass before the QA team can accept the software into testing. Testers can then create test cases during the development sprint to follow the pace of the sprint. You often see testing teams who run one sprint behind, creating test cases for the previous development sprint. That's not very efficient because it means that developers are working on new features and have to switch their context to a previous feature when testers find a bug.
Summary: Quality Is About Standards and Aligning People
In summary, code quality relies on enforcing standards across teams and aligning members of different teams. Many organizations believe that code quality is the responsibility of only the development team. That's not true! Code quality is a shared responsibility between many teams, such as the development team, the testing team, and the DevOps team. You have to work together and enforce standards to ensure the highest level of quality.