Field Testing React Native Apps with Offline Storage

Sandy Lewis
AgriDigital Engineering
3 min readMay 31, 2021
Photo by Sandy Lewis

It goes without saying, that testing the products you make before you release them is a no brainer. You work to get the best test coverage in your app by adding a variety of unit, component, contract and e2e tests. Layered over that are peer reviews, pull requests and QA reviews. This gives you confidence in the code that you’ve written, for both success and failure scenarios.

There are many things to do before your app is anywhere near your customer, but do you test for the vagaries of the real world? At AgriDigital, we go one step further. For our feature releases, we’ve added developer field testing to supplement our beta testing program.

That seems like a lot of effort?

Well, yes. Yes it is, BUT without field testing you’re probably flying blind. How do you know that the code that you’ve written is actually doing what you’d expect it to do? Our field testing puts us closer to the what the user experiences in real life. If you haven’t watched your users interacting with your app as part of their day to day operations, you could be missing some really valuable learning.

Ok, so give us an example

The biggest problem that we’ve faced at AgriDigital with Waypath is that cellular connectivity is a fickle beast. We’ve added a neat little utility to Waypath that tells us when the users connection state changes, but it’s not perfect. Some of the scenarios we’ve faced are:

  • 1 bar of 3G/4G but NO connection available
  • 1 bar of 3G/4G but a connection IS available
  • 0 bars of signal BUT the phone tells you there is a connection
  • No signal

The first two in the list have the same variables (1 bar and the same connection type) but the outcome is very different. Relying just on the connection state to determine what type of activities you perform isn’t going to be enough.

We can’t solve for poor connections but we can solve for how we deal with it. We did this by switching our app to be offline first. Every change that a user makes is saved to the in-app database. We constantly monitor for changes to the connection state and attempt to sync with the web as soon as we detect a connection. This all happens in the background so that the user’s workflow is not interrupted.

So how did you field test?

So we packed up the car and headed 500km and more than 6 hours away from Sydney to central NSW. Visiting our customers and watching how they use Waypath out in field was invaluable. You see the pain points and what it is they’re trying to do.

Field testing revealed:

  • Our approach to managing offline data was validated when operating our updated app alongside the current production app. We were able to continue using Waypath regardless of connection state and we saw the app sync data once we came back in range of a cellular or Wifi connection.
  • The lengths that our customers go to stay connected away from regional centres and major arterial roads is not insignificant. Signal repeaters and boosters are often needed on vehicles and operational locations and only have limited range.
  • Users were not aware of some built in functions, like swipe actions on lists. This highlighted that there needs to be additional in app education for time saving actions.

Like all types of testing, field testing is not going to catch everything. It’s another tool in your arsenal that when combined with your other testing types and code quality tools, gives you the best chance of hitting the mark when releasing new features to your customers.

Here at AgriDigital — we are focused on powering the worlds grain supply chains. Our two main products are:

  • AgriDigital — for grain buyers/site operators — Contracts, deliveries, inventory, orders, invoices and payments are easily managed from one simple platform a whole team can use — https://www.agridigital.io/products/agridigital
  • Waypath — for farmers — Inventory management tool that enables farmers to track their grain from paddock to payment, know their position and make informed marketing decisions — https://www.agridigital.io/products/waypath

--

--

Sandy Lewis
AgriDigital Engineering

Head of Mobile at AgriDigital. Avid baker and proud father of two [He/Him]