Tuesday 11 June 2013

Android App : Automtion Testing Tools - Part II

Descriptions

Below we have listed different tools with their advantages and disadvantages.

Monkey

Monket tool is designed to simulate this situation. The Monkey tool, a part of the Android SDK, sends a stream of random user events. Command line parameters specify the number of user actions, the ratio of each event type, and a name of a package.
Advantages
  • Monkey tool is zero maintenance costs.
  • Stress testing can detect non-trivial bugs.
Disadvantages
  • Monkey can’t simulate complex workloads such as authentication. In such cases, application functionality remains untested.
  • Games with complex control that require quick reactions and complex gestures will be completed at the beginning, or do not begin.
  • It’s very difficult to reproduce errors found by Monkey.
  • Monkey doesn’t check application status during the test.

MonkeyRunner


You can not only develop Android device control scripts using MonkeyRunner, you can also write scripts to test the application on a specific device. Its like record and play back tool.
Advantage
  • Flexible
Disadvantages
  • The complexity of writing scripts, even in simple cases.
  • Developing monkeyrunner scripts takes a lot of time, so this method is usually not justified. However, in special cases, this method might work.

Robotium

Robotium is not a part of Android SDK, and it’s distributed under the Open Source license.
Robotium scripts define actions on the application UI level rather than the input device level.
For example, a script needs to tap on an «OK» button. The monkeyrunner script will be implemented as “Tap at the screen point (x0, y0)”. A Robotium script will be implemented as “Press the button with the text “OK” .”
When actions are described at the interface level, the testing script can be made independent of interface layout, screen resolution, and orientation.
Additionally, Robotium allows you to check the application response to the action.For example, after clicking the «OK» button, the list with the “Item 1” item should appear.You can check list element names with Robotium. If you check the application state after each step, it is easy to find at which step the error occurred.
Disadvantages:
  • You need to develop a test script in Java* for each application. This requires programming skills and time.
  • When the application interface changes, the event sequence must be redone.
In general, Robotium allows you to develop the highest quality test cases with adequate cost.


Feature Matrix



Monkey
MonkeyRunner
Robotium
License
Available with Android SDK
Available with Android SDK
Open source
Random user actions
Yes
No
No
Record and Playback
No
Yes
Placback
available
Script Complexity
-
Yes
Yes
Define actions on
-
Input device level
Application
UI level
Script language
-
Python
Java







Maintenance costs
No
Need to modify script if UI changes
Need to modify
script if UI
changes



Summary

Automated testing with Monkey is a good starting point for any application. It is possible that this method will show adequate results for a particular application.

No comments:

Post a Comment