Android devices have a massive share of the global user population. Because more and more people are using Android smartphones, app developers need to be able to test their application’s functionality on Android devices just as they would on Windows desktop or Apple...
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.
- 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.
- Frequent releases make for good practice in a successful release process. Rather than hazards to be avoided, updates become routine events in a healthy software development lifecycle (SDLC).
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.
Use source control for your automated tests
That’s the starting point for all automation, integration, and release-management efforts: maintain your automated tests under revision control, and in fact in the same repository as your code. Good control over test sources pays off in many ways, first among these being to make it easier to match correctly the version of a test to the version of the source code. Ranorex Studio integrates with popular solutions for source control including Git, Microsoft Team Foundation Server, and Subversion.
An independent quality assurance (QA) team responsible for specialized tests might maintain sources in a separate repository. In all cases, though, the main points remain:
- sources, including test sources, need to be under revision control
- programming source and CI test source need to be coordinated
Don't rely solely on unit tests
Notice, too, the distinction between “unit testing in an individual developer’s local environment”, and the “green” build mentioned above. The latter is critical: a standardized, repeatable criterion with a definite relationship to a consistent test environment. Reliance on developers to submit what passes in a local environment introduces too much uncertainty.
With that standardized test environment in place, extension of CI from unit testing to integration tests (and more) is natural.
Make your build self-testing
Refactor your automated tests
Automated tests frequently bottleneck on network operations, or, more generally, use of external resources. When developers notice tests slowing, one of the remedies your refactoring can take is to mock those resources for fast results.
Keep your build fast
Due to their more complex nature, integration tests are usually slower than unit tests. Run your smoke and sanity tests first to rapidly identify a broken build before spending time on additional tests. If your team merges frequently, it may be more efficient to run integration tests only for daily builds rather than every merge.
Run a full regression only when necessary, such as in preparation for deployment to the production system. For example, Ranorex Studio supports the use of run configurations to run a subset of tests, such as smoke tests or tests just for features or modules of the application that have changed. Exclude from the build test set any low-priority regression test cases that haven’t found a defect in several test cycles.
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
All-in-one Test Automation
Cross-Technology | Cross-Device | Cross-Platform
Related Posts:
7 Best Android Testing Tools
There are more and more Android testing tools available for mobile app developers. These are our favorites for performance, accessibility, and security.
What Is the Difference Between Regression Testing and Retesting?
Regression testing and retesting are essential methodologies testers employ to ensure software quality. If you’re new to both or aren’t sure when to use which technique, this article should help. We’ll discuss the importance of regression testing in software testing. ...
DevOps Test Automation Tools & Best Practices
DevOps test automation enables teams to work faster and create better products. These best practices and tools make it easier to implement test automation.