Fixpoint
Fixpoint

Reputation: 9870

Monkeyrunner vs instrumentation - what's better for functional testing?

I want to create a couple of functional tests for an Android application to run them on a continuous integration server. As far as I understand, there are two main approaches: monkeyrunner and test cases via instrumentation.

At the moment, I can't see any advantages of monkeyrunner, but I might be missing something. What is it good for?

Upvotes: 4

Views: 1152

Answers (2)

n8schloss
n8schloss

Reputation: 2781

I like to use MonkeyRunner because its really portable (Linux, Mac and Windows), easy to setup and can work easily across many different devices and emulators. Also, sometimes with instrumentation you get crashes that are unrelated to the app, but are rather because of the instrumentation implementation. With MonkeyRunner you will know what caused the crash.

Upvotes: 4

pkk
pkk

Reputation: 3701

From my experience, monkey testing is really good for detecting flaws of the application in terms of:

  1. Memory leaks: sometimes it is impossible to track scenarios generating excessive memory usage (say basic fast rotation, subsequent button clicks etc.).
  2. Monkey also helps identifying test cases; unintended, strange uses of the applications that lead eventually to crashes.
  3. Using monkey tests you can also somehow mesure performance of the application, when used by "heavy" users.

I would say, that monkey testing does not stand in opposition to unit/instrumenation testing, but it is yet another way to test, that your application is working as intended.

Of course it also depends on the software is about to be tested, but in my opinion it is not always that easy to determine what happens if your button is clicked, then 9px above the button is touched and eventually a phone activity is run. :) That what monkey tests are for...

Upvotes: 0

Related Questions