Join us

Latency Test Guide: How to Boost App Speed and Improve UX

Latency testing (2)

TL;DR:

Did you know 100ms of lag can cost you 1% in sales? Learn how to master the latency test to isolate network, application, and database bottlenecks for a snappier, more reliable user experience


Have you experienced a sudden slow-down in the app (like when you try to use Facebook or Slack) ? This is not unheard of; we all have experienced delays when using an app, from an endless wait for a spinning loading wheel to a video call that turns into a still picture of you talking. Even though we often point fingers at our Wi-Fi or the cloud, the true cause of our frustration is typically not bad Wi-FI signal strength or a virtual environment but unmanaged latency.

Building or managing a digital product is not only about getting it working, but also involves understanding the difference between the success of a high performing platform that has happy users vs an under-performing platform where users become frustrated and no longer use that product. Latency, the most challenging and most invisible barrier to user retention, is a result of the delay between each user's click, swipe, and transaction.

What’s a Latency Test And Why Is It Important?

In a simple term, latency can be measured as the length of time it takes for a packet of data to travel from the sender to the receiver. In reference to performance of an application, it can be viewed as the time elapsed from the time a user performed an action until they see the application's response . As there are other areas of performance testing (i.e. throughput and response time) we cannot discount the significant impact that latency has.

Diving into a latency test is like starting a stopwatch on the development of your infrastructure. You’re measuring how long it takes for a message sent from your mobile device to a database, to travel to the other end of the world, and return again. If this round trip is delayed, then the user’s experience will suffer. Round trip time delays vary greatly, and can be similar to the difference between talking to a friend while in the same room compared to talking on a walkie-talkie with a ten second delay before your friend receives your message. Both of these methods will eventually result in the same message being sent to your friend, however, only one of these communication methods will provide an emotional tie that leads to a better outcome.

These delays can have a considerable impact on businesses. Many people think that milliseconds are insignificant in terms of effect, however, in the digital economy, every millisecond has value. For example, Amazon has disclosed that if they have 100ms of additional latency (less than the amount of time it takes to blink) on their website, they will have a 1% decrease in total sales. Google has calculated that by adding 400ms to load time on search results, there is a drop of 0.6% in search volume. As you can see, these numbers are not just numbers; they represent the way people think. People are not very patient at all.

When we see an app performing badly, we think that it is broken.

For instance, in a previous project I worked on that had many users connecting to it, they were convinced that the system had crashed at peak usage. When I looked into the code, there were no errors; the code was functioning normally, but the latency (a delay) in response time of 3 seconds made the system appear as though it had crashed. The system still functioned, but wasn't as comfortable to use due to the response lag from hitting the "Send" button on the app to seeing the sent information pop up on screen.

Latency testing can help define the "comfort level" of using an app for users which will encourage users to stick with it and use it as long as possible.

Multiple Types of Latency Testing

When we break down what causes users frustration, latency has no single cause; it is cumulative from all of the different bottlenecks. One area that causes latency is network latency; this is the amount of time it takes the actual data to travel over the wire/cable/satellite through the Internet. This is similar to the time it takes a letter to travel from your mailbox to your friends' mailbox. Second, we have application latency; this is a measurement of the time that your server uses to process an incoming request. This is similar to having your friend read your letter and then write back to you.

Last but not least is database latency which refers to when specific sets of data are pulled from storage. If one of the links in the connectivity chain has a weak link, the whole user experience will suffer. Comprehensive tests of latency can assist you in identifying the source of the slowdown by isolating the independent variables. For example, is the network provider responsible, did you run an unoptimized SQL query, or is there a large amount of JavaScript on the front-end?

How To Run A Latency Test Like A Pro?

Getting started is very easy. You don’t have to have a degree in network engineering. Start with basic ping commands or the developer tools found within your web browser and you’ll have something that’s a good base; however, these tools will give you only a small picture. To get useful results from the tests, you must be tracking real-world conditions. Many people fall into the trap of testing only from office high-speed connections. Users are all around the world using bad 4G connections while they are moving on a train or using a shared Wi-Fi connection in a large coffee shop. To be a successful latency test, the results must take into consideration geographic locations, devices being used, and the variance in data speeds for any connection.

While an app can appear to be very responsive when its only user is testing it, how does it respond when 10,000 users try to access the same Application Programming Interface (API)? It's equivalent to testing how long it takes to pass through a doorway alone versus when a crowd arrives at once and tries to smoosh through.

One major error that developers typically make is to concentrate on averages. If 95% of your users love using your product but the last 5% all complain about taking 30 seconds each time they try to use it, these outlier experiences are the ones who will fill up your support inbox, and leave 1-star reviews of your product, thus making it less popular than it could be. This is where examining the spread of each user's performance across the 95th - 99th percentiles becomes crucial for a qualifying latency test where you want to validate that the function will continue running at an acceptable level during extreme performance. In addition, many development teams fail to account for the different geography of their users; the experience will be extremely fast to the end-user located in Brooklyn, NY if the host server resides there, however, it would be extremely slow to the end-user located in Mumbai, India. So it is extremely important that you test the user experience from different geographic nodes around the world to ensure that your infrastructure is truly scalable around the world.

Why Investing in a Latency Test Pays Off ?

The payoffs from smartly doing Latency Tests go on and on! Not only are you keeping your users happy, but you're also generating a lot of data that you can use to make better-informed decisions. Instead of guesswork at meetings about what is causing a system to slow down, you can show a graph. You are also able to improve the overall cost of a business. Many teams spend a lot of money on some larger server to "fix" a speed issue when a simple latency test would have indicated that the root cause of the slowdown was a poorly configured database index. By identifying the root issue of speed and latency, you can save your company a lot of money on infrastructure improvements and focus your engineering time on making things work better. If you want to have a competitive advantage, speed is a big thing; in an era where speed is considered an attribute of a product, being the fastest provider of goods/services is an enormous opportunity.

However, this can sometimes be challenging because having a good testing strategy is extremely resource intensive. It takes tools that require special training, time on equipment to set up, and the expertise to analyze the amount of information that will be produced from the tests. One of the risks of doing a lot of testing is that it can be very easy to have "information overload" and become confused about what to focus on since there are so many data points that are available to you.

There may also be some instances of "false positives" (i.e. reporting a temporary network issue as a critical failure) due to incorrectly reporting low latency periods as high latency periods. But the cost of not having tests in place is always going to be greater than the cost of establishing the tests, so start small (begin monitoring your most critical user paths) and scale up as you learn from your test results.

Using Modern Tools Like Keploy for Your Latency Test

Modern tools like Keploy are a game-changer when it comes to your latency testing processes by automating the tedious parts of the testing cycle through AI technology.

Keploy allows you to record actual interactions as opposed to manually coding every scenario into scripted tests. Therefore, when you are performing a latency test using a tool such as Keploy, you are not only simulating (i.e. testing) "ideal" test cases; you are actually reproducing what users are doing live (i.e. making actual database and API requests). This will enable developers to identify performance regressions and latency spikes in minutes versus days or weeks. Additionally, these tools facilitate continued testing where the performance of the application will always be tested with every change in code versus only at significant release milestones.

To conclude, latency testing is an understated hero in software development; it serves to differentiate "acceptable" from "competitively exceptional". Latency testing may not be as attractive visually like designing new User Interfaces or launching a brand-new feature. Still, it represents the base upon which those features rest. All of the Applications you use and are fond of using or using have had thousands of hours of optimization, tweaking, and testing to give them the "snappy", “intuitive," and “lightweight" feel that users enjoy. To make latency testing a primary component of your Development Cycle(s): commit to improving your User Experience, preventing issues before they arise by addressing problems at the root cause level.


Let's keep in touch!

Stay updated with my latest posts and news. I share insights, updates, and exclusive content.

Unsubscribe anytime. By subscribing, you share your email with @shubham321 and accept our Terms & Privacy.

Give a Pawfive to this post!


Only registered users can post comments. Please, login or signup.

Start writing about what excites you in tech — connect with developers, grow your voice, and get rewarded.

Join other developers and claim your FAUN.dev() account now!

Avatar

shubham jha

Software engineer, Keploy

@shubham321
I’m Shubham, a Software Developer at Keploy, focused on API testing, test automation, and building reliable systems using real traffic and open-source tools. I enjoy simplifying complex testing workflows and improving developer productivity .
Developer Influence
1

Influence

1

Total Hits

1

Posts