Let’s Talk About Monkey Testing

Emile Francois
SkyshiDigital
Published in
5 min readFeb 25, 2018

--

What Is A Monkey Test?

While the source of the name “monkey” is uncertain, it is believed by some that the name has to do with the infinite monkey theorem,[1] which states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type a given text, such as the complete works of William Shakespeare. Some others believe that the name comes from the classic Mac OS application “The Monkey” developed by Steve Capps prior to 1983. It used journaling hooks to feed random events into Mac programs, and was used to test for bugs in MacPaint.[2]

Monkey Testing is also included in Android Studio as part of the standard testing tools for stress testing.[3]

In terms of software testing, Monkey Testing is the technique wherein the tester enters random variables in order to check the behavior or performance of an application.

Types of Monkey testing

Basically, a monkey in a monkey testing, refers to a tester or any other professional, performing the monkey testing, as a they are independent to do anything, without following any specific pattern, similar to monkey’s nature, who likes to move, anywhere, from one branch to another.

There are two types of monkeys, involved in the monkey testing, which may be described, as under:

Smart Monkey

Smart monkeys are usually identified by the following characteristics:

  • Have a brief idea about the application or system
  • Know its own location, where it can go and where it has been
  • Know its own capability and the system’s capability
  • Focus to break the system
  • Report bugs they found

Some smart monkeys are also referred to as brilliant monkeys, which perform testing as per user’s behavior and can specify some probabilities of bugs to be occurred.

Dumb Monkey

Dumb monkeys, also known as “ignorant monkeys”, are usually identified by the following characteristics:

  • No knowledge and idea about the system and its functionalities.
  • Unaware of the workflow of the system.
  • No idea about the type of input, being fed to the system, i.e. valid or invalid.
  • Not able to determine the system’s capability.
  • Finds lesser bugs, in comparison to smart monkey, but may explore bugs, which are hard to be found, even by the smart monkeys.

Features Of Monkey Testing

The notable features or characteristics of Monkey Testing are:

  • Impossible To Reproduce Results — as Monkey Testing works by feeding random data, it is next to impossible to create or reproduce the same set of errors or response. The data used of random testing is auto generated and so it becomes difficult to attain the same specific data set again.
  • Any Random Data Can Be Used — when it comes to Monkey Testing there is no right business case. What it means is that every random data can be used to check the system response. Since any data set can be used, there does not arise a question about right or wrong.
  • Domain Expertise A Must — random data causes random system behavior, as such only a domain expert can judge the impact of such responses. Hence, Monkey Testing should always be carried out under the watchful eyes of an expert whose knowledge and experience allows them to understand the importance of each response.

Advantages and disadvantages

The advantages of Monkey Testing are:

Monkey testing is an effective way to identify some out-of-the-box errors. Since the scenarios tested are usually ad-hoc, monkey testing can also be a good way to perform load and stress testing. The intrinsic randomness of monkey testing also makes it a good way to find major bugs that can break the entire system. The setup of monkey testing is easy, therefore good for any application. Smart monkeys, if properly set up with an accurate state model, can be really good at finding various kinds of bugs. Also:

Anybody Can Perform — almost anybody who is capable of reading and following instructions can carry out Monkey Testing. Obviously, they will be unable to judge the relevance of the output, but they will face no problem while conducting the test.

Allows Checking Of Server Response — in an indirect manner, Monkey Testing allows the domain expert to judge the server response to the software. Since, the scenarios are improvised and unplanned the software comes under stress and that effects the server response as well.

Makes Up For Time Crunch — if by any chance there is a time crunch or resource crunch and all the other testing levels have been completed to client satisfaction, then Monkey Testing allows a quick fix to completing the testing cycle.

Disadvantages, of using the monkey testing approach, may be seen, as under:

The randomness of monkey testing often makes the bugs found difficult or impossible to reproduce. Unexpected bugs found by monkey testing can also be challenging and time consuming to analyze. In some systems, monkey testing can go on for a long time before finding the bug. Also it may results into unexpected outcomes, which may be difficult, to understand, and prove to time-consuming. Again it’s a tedious task, to reproduce a defect, in the monkey testing. For smart monkeys, the ability highly depends on the state model provided, and developing a good state model can be expensive

It is pertinent, to mention that some of the people, finds monkey and adhoc testing, as the same testing technique, which is inappropriate to say, as ad-hoc testing is carried out, without any planning or documentation work, and its purpose, is to divide the system into subparts, in order to evaluate functionality, which is opposite, to the working of monkey testing.

Hence, it should be clearly remembered that the Monkey testing is very much different from other types of testing techniques that serve different purposes. Choose the correct test as per your requirement.

Similar techniques and distinctions

While monkey testing is sometimes treated the same as fuzz testing[4] and the two terms are usually used together,[5] some believe they are different by arguing that monkey testing is more about random actions while fuzz testing is more about random data input.[6] Monkey testing is also different from ad-hoc testing in that ad-hoc testing is performed without planning and documentation and the objective of ad-hoc testing is to divide the system randomly into subparts and check their functionality, which is not the case in monkey testing.

So why do we need monkey testing?

It lay on the differences between the artist and the monkey. You can’t expect that the end user will know how to use your art properly and won’t do something unexpected with it. By doing this test, at least you might decrease by a small portion of possibility of an app going awry because user behaviour.

Overall we can say that testing should be used after normal testing is over. Many times it happens that the reproduction of bug is very difficult or almost impossible, as the tester is unable to reproduce the found bug. Since it is time-consuming and requires too much effort and so wastage of effort in the early stage is not recommended. Since it is capable of finding issues such as hardware or software failure, memory leaks or other faults which are not generally found in normal testing, it is recommended to be done after normal testing.

--

--

Emile Francois
SkyshiDigital

A guinea pig who’s crave for more experiment.