Reference articles on history, science, culture and more
Encyclopedia

Monkey testing

Technique where the user tests the application or system by providing random inputs

In software testing, monkey testing is a technique where the user tests the application or system by providing random inputs and checking the behavior or seeing whether the application or system will crash. Monkey testing is usually implemented as random, automated unit tests.

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, 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.

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

01Types of monkey testing

Monkey testing can be categorized into smart monkey tests or dumb monkey tests.

Smart monkey tests

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 on breaking the system
  • Report bugs they find

Some smart monkeys are also referred to as brilliant monkeys, which perform testing as per user's behavior and can estimate the probability of certain bugs.

Dumb monkey tests

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

  • Have no knowledge about the application or system
  • Do not know if their input or behavior is valid or invalid
  • Do not know their or the system's capabilities, nor the flow of the application
  • Can find fewer bugs than smart monkeys, but can also find important bugs that are hard to catch by smart monkeys

02Advantages and disadvantages

Advantages

Monkey testing is a standard way to identify out-of-the-box errors. Since the scenarios tested are usually ad-hoc, monkey testing is also used to perform load and stress testing. The intrinsic randomness of monkey testing also causes it to find major bugs that can break the entire system. The simple setup of monkey testing results in it being acceptable for various applications. Smart monkeys, if properly set up with an accurate state model, can prove to be skilled at finding various kinds of bugs.

Disadvantages

The randomness of monkey testing often causes 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 a bug. For smart monkeys, the effectiveness highly depends on the state model provided, and developing a good state model can be expensive.

03Similar techniques and distinctions

While monkey testing can be treated the same as fuzz testing and the two terms are usually used together, some believe they are different by arguing that monkey testing is more about random actions while fuzz testing is more about random data input. 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.

Watch videos about Monkey testingExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Monkey testing, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.