ArticleslgStudy

computer science

Monkey testing

Monkey testing is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Monkey testing rather than just read about it. In short: 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.

Key takeaways

  • Monkey testing belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Monkey testing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Monkey testing from memory before moving on to harder problems.

Reference excerpt

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.

Types 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

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

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

See also Random testing

References

Worked examples

Example 1 — a first encounter with Monkey testing

Start with the simplest possible case. Write down what Monkey testing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Monkey testing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Monkey testing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Monkey testing

In research
Monkey testing appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Monkey testing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Monkey testing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Software testing, so understanding it makes those chapters shorter.
In everyday life
Look for Monkey testing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Monkey testing” →

How to study Monkey testing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Monkey testing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Monkey testing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Monkey testing in simple terms?

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.

Why does Monkey testing matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Monkey testing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Monkey testing.

Tags

  • Software testing

Keep exploring