Quality delivery is of prime importance in the Agile world. Even though there are processes, it’s difficult to achieve speed and quality at the same time without automation. Automation is not just QA Automation, but we need combination of QA with deployment activities automation model for high scale delivery which introduces concept of Continuous Integration and Continuous Delivery (CI- CD) pipeline. Here, Deployment pipeline consumes integration pipe.
The next sections describe the detailed explanation of the importance, benefits, environmental requirements and best practices of CI-CD.
Importance of Automation in CI- CD:
Automated tests are the most important part of CI/CD pipeline. It must have good test coverage (at least 90%) for successful CI/CD pipeline.
Delivery team can create different test suites based upon requirement. Each has its own objectives.
Developers often run unit test suites first before they add their changes to the repository. Unit tests normally test individual classes or functions. In the case of need of external resources, developer will replace it with “mocks and “stubs” and complete execution.
Automated tests refer to different test scenarios, all positive and negative flows for making sure that the functionality works in all cases.
Integration tests runs after successful completion of Unit and Testing scenarios.. It makes sure integration of all modules and application work. It is suggested to have close to production setup to run integration tests.
System tests usually cover the complete application while the system flow is not limited to a module or a bunch of modules. Again, it is suggested to have a close to production setup to run such tests so we can consider test results.
There are numerous benefits, not limited to below list:
- Automated Build process for every code commit
- Automated deployment saves time
- Early detection of bugs and requirement gaps
- Setting the stage for continuous delivery
- All team members including management can see results and progress
- Can reuse same scripts on different environment
It is very important to know environment on which the tests are being executed. Sometimes, setup disturbs after applying different negative tests and junk data. We need to clean DB for fresh entry. It is suggested to clean and reset the whole environment before execution.
To get the meaningful test results, they should run in an environment that is close to the production environment as much as possible.
In some cases, Test environments are not required all the time, so we can take “on demand” from cloud to reduce cost and maintenance. Hosting on cloud is ideal solution for low cost and high throughput.
Best Practices for implementation:
- Develop applications in small incremental changes rather than big breaking changes. Divide big development chunk in small pieces.
- Create good coverage an automated test suite. Either gradually or in one shot but don’t stop until you have good code coverage (> 90%). Use proper code coverage tool for measurements.
- Once you have some tests in place, start building up the automation for your deployment pipeline as early as possible so it would mature gradually.
- Use feature toggles or separate deployments to gradually expose your code to your base development or to a new feature, rather than your entire base at once.