Development / Contributed

Testing Mobile Apps for Real-World Network Conditions

7 Sep 2018 9:00am, by

Mobile apps do strange things when networks are slow or out of range. We’ve all experienced it — an app acting up when we try using it in a place like an elevator, subway or underground parking lot. The best way to prevent such scenarios? Comprehensive real-world scenario testing.

For developers deploying mobile apps in today’s global market, knowing how an app will react in slow or fluctuating networks is critical. It can make the difference between retaining and losing a user. No one enjoys the pain that comes with battling poor network connections, especially with things like booking an Uber.

Most mobile apps are tested on readily accessible networks that function in working condition — like your office. However, this does not represent all your users across geographies.

The Problem: The Global State of Networks Today

Nakul Aggarwal, CTO, BrowserStack
Nakul Aggarwal is a serial entrepreneur who has started multiple companies alongside co-founder Ritesh Arora. Prior to BrowserStack, they co-founded QuarkRank (one of the first AI powered sentiment engines), QuarkBase (in the top 8,000 websites by traffic globally at the time) and Downcase (a consulting company with global clients). While building the website for Downcase, they became frustrated with the inability to test what they were building across a range of devices and browsers. To solve this problem, they built the first version of BrowserStack.

Apps rely on constant, real-time exchange of information between servers and users in different regions of the world, and networks power this communication. Since network performance varies based on network conditions, so does your mobile app performance.

When you’re out and about using a mobile app, your network bandwidth might not be enough, latency may be high, or you might experience problems switching between network speeds or even getting your device online. Two people using the same app may have a different experience depending on where they are. For example, while most countries offer 4G network coverage, the range of network speeds vary among different countries.

Why do networks vary? We all know the obvious factors, including physical obstructions, network ranges and the distance between devices, wireless network interference and signal sharing. There are also a number of lesser-known factors, such as network usage and loads, poorly deployed antennas, signal reflection and wireless signal restriction, transmitter power limitations, polarization of signals and more.

Given these variables, a network’s ability to transfer data over large distances can be easily impacted — slowing down an app and affecting its performance. However, customer expectations are set high, likely primed by optimal network conditions. Research shows nine out of ten users expect apps to load in four seconds or less, with nearly half saying they want it to load in under two seconds.

Being able to confirm your app works properly on a range of networks is key to ensuring a positive user experience and meeting customer expectations. Not doing so will only backfire, ultimately hurting user retention and your business.

The Solution: Simulating Network Conditions at Scale

Testing under simulated network conditions is the only feasible way to know how your mobile app will function across different network environments. This is the key to preempting network failures that hurt the quality of end-user experience.

Manipulating the flow of network data is an easy way to simulate different network environments. There are different parameters a user can tweak to control how network data flows, including: upload speeds, download speeds, latency, loss percentage, packets corruption, etc. Ultimately, users can customize these parameters to create network profiles that represent real-world user conditions.

There are many different parameters you can configure, so where do you start? Here are some recommendations:

  • Ensure your application is usable even with lousy bandwidth. Tune your bandwidth consumption as much as you can.
  • Increase the latency to three or four seconds, making sure any user-initiated operation is delayed by only a few seconds, rather than minutes.
  • Change the network’s bandwidth and connectivity mid-session while your test is running.

Getting Started: Prepare Your App for a Range of Network Environments

Now that you understand why network testing is critical and how it works, here are three common problem areas to watch out for:

Jitters. Jitters, the delays in receiving information on a network, are caused by problems with connectionless networks or pack switch networks. Information is distributed as packets and can travel by dissimilar paths and become scrambled, compared to how they were originally sent, resulting in delays. As a best practice, your mobile app should be designed to handle delays by triggering an appropriate notification with a message prompting the user to try again or simply wait for the system to respond.

Packet Loss. When data traveling across networks fails to reach the destination, your network is experiencing packet loss. For example, packet loss can impact the streaming quality of a video or gaming application by causing blurring and lagging. While the streaming will continue to work, it will result in delays and loss of quality. Top applications like Netflix handle packet loss through implementing buffering. The next episode of a Netflix series starts buffering even before current one you’re watching ends. This lowers the risk of a bad user experience and sets you up for your next binge. Win-win.

Network Speed: There are countless factors which affect how much data can be transferred between devices: distance, traffic, bandwidth, software and hardware limitations and more. In fact, network availability and speeds are fragmented in different geographies. 4G (LTE) availability across the world ranges from 40 to 90 percent, with an average of 55 percent. 4G speeds range from six to 45Mbps, averaging to 17Mbps. Every app should be tested on a range of networks and speeds — including 2G, 3G and 4G. It is also important to monitor how your apps behave when switching networks; common issues arise causing the app to become unresponsive. Another option is coming up with an alternative solution to handle poor networks that affect usage, like the option for offline usage, which Google implemented with the launch of  “YouTube Go.”

In conclusion, replicating a range of network conditions, network simulation provides a robust platform for testing against real-world scenarios. This helps ensure every interaction a user has with your app is vetted, debugged, and streamlined before it ships. The result is that developers can focus on delivering amazing experiences, knowing that their app will work properly in real life.

Feature image via Pixabay.

A newsletter digest of the week’s most important stories & analyses.