Test Mobile Apps — The Google Way

Many companies are waking up to the massive potential of smartphone users and hence are jumping on to the mobile app development bandwagon in a big way. They focus on building a good development team that can handle any complexity in the app development project. However they chose not to invest in defining robust guidelines on well-rounded testing of the mobile apps. The most probable reason is that there is an absence of such a stringent guideline developed by any competent authority.

However this is all set to change with the search engine giant Google coming up with its own testing strategies. These protocols are built after extensive trial and error methods and are thus a pretty neat and tight set of steps for compete testing of mobile apps and can benefit both developers and the end users. These are the steps Google+ team follows for testing mobile apps –

General –

  1. Test as per platform — Android prefers Java while iOS prefers Objective-C. Also the UI testing too is different for these OS.
  2. Stability is the key — Both test suites and test environments need to be calibrated for stability. Avoid flaky tests as far as possible.
  3. Manage — Managing your testing process can be made easier by breaking into smaller tasks.
  4. Test environment — A hermetic test environment works by removing external dependencies.

Android Testing

  1. Unit tests — Develop unit tests by considering the challenge of separating the UI logic from code logic. Also use tools such as RoboElectric to decouple the unit tests from Android emulator.
  2. Hermetic UI tests — This is helpful as it eliminates the need for external dependencies. Hermetic testing can be done using White Box techniques such as Espresso which not only tests UI but also removes flakiness.
  3. Monkey tests — This technique is a pressure test for Android and checks for errors and stability in high stress test runs. Schedule a daily run against different SDKs to harness the full power of monkey tests.

iOS Testing –

  1. Unit tests — One can opt for the built-in OCUnit module within XCode or GTMSenTestcase for iOS unit testing.
  2. Hermetic UI tests — KIF is especially noteworthy for writing Objective-C UI tests as it lends more stability. Again for iOS too hermetic tests will be a good bet as it removes the need for network calls or external dependencies.
  3. Monkey tests — Unlike Android there is no native iOS monkey testing tool. However this can still help and iOS developers can opt for third party tools here.

Backend testing

A critical component is testing the connection and speed between backend servers and mobile clients as this holds the key to better UX for client. A replay test strategy can be helpful to determine the stability of the connection between the two points. You can also add a layer of diffing tools to eliminate expected differences. To get the best out of this type of testing use fake data within in-memory servers or RPC replay to external dependencies using tools such as Guice to inject dependencies and carry out the tests.

We do hope that these strategies help the developers release a much better mobile app on the app store and thus enhance the credibility of the app development ecosystem as a whole.

Originally published at: MobDevApp

Show your support

Clapping shows how much you appreciated Satinder S. Panesar’s story.