The Art of Optimizing Android Testing
Apps simply need to work! Let’s start with some numbers:
- Page delays
2. 55% users blame the mobile app for poor performance not the device, not the Backend.
3. 53% of users uninstall or remove the app in the case of a severe issue, 37% stop using the app, and 28% look for an alternative
(**Hewlett Packard Enterprise, Mobile App Usage & Abandonment Survey)
4. Only 15% of users would consider downloading an app with a 2-star rating
(**Walz, A.: The Mobile Marketer’s Guide to App Store Ratings & Reviews)
Why Testing is Important?
Users are seldom tolerant of flaws and failures of apps, unless the app is essential to them.
Testing verifies that the app meets the requirements including, functional, usability, performance, reliability, security. QA processes help companies to reduce costs of support, while generating customer goodwill that could translate into revenue opportunities.
So, the Question is how to optimize Android app testing? Below are some solutions for optimizing
Below is android fragmentation by manufacturer. It is practically impossible to cover each and every device. So we need to follow risk based testing. We should find out the user base and cover only top used devices. If only 1% of your users are using android 4.1, it’s not recommended to waste time on 4.1.
Heat map uses a color coded overlays to show the “attention areas”, where are users clicking? which part of the product is being viewed and used the most? What path are users taking to perform an action?
Heatmap for mobile apps are generated only when users interacts (tap, swipe, scroll, zoom) on the screen and hence Click/Touch heatmap is the most popular for mobile apps. For each screen, generally there are two heatmap: one for each orientation.
Top tools for Heatmap
Heatmaps help us to analyze real use-cases which leads to designing better test-cases for the app. Heatmaps reveal user behaviour.
1. Link test: Are users clicking on dead ends?
2. Distraction test: Are irrelevant elements distracting users? This helps in designing better UX
3. Device test: Is app working fine on different screen sizes?
4. Depth test: Is all your content easily available?
5. Engagement test: What are app visitors really looking for.
6. Feature test: Which feature is being heavily used and which one is rarely used?
Google’s RAIL MODEL
Google published this model for Web but it is also relevant for Mobile apps.
A good quality app should follow RAIL model.
Response to Input : Respond in 100ms
Animation: Each frame completes in < 16ms
Idle: Use idle time to proactively schedule work.
Load: Page should be ready to use in<= 1000ms (1s)
Code Review should be done to ensure :
- There shouldn’t be unnecessary objects as allocating memory is always more expensive than not allocating memory
- If you don’t need to access an object’s fields, make your method static. Invocations will be about 15%-20% faster
- Floating point should be avoided as it is about 2x slower than integer on Android-powered devices.
- Use Package instead of Private Access with Private Inner Classes
Profiling is especially important on mobile apps because of the tight resource constraints. The end user could have a lower end device with less RAM, could be running multiple apps, or just switching between apps. You can avoid the Android OS from crashing your app by making sure it is as optimized as possible. There are many tools to do android app profiling, e.g.
Dalvik Debug Monitor Server (DDMS)
DDMS is a java app that is independent of the IDE you’re using and can be launched directly from the command line.
Features : Heap View, Memory allocation tracker, Method profiling, Logcat, File explorer, Thread examination, Network traffic, View hierarchy, Emulate phone calls, General System info(CPU, GPU, FPS)
You can enable GPU rendering under Android Developer options. This show on-screen bars that each represent one frame of rendering. The taller the bar the longer it took to render.
Traceview is a graphical viewer for execution logs that you create by using the Debug class to log tracing information in your code. It displays the log data in two panels:
1. Timeline panel describes when each thread and method started and stopped
2. Profile panel provides a summary of what happened inside a method
In summary, Quality is a competitive advantage. Only in rare cases will people actively come back and use a product that gave them a poor experience the first time they used it. So Optimizing testing not only helps in saving time but also in retaining users.