IBM just announced a new Android plugin for its deployment automation tool, UrbanCode. It can be used to help solve a very common problem for mobile developers; memory leaks. Memory leaks can be frustrating as they may not occur until hours or even days of normal use. A proven technique to shake out these bugs quickly is monkey testing.
A monkey test runs on your emulator or device and generates pseudo random user events to help find crashes and application non-responsiveness. Using the Android plugin for UrbanCode makes it possible to install an application on the target where other types of tests provided can be run such as user created Unit and UI tests.
The new Android plugin can help you find memory leaks by applying continuous deployment and monkey testing to your application. To begin we manually start the process:
However, the process could be automated to run automatically after an integration build against either new or existing emulators/physical devices. The process is run against a development environment which is local in this scenario, although it could be remote. Here we use the latest version of the application output from the build.
Upon submission the application artefacts (which could include tests) can be copied to the machine running the request process execution:
The detailed deployment steps can be seen on the left hand side of the screen below:
Next the process starts two emulators which appear on the right hand side of the screen:
The emulators have been optimised to start quickly through hardware acceleration and the use of snapshots allow for saving the state of an emulator similar to starting your computer from sleep mode. Once the emulators have been detected we see the monkey test run in parallel:
When the tests (configured to send a specified number of events) are completed, the results are made available to the development team and the web console and the emulators are shut down:
The Android plugin helps fill an important role for the mobile application development team by providing a scalable application testing tool that can provide an automated approach for installing and testing an application in order to achieve higher quality applications.