A test monkey is an automated tool uses for random application testing. Unlike automated regression tests, test monkeys explore the system in a new way each time the test is run. In the book ” Experiences of Test Automation”, there is an interesting chapter that explains the benefits and limitations of test monkeys.
Using the test monkeys revealed that it was possible to compensate for many of the limitations and gaps in the existing regression test automation. The main benefits gained were as follows:
- Early testing: Test monkeys do not require an established GUI or a highly stable application under test and can therefore be applied early in the applications lifecycle.
* Valuable feedback: Test monkeys are used as a reliability indicator providing vital information to both developers and testers.
- Cost-effective automation: Test monkeys are cheap to implement and do not require considerable maintenance effort. Test monkeys can be put to use overnight and during weekends to find severe system breakdowns (nasty surprises we don’t want our customers to find).
- Long and complex test runs: Test monkeys can run for a long period of time covering wide areas of the application under test. Test monkeys do not need to synchronize with the application under test nor initialize the application to a known start state as in traditional test automation. The long test runs create compound situations that are very useful for detecting defects that only surface after a long execution time. Moreover, test monkeys excel in negative and stress testing, creating combinations and sequences that were not considered during design.
It is important to emphasize that the company did not rely on test monkeys as the only form of testing. Test monkeys were used as a supplement to, not a replacement for, the existing automated and manual testing.
Test monkeys have a number of limitations. They do not emulate real use situations and will, depending on the level of application knowledge, miss obvious defects (test monkeys are only looking for life signs of the application under test; they will not detect a missing function, a corrupted screen image, or a wrong font type).
Source: “Experiences of Test Automation – Case Studies of Software Test Automation”, Dorothy Graham and Mark Fewster editors, Addison-Wesley
Monkey testing is a concept that has been around for many years in the software testing community. Initially, you would just randomly punch your terminal keyboard, as a monkey will do it, to try to make your application fail. With the development of software testing tools, automated test monkeys have been created to emulate a random behavior.
The basic features of an automated test monkey are the random selection from an input range feeding the application under test through its normal interface and assessing the status of the applications. You should also naturally log all executed commands, because it is not only important to find bugs, but also to be able to reproduce any sequence that created these defects. Running during the night or when your testing platform is in low usage mode, automated monkey tests can be a precious add-on to your classical regression-testing suite.
Further Reading & Tools