Rapid application development practices such as Continuous Integration (CI), Continuous Deployment (CD), and DevOps have a common goal: small, frequent releases of high-quality, “working” software. Whether your development cycle is measured in weeks or days, integrated automated tests are essential to maintaining the pace of development.
Automated tests in a CI pipeline
The image below shows a typical CI pipeline. A developer checks out code from the shared repository in the version control system, such as Git, TFS or Subversion. Once code changes are complete, the developer commits the change back to the version control system, triggering a CI job. The CI server builds the application under test and triggers automated tests to verify whether the new code results in a good, “green” build. The results of testing are reported back to the entire team for a decision regarding deployment of the application. In a CD environment, the application is deployed automatically to the production environment.
Continuous integration with automated testing offers several benefits to organizations, including the following:
- Developers get fast feedback on the quality, functionality, or system-wide impact of their code changes, when defects are easier and less expensive to fix.
- Frequent integration of small changes reduces the volume of merge conflicts that can occur when several developers are working on the same application code, and makes merge conflicts easier to resolve when they do happen.
- Everyone on the team has a clear understanding of the status of the build.
- A current “good build” of the application is always available for testing, demonstration, or release.
Recommendations for automated testing in a CI pipeline
The recommendations below focus on test automation in a CI pipeline, some of which overlap the best practices for the CI process itself. Read more about best practices for a CI process in the Wikipedia article on Continuous Integration.
Don't rely solely on unit tests
Make your build self-testing
Refactor your automated tests
Keep your build fast
Use source control for your automated tests
Test in the right environment
Test in parallel
Include functional UI and exploratory testing
Verify your deployment
To learn more about how to integrate Ranorex Studio tests in your CI pipeline, read our blog article Integrate Automated Testing into Jenkins. While this article focuses on Jenkins, Ranorex tests can be triggered