What is Monkey & Gorilla Testing? Examples, Difference

โšก Smart Summary

Monkey testing feeds random, unplanned input into a running application and watches whether it survives, so crashes, freezes and unhandled states are exposed long before any predefined test case has been written.

  • ๐Ÿ’ Core idea: Random clicks, keystrokes and gestures probe the system for crash points rather than for expected results.
  • ๐Ÿฆ Gorilla contrast: Gorilla testing hammers one module repeatedly, while monkey testing roams across the whole application.
  • ๐Ÿง  Three grades: Dumb, smart and brilliant monkeys differ in how much they know about the system under test.
  • โš–๏ธ Honest trade-off: Cheap and fast to run, but defects are hard to reproduce and coverage cannot be guaranteed.
  • ๐Ÿ› ๏ธ Tooling: Android UI/Application Exerciser Monkey, MonkeyRunner and similar tools generate event streams automatically.
  • ๐ŸŽฏ Best fit: Early builds, interactive interfaces and stability runs, always paired with scripted and exploratory testing.

Monkey testing and Gorilla testing compared in software testing

What is Monkey Testing?

Monkey testing is a software testing technique in which the tester enters random inputs into an application without predefined test cases and checks how the application behaves, in particular whether it crashes. The purpose of monkey testing is to find bugs and errors through experimental, unscripted interaction.

The name comes from a simple picture, illustrated below.

Tester acting as the monkey entering random inputs during monkey testing

  • In monkey testing the tester (and sometimes the developer) is treated as the “monkey”.
  • If a monkey used a computer, it would perform tasks at random, without understanding the system.
  • In the same way, the tester applies random inputs to the system under test to find bugs without predefining any test case.
  • In some cases monkey testing is aimed at unit testing or GUI testing.

What is Gorilla Testing?

Gorilla testing is a software testing technique in which one module of the program is tested repeatedly to confirm that it works correctly and contains no defects.

A single module may be exercised a hundred times or more in exactly the same manner, which is why gorilla testing is also known as “frustrating testing”. Monkey testing spreads randomly across the application; gorilla testing drills into one place until it breaks or proves solid.

Types of Monkey Testing

Monkey testing is divided into categories according to how much the tester knows about the system. The diagram below summarises the three types.

Dumb, smart and brilliant types of monkey testing

  • Dumb monkey: the tester has no idea about the system or its functionality, and there is no assurance that any input is valid.
  • Smart monkey: the tester has a precise idea of the system, its purpose and its functionality, navigates through it and supplies valid inputs.
  • Brilliant monkey: the tester works from real user behaviour and can state where defects are likely to appear.

Monkey Testing vs Gorilla Testing vs Ad-hoc Testing

Monkey testing, gorilla testing and ad-hoc testing share an unscripted flavour, which is why they are often confused. The two tables below separate them.

Monkey Testing vs Gorilla Testing

Monkey Testing Gorilla Testing
Performed randomly, with no specifically predefined test cases. Neither predefined nor random โ€” the same checks are simply repeated.
Performed on the entire system and can involve many test cases. Performed on a few selected modules with few test cases.
The objective is to check for a system crash. The objective is to check whether the module works properly.

Monkey Testing vs Ad-hoc Testing

Monkey Testing Ad-hoc Testing
Performed randomly, with no specifically predefined test cases. Performed without planning or documentation, so no test cases or SRS are prepared.
Testers may not know what the system is or what it is for. The tester must understand the system well before testing starts.
The objective is to check for a system crash. The objective is to split the system into subparts at random and check their functionality.

Advantages and Disadvantages of Monkey Testing

Because the technique trades planning for speed, its benefits and its weaknesses come from the same property.

Advantages of Monkey Testing

  • New kinds of bug: the tester is free to work outside previously stated scenarios, which surfaces errors nobody thought to script.
  • Easy to execute: arranging random actions against random data is a quick way to exercise the system.
  • Less skilled people: monkey testing can often be performed without highly experienced testers.
  • Less costly: it needs considerably less expenditure to set up and run than a scripted suite.

Disadvantages of Monkey Testing

  • Bugs can be hard to reproduce: because inputs are random, recreating a failure may not be possible without a recorded seed.
  • Less accuracy: the tester cannot define an exact scenario and cannot guarantee the accuracy of what was covered.
  • Technical expertise still helps: to keep findings meaningful, testers need good knowledge of the domain.
  • Slow relative to yield: runs can go on for a long time and still return few defects, leaving gaps in the system.

How to Perform Monkey Testing

Monkey testing becomes far more efficient when a tool drives it, and it can be run against Android builds as well as desktop and web applications. The general process is:

  1. Register the application under test with the tool or the dedicated server that will drive it.
  2. Prepare the references and configuration the tool needs to build a test suite.
  3. Run the built test suite.
  4. Let the tool write its log โ€” the “monkey test” log file records every generated event and the results.
  5. Allow the run to continue until the system reaches a crash point, at which the offending action is captured in the log.
  6. Share the report with the responsible team and store the test data for future reference.

Keep every log. A random run is only useful later if the event sequence and the seed that produced it were saved, so defect management can tie the crash back to a reproducible input.

Monkey Testing Tools

Monkey testing is usually automated, because a machine can generate thousands of events in the time a person produces a few dozen. The commonly used options are:

  • UI/Application Exerciser Monkey: a command-line tool built into Android that runs in the adb shell and sends pseudo-random streams of user events, such as taps, gestures and key presses, plus system-level events, to a device or emulator.
  • MonkeyRunner: a separate Python API that drives devices and emulators from a workstation, sending specific commands and capturing screenshots. Despite the name, it is not the same tool as the exerciser monkey.
  • UI Automator and Appium: general mobile testing frameworks that can be scripted to fire semi-random event sequences at a build.
  • Fuzzing tools such as AFL: the same random-input idea applied to data rather than gestures, which is covered in fuzz testing.

Tool support for monkey testing is thinner than for scripted automation testing, so most teams combine a generic event generator with their existing framework rather than buying a dedicated product.

When to Use Monkey Testing

Monkey testing earns its place in specific situations rather than as a general replacement for planned testing.

Use it when:

  • An early build needs a cheap stability check before formal test cases exist.
  • The interface is highly interactive โ€” games, drawing tools, media players โ€” and real user behaviour is hard to predict.
  • You want a soak or stress run that hunts for crashes, memory leaks and unhandled states over many hours.
  • A release has passed scripted checks and you want an independent sweep for anything the script never touched.

Avoid it when:

  • You need repeatable evidence that a requirement is met โ€” that is the job of a written test case.
  • The build is unstable enough that every run crashes immediately, which hides everything behind the first failure.
  • Time is short, since a random run offers no guarantee of finding anything.

In practice the strongest results come from mixing approaches: scripted tests cover the known flows, exploratory testing investigates the unknown deliberately, and monkey testing attacks whatever both of them assumed would never happen.

FAQs

The name borrows the infinite monkey image: a monkey striking keys at random for long enough eventually produces something meaningful. Applied to software, random input eventually reaches states no designer anticipated.

Exploratory testing is deliberate: a tester forms a hypothesis, investigates it and adapts. Monkey testing is undirected by design. One depends on judgement, the other on volume and randomness.

They share the random-input principle but differ in target. Monkey testing fires user events at an interface. Fuzzing feeds malformed data to parsers and APIs, usually hunting for security flaws.

Chaos Monkey belongs to chaos engineering: it randomly disables services or disrupts infrastructure to test resilience. The shared idea is randomness, but the target is the running platform, not the user interface.

Models can bias the event stream towards paths real users take, turning a dumb monkey into a smarter one. They also cluster duplicate crash logs and rank which random failures deserve a developer’s attention first.

GitHub Copilot drafts the harness quickly โ€” event generators, seed handling, log parsers and crash triage scripts. The randomness strategy and the pass criteria still need a tester to define them.

Useful measures include crashes per thousand generated actions, the count of unique defects found, code coverage reached during the run, and time to first failure. Trend them across builds rather than reading one run.

Record the random seed and the event log. Tools that accept a seed will replay the identical sequence, so the failure can be narrowed to a short reproducible case and raised as a normal defect.

Summarize this post with: