fbpx

Get your 6-month No-Cost Opt-Out offer for Unlimited Software Automation?

Most types of software testing use a carefully defined test plan to ensure coverage. However, while these parameters cover many of the eventualities of using a piece of software, they won’t always mimic the behavior of a user who is not familiar with the application and is simply trying to interact with it in an exploratory way: Enter monkey testing.

In this article, we’ll take a look at all things monkey testing, including monkey testing software, processes, types, approaches, and more.

 

What is monkey testing?

Incremental Testing In Software Testing - A Deep Dive into What is It, Types, Process, Approaches, Tools, & More!

Monkey testing is an increasingly popular software testing technique. It involves sending random inputs into an application to simulate the unpredictability of user interface interaction. 

The goal is to find bugs or crashes that might be hard to detect with predefined test cases. A monkey test mimics how a person with no experience or knowledge of an application might randomly explore the software.

This technique is a good option for both load and stress-testing applications. In effect, tests provide continuous random inputs in an attempt to break the application. 

There are many similarities between monkey testing and ad hoc testing, in particular, their random nature and lack of reliance on a test plan. However, there are enough differences between the two to consider them distinct approaches. 

While some developers suggest that monkey testing is a type of ad hoc testing, one significant difference between the two is that monkey testing can be performed by people without any knowledge of the application.

Monkey testing is about not having a test plan. It’s about feeding random inputs with the objective of crashing the software. 

 

Why is it called monkey testing?

alpha testing vs beta testing

There is no consensus on why this technique is called monkey testing. However, there are a few compelling theories behind the name.

 

Theory 1: Infinite monkey theorem

 

The first theory suggests the name has to do with the infinite monkey theorem, a metaphor used to discuss statistical probability. In short, it states that if a monkey sat in front of a typewriter and mashed random keys for an infinite amount of time, at some point it would produce the complete works of William Shakespeare. 

The idea here is that monkey testing simulates these random mashing of keys, and with enough time, it will cover every eventuality that the application will face in production.

 

Theory 2: Macintosh’s “The Monkey”

 

The other theory is that the name comes from a MacOS application from 1983 called “The Monkey.” In short, the team working on the first Macintosh computer wanted to find a way to stress-test their machine. 

They reasoned that if they had a monkey frantically bashing away at the keys and moving around the mouse, it would help them test the resilience of the computer. They didn’t have a live monkey on hand, so they built an application that could simulate this kind of usage, and called it “The Monkey”.

 

Why is monkey testing important?

clearing up some confusion in software testing automation

The big reason why monkey testing is important is that it helps teams discover edge cases or unexpected behaviors within an app. The idea here is that developers can use monkey testing alongside more traditional methods to get a better sense of how the app will be received in the wild.

Even comprehensive testing of a product can’t compete with tens of thousands or more users engaged with an application over a long course of time. In a small percentage of these cases, users will ask the application to do something unexpected. Uncovering all these scenarios via test cases is almost impossible.

Monkey testing attempts to cover these near-random scenarios. When developers build a test case, they tend to have an intimate knowledge of the app. They understand what user’s goals are, and they know the best sequence of interactions they should use to achieve something within an app.

Randomizing these inputs means that the application is tested in ways that the developers have not considered. Overall, this enhances the overall resilience and durability of a piece of software and ensures that it can go into the world and face the unpredictability of a wide range of users without crashing.

 

When should you use monkey testing?

checklist uat, web application testing tools, automation and more

Monkey testing is an excellent supplementary testing technique. Its biggest advantage lies in its ability to find unexpected bugs that would not be uncovered by more traditional software testing methods. As such, it’s best when used alongside methods like:

Typically, developers employ monkey testing early in the testing process. It’s particularly useful when there is a lack of predefined test plans to draw upon.

 

How is monkey testing performed?

Top 30 Most Popular RPA (robotic process automation) Tools & Software

In the not-so-distant past, monkey testing was performed manually. Testers were employed to hit buttons, enter text, select objects, and so on to see how the system would stand up to unconventional inputs. There are obvious problems here. Firstly, it’s pretty time-consuming. Secondly, there is little guarantee that these actions will cover every eventuality. 

 

Examples of manual monkey testing

Here are a few examples of how manual monkey testing is performed. It can also give you an idea of what automated monkey testing seeks to simulate.

  • The tester navigates a website by clicking on random links to see if they can crash the application or lead to unexpected pages
  • A tester enters random texts into a form field to see how the application responds
  • The tester drags and drops icons and objects to see if they behave as expected or throw up unwanted outcomes.

 

Different types of monkey testing

web app automation testing

There are three main types of monkey tests that developers use to discover distinct information about the resilience of their applications.

 

1. Dumb monkey testing

 

IS YOUR COMPANY IN NEED OF

ENTERPRISE LEVEL

TASK-AGNOSTIC SOFTWARE AUTOMATION?

Dumb monkey testing describes an approach where the tester knows nothing about the application under test. Instead, the tester is asked to poke around completely unaware of the workflow, pressing buttons, entering text, and so on. This technique can help uncover significant flaws that developers are not aware of.

 

2. Smart monkey testing

 

With smart monkey testing, the tester knows a bit about the application and its aims and even has detailed information about how it works. This process also uses a more focused type of random input that is designed to push the application past particular limits. Using this approach is good for both stress and load testing.

 

3. Brilliant monkey testing

 

Brilliant monkey testing is next level up from smart monkey testing. The tester has a strong and comprehensive knowledge of the application and is chosen based on this knowledge. This oversight can help the tester discover a lot of bugs because they should understand the product from a user’s perspective.

 

Pros and cons of monkey testing

challenges-load-testing

Before you decide to use the monkey testing technique, you need to understand its pros and cons. 

 

Monkey testing advantages

 

1. Finding rare or hidden bugs

Perhaps the most compelling benefit of monkey testing is the technique’s ability to uncover bugs, defects, or behaviors that might otherwise go uncovered. Finding these edge cases is challenging with traditional testing techniques, so monkey testing is a solid way to test for crashes, data corruptions, and anything else that threatens the stability of an application.

 

2. It ensures robustness

Monkey testing is designed to see how an application responds to the unpredictable conditions it will face during real-world uses. When an application is put into the user’s hands, it will result in lots of different inputs that developers can’t foresee. Monkey testing mimics that situation, leading to more reliable builds.

 

3. Cost-effectiveness

Compared to other types of testing, monkey testing is very cost-effective. There are a few reasons for this. Firstly, you don’t need to spend a lot of time designing use cases for your app. Next, monkey testing software tools are largely automated, which frees up developers’ time for other tasks, saving you money.

 

4. Versatility

One of the best things about monkey testing is that the tests can be performed by people with no technical background. Indeed, in some cases, it’s preferable to have someone who is completely green. What’s more, these tests are pretty simple to set up, which again, reduces the reliance on skilled engineers. 

 

5. Early bug detection

Finding and resolving bugs early in the development life cycle saves time down the road. Monkey testing introduces a level of randomness to testing, which can help you find flaws in your code while it’s easy to fix.

 

Monkey testing disadvantages

 

1. Coverage

While monkey testing can result in improved test coverage, it lacks the planned and strategic thoroughness of other testing types. In effect, because you are blasting the app with random inputs, you are at the mercy of chaos in finding bugs. That’s not to say that it won’t find everything, but without a clear and predefined strategy, you can’t be 100% sure that everything has been captured.

 

2. Limited applications

Monkey testing is not suitable for every type of application. It’s great for complex apps with lots of different features and functions that, most crucially, have the potential for unexpected user interactions. Programs that offer more rigid and predictable functions are less likely to benefit from these tests.

 

3. Time-consuming 

Manual monkey testing is very time-consuming. It requires a lot of interactions with modules and software, with no guarantee that each session will discover bugs. Granted, you can automate the process, which saves considerable time and resources.

 

4. False positives

Due to monkey testing’s chaotic or random nature, some inputs can simulate scenarios that will not happen during real-world use of the product. This situation can result in the generation of false positives, leading coders to fix issues that are not necessary.

 

What is chaos monkey testing?

what is chaos monkey testing?

Chaos testing is a software engineering technique that uses controlled and deliberate experiments designed to disrupt a system (and even induce failures) to assess its resilience and ability to recover. 

The idea of intentionally breaking a system to ensure resilience is pretty common in the software development space, and these methods typically result in builds that engineers can stand behind. 

In 2008, after experiencing a three-day database corruption, the popular streaming service Netflix decided to migrate to Amazon Web Services (AWS). The aim was to avoid single points of failure and reduce scalability issues resulting from expanding their service. 

The team implemented chaos monkey testing to test public-facing instances on the AWS infrastructure. The benefits were two-fold:

  1. The process exposed weaknesses that the Netflix engineers could fix
  2. It inspired the team to build automated recovery mechanisms for their service.

Chaos monkey testing is a part of Chaos Engineering. It’s used to test a system’s fault tolerance and its ability to maintain stability and performance even when individual components fail unexpectedly.

While it is related to monkey testing, it is a distinct technique.

 

Monkey testing vs Gorilla testing

Monkey testing vs. Gorilla testing

You may have also heard about the concept of Gorilla testing in software development. While both techniques have the names of primates, they have many similarities and differences. Let’s explore what Gorilla testing is and where it can be used.

Gorilla testing is considered a more structured version of monkey testing. In comparison, monkey testing is often used in the early stages of testing when there are no formal test cases available. Gorilla testing, on the other hand, uses an automated tool or script to generate random inputs for a software application.

Gorilla testing is quick and far more efficient than manual monkey testing. It offers broad coverage, and it’s an excellent way to find crashes that need to be resolved. However, it’s best used for applications with well-defined boundaries or to thoroughly test a particular module.

Both monkey testing and gorilla testing have their place in modern software development testing. Understanding them is key to using the right approach in the right space.

 

IS YOUR COMPANY IN NEED OF

ENTERPRISE LEVEL

TASK-AGNOSTIC SOFTWARE AUTOMATION?

What is the best monkey testing tool?

best monkey testing  tools

Monkey testing software has become an essential part of the modern developer’s toolkit. However, there are a few options out there. So, which is the best monkey testing tool? Here are a few that you need to know about.

 

1. ZAPTEST

 

ZAPTEST is a powerful free and enterprise software testing automation tool that supports a wide range of test automation techniques, including monkey testing. Some of the ZAPTEST features that help with monkey testing include:

 

  • No-code script recording: Teams can record user interactions and convert them into test code.
  • Input generation: ZAPTEST facilitates random input generation, which is a core element of monkey testing
  • Robust reporting: ZAPTEST offers powerful reporting capabilities that help you document your tests

 

Of course, these features are just scratching the surface of ZAPTEST’s capabilities for a wide range of testing techniques, including monkey tests. With WebDriver Integration, AI features, and ZAPTEST CoPilot, teams can experience the future of software testing all in one place. 

What’s more, ZAPTEST Enterprise users get access to a full-time, dedicated ZAP Expert and unlimited licenses, and all for a predictable fixed cost.

 

2. Appium

Appium is an open-source tool. You can use it for both Android and iOS. It allows users to automate mobile application interactions and has monkey testing capabilities. Developers can mimic a wide range of user interface reactions, like entering text, clicking, tapping, and scrolling. 

While Appium is a great tool for mobile developers, it lacks capabilities for desktop and web testing.

 

3. Monkey Test It

Monkey Test It is a cloud-based testing platform with a range of testing capabilities that include monkey testing. While Monkey Test It is very user-friendly, it perhaps lacks the power of rival tools.

Other drawbacks are that it could look slicker and come with better documentation. What’s more, some users have complained about inaccurate results from tests. That said, it’s a simple program with a low price, so you can’t expect the world from it.

 

4. MonkeyTestJS

MonkeyTestJS is an open-source Australian JavaScript-based tool that is built for web applications only. It’s fairly basic, but it is more than capable of doing the job. The tool lets developers simulate user-web application interactions, such as clicks, form submission, keyboard inputs, and more. 

Obviously, one disadvantage of the tool is that it is only available for web applications. However, it’s worth having in your toolbox.

 

What is the best dedicated Android monkey test tool?

 

There are a few good options for developers who want to bring a bit of chaos to their Android application testing. Let’s look at two.

 

1. UI/Application Exerciser Monkey for Android

UI/Application Exerciser Monkey for Android is a command line tool that lets developers send pseudo-random inputs or events to both Android devices and emulations. This tool runs in the Android Debug Bridge shell.

 

2. MonkeyRunner for Android

MonkeyRunner for Android is a popular Android monkey test tool. The software is an API that lets developers write programs that either emulate or control an Android device. It’s also a good option for both functional and unit testing.

Both of these applications are good options. However, they are fairly technical, which won’t suit all teams. 

 

Should monkey testing be automated?

Automation load testing

One of the biggest issues with manual monkey testing is that it is so time-consuming. The other thing that you should note is that it’s hard for a few testers to really simulate the various interactions that a wide base of users might have with a particular application. 

So, three immediate drawbacks jump out at us. Manual monkey testing is:

  • Time-consuming
  • Expensive 
  • Potentially lacking in coverage

An automated monkey testing tool solves all of these issues. 

 

Is ZAPTEST the right choice for your monkey testing needs?

 

Monkey testing is a good technique to have in your testing repertoire, especially if you design complex applications. However, buying dedicated monkey testing software is expensive.

ZAPTEST is a flexible and powerful full-stack test automation tool. It’s highly customizable and allows both developers and non-technical teams to build and design an endless amount of software testing techniques, including monkey testing. 

Monkey testing is a great choice when supplemented with other types of tests. ZAPTEST offers everything under one roof, with the addition of high-quality RPA tools. 

 

Final thoughts

Monkey testing software provides developers with an unconventional way to test their applications. The strength of this technique lies in its ability to simulate the myriad of unpredictable ways that a user might engage with a piece of software. In short, monkey testing provides coverage that might be difficult to achieve with a test plan.

Download post as PDF

Alex Zap Chernyak

Alex Zap Chernyak

Founder and CEO of ZAPTEST, with 20 years of experience in Software Automation for Testing + RPA processes, and application development. Read Alex Zap Chernyak's full executive profile on Forbes.

Get PDF-file of this post

Virtual Expert

ZAPTEST

ZAPTEST Logo