1

I really value unit-testing in developing webapps. I haven't had any experience in developing mobile apps. Is there anything that cannot be unit-tested in mobile apps? And what is the workaround for this? Is there any common gotcha that we must be aware in unit-testing mobile apps?

Joshua Partogi
  • 3,845
  • 11
  • 34
  • 43

3 Answers3

4

The most common gotcha in mobile apps is thinking that somehow they're different from immobile apps.

The next most common gotcha in all apps (mobile and immobile) is spending time looking for reasons not to write tests. The time spent researching the topic could have been spent writing tests.

S.Lott
  • 45,264
  • 6
  • 90
  • 154
  • +1 i was thinking the same ,then this would become a duplicate of [When is it appropriate to not unit test?](http://programmers.stackexchange.com/questions/66480/when-is-it-appropriate-to-not-unit-test) – Aditya P Apr 26 '11 at 10:29
  • 1
    Mobile apps are different from immobile apps. There's no power cord giving your app infinite battery life. Testing power consumption is often ignored due to this thinking. – hotpaw2 Apr 26 '11 at 19:43
  • @hotpaw2 there's a terminology problem here, this should not be a problem for "unit" testing as that's about units of functionality. However you're absolutely right in terms of the overall test plan which should attempt to reflect real world usage. – Murph Feb 29 '16 at 09:11
4

There are few problems with unit-testing mobile apps.

  • emulators do not behave exactly like real hardware, there are ocasional incompatibilities;
  • some emulators do not throttle the CPU power to emulate limited CPU power of mobile;
  • some emulators do not throttle the network to emulate limited throughput and latency of 3G connection;
  • in case of Android there is a problem of huge fragmentation both in system version and hardware. It's virtually impossible to test for all.
vartec
  • 20,760
  • 1
  • 52
  • 98
1

There is always the perennial UI issues, does it look good and is it easy to use.

Zachary K
  • 10,433
  • 2
  • 37
  • 55