Does it make sense to Migrate to Mobile App Test Automation
By Sourojit Das, Community Contributor - September 2, 2022
There has been a huge increase in smartphone users over the last decade, with some studies estimating that US citizens prefer being on their mobile devices more than they do on the telly.
Some more critical facts that underline the importance of mobile app usage and, thus, the significance of mobile app testing are listed below.
- Mobile apps would generate $935 billion in revenue by 2023
- 21% of millennials open an app more than 50 times each day.
- 69% of digital media time in the US generates from mobile apps
With so much pressure on app development teams to churn out new features and stay ahead of the competition, accelerating product release times is of primary importance.
As per a Compuware Study, “If your app freezes or crashes, the number of customers who will give it a second chance drops to 79%, and, if you or your app crashes again, the number of repeat users drops down to a whopping 16%”.
Thus the pressure is on to get it fast and get it right the first time around, and sometimes even extensive manual testing with massive teams of engineers working around the clock is not enough.
This article makes a case for why it makes sense to migrate to mobile app test automation and how such a migration can help benefit the team from both a cost as well as a time-saving perspective.
Challenges of Traditional Manual Mobile App Testing
The popular coding standards book Code Complete estimates that there are “5–50 errors per 1000 lines of derived code”. For complex mobile apps with lines of code running into the tens of thousands, this can represent the perfect nightmare.
Some challenges with manual test procedures in such a scenario stem from:
- Human Error: It is not impossible to produce a test report that objectively and comprehensively says that an app or feature is 100% bug-free and that all possible test data and edge cases have been tested on record. Even with the best of intentions, it is important to achieve this rate of consistency with manual test methods within the limits of reasonable costs, and thus, there are always issues stemming from unforeseen human oversight.
- Time Constraints: Even if we were to attempt to reach 100% foolproof testing manually, it would soon turn out to be too time-consuming and ultimately slow down the overall rate of product release and execution. Writing test cases and executing them repeatedly takes both time and effort, which can be better used for exploratory tests and test failure analysis, for instance.
- Cost: Mobile apps must be tested early in different environments for context and compatibility. The main reason software test leaders focus on mobile testing solutions is to guarantee constituent’s behavior of websites or mobile apps on different mobile devices. These differ by hardware configuration, OS, and screen resolutions, and often what seems prim and proper in one instance may look askew in others.
Standard manual testing procedures need the testers to procure and test the app repeatedly on different mobile devices based on the most commonly available options in the market or what the potential user base is likely to use.
Since it has become very expensive to purchase and test on a large variety of real-time devices, emulators and simulators can be used for this purpose. However, the results from these tools are not scalable at enterprise levels and have proven to be less than reliable on virtual platforms as they fail to adequately represent real user conditions and leave the product susceptible to bugs post-release.
BrowserStack offers a real device cloud library that allows you to test on 3000+ different devices and browsers seamlessly.
- Challenges with UI/Visual Testing: Visual Testing, sometimes called visual UI testing, verifies that the software user interface (UI) appears as per expected norms to all users. Visual tests check that each element on a web/app page appears in the right shape, size, and position and that these elements appear and function perfectly on a variety of devices and browsers.
In other words, visual testing factors how multiple environments, screen sizes, operating systems, and other variables will affect software.
Since these elements can be ever so slightly shifting on different configurations, and given the plethora of devices and configurations available for mobile apps to run on, it becomes extremely challenging to perform these tasks through conventional manual test methods.
Read More: Visual Testing: A Beginner’s Guide
The Benefits of Switching to Mobile App Test Automation
Now that the challenges of performing mobile app testing using legacy manual test methods have been discussed, it is useful to understand how migrating to automated mobile app testing would benefit an organization.
1. Enhanced Return on Investment through Automation
Software testing is by no means cheap. Most estimates place the cost of testing software anywhere between 15% to 25% of the total project costs. In fact, a 2019 study by industry leaders has estimated the average testing cost to be 23% of an organization’s total IT budget.
These estimates clearly underline the importance of trying to reduce costs through automation, as well as trying to optimize the Return on Investment (ROI) from automating regression test cases.
The most straightforward method of calculating test automation ROI is the formula given below:
ROI = Savings ÷ Investment
Savings can be defined as the amount of money generated by replacing manual tests with automated tests. And, Investments can be estimated to be the costs channeled into setting up test automation pipelines for the regression testing to take place.
To further quantify things, Savings can be considered as
Savings = (time to run a single manual test – time to run the same test in automation) * number of tests * number of test runs
And, Investment can be represented as,
Investment = (time required to build frameworks + maintenance cost + (time to code one tests X number of tests))
A deeper dive into these measures are thus required to understand better how to make test cases more cost-effective.
In such a case, we can consider that there is a standard Investment required for automating a test suite of a certain size as –
- The time required to build frameworks: can average out to a fixed value based on the skill of the test team.
- Maintenance Cost: can be considered a standard figure based on the size of the project, which will increase with time.
- Time required to code a test: can again be standardized to a set number based on technical skill and complexity of the project.
- Number of tests: will likely not be under the project team’s control and vary as per project size.
Thus, the Investment will definitely vary as per project needs and is unlikely to be optimized after a certain point.
Thus savings should be optimized by increasing them as much as possible.
Again, in analyzing savings, the main area of action should be the difference between the time to run a single manual test and the time to run the same test in automation since the other two factors are reliant on the project particulars.
And since there is again going to be a standard time taken to execute a test manually, it is important to reduce the time to run the same test in automation.
Enabling parallel testing automation means that testers should be able to run multiple tests on multiple devices simultaneously. This reduces test time, expedites results, and offers results within shorter deadlines.
Run Automated Tests with BrowserStack
An example of parallel testing boosting automation speeds can be considered with the following example:
If it takes 2 minutes on average to test one of 45 different test configurations, then the total test execution time comes to 90 mins for a sequential test.
Running three tests in parallel can reduce this to 30 mins, and six tests can shave it down to 15 mins.
Pro Tip: Try BrowserStack’s Parallel test calculator to understand how faster application releases can be facilitated with less waiting time for builds.
2. Automation to Help Boost Real Device Testing Capabilities
Some testers prefer to use emulators and simulators to easily test projects inside a virtual environment and for their easy availability.
However, compatibility and performance tests cannot give conclusive results when done on virtual iOS and Android devices.
For instance, a simulated iOS device will run faster or slower depending on the number of computing resources that are online on the tester’s MacBook.
Or, virtual Android devices – when created with non-x86 ABIs–will always run slower than real Android devices, regardless of the computer’s clock cycle.
Given that most mobile apps are deleted in a week after being installed for reasons like battery and memory drain and janky UI. These issues cannot be identified without testing on mobile device hardware, which needs real mobile devices.
Thus, current-day product teams prefer to use a carefully synchronized mix of real mobile devices to detect bugs in mobile apps prior to release. This not only helps pinpoint sub-optimality but also leads to a more well-rounded approach to software testing principles in general.
Also Read: Test on the right mobile devices
Browserstack’s real device cloud allows QA teams to access 3000+ real devices and browsers, on-demand for remotely testing applications. The latest handsets by Samsung, Apple, OnePlus, etc are all available along with popular legacy devices for remote testing. This negates the need to set up expensive infrastructure around on-site labs. The integrations offered with popular frameworks like Selenium, Cypress, Playwright, Puppeteer, Appium, Espresso, etc allow for quick and easy test cycles.
3. Automation Can Help Perform More Accurate Visual Testing
With the user interface being considered the “face” of any mobile app, it is more prone to being judged by users as they seek to understand the usability of the overall application. With appearance being a predominant factor in evaluating an application’s suitability of purpose, it is imperative to carry out extensive visual testing before deployment.
The time, effort, and costs for extensive manual visual tests can be significantly reduced through efficient automation. With automation tools for visual testing being thorough, precise, and possessing a smooth learning curve, it is relatively easy for modern QA teams to provide insights into defects and enable quick changes at each release.
Some popular tools for visual testing are:
- Cypress: Cypress allows plugins to perform a pixel-by-pixel comparison against a baseline image and flag any changes made.
- Selenium: Selenium makes it easy to carry out testing for web applications, with its mobile application counterpart Appium supporting testing for mobile applications.
- Percy by BrowserStack allows for manual as well as automated visual regression testing and has the distinct advantages of a detailed Root Cause Analysis functionality for defects.
Mobile app automation has become of prime importance as the proliferation of mobile app usage has increased manifold over the last decade, and the expectation on software development teams to deliver rapid product releases has become significantly higher. Though manual testing of mobile devices has been the cornerstone of this sector for many years, the advantages in ROI (both in terms of time and cost), and increased accuracy afforded by mobile app testing automation make it imperative that it be considered the obvious way ahead.