Hello friends! today we are going to learn about an interesting testing type – Monkey testing. It is also one of the basic testing interview questions.
Before diving deep into formal definition and technicalities. Let’s just think – what would happen if a monkey is given a machine with an application to test.
The monkey will just pass random input to the application. This precisely happens in monkey testing. The application is tested randomly without any application knowledge.
Monkey testing is a type of testing in which an application is tested with random input without following any predefined flow or set of test cases. The intent is to crash or break the system under test.
Features of Monkey Testing
- The tester performing monkey testing isn’t necessarily required to have the application’s understanding.
- There are no pre-defined set of test cases to follow. It is completely random.
- It can be automated by scripting random application flows with random test data. Although preferably, we should not automate this.
Types of Monkey Testing
It is broadly classified into 3 types-
- Dumb Monkey – The tester performing the monkey testing doesn’t have any knowledge of the application under test.
Their only focus is to break the application thus are not aware of any start or end point of the whole process. On top of this they are also unknown to the UI and functionality of the software.
- Smart Monkey – With this type of testing, the tester has a fair idea of the application to be tested. They are aware of the test inputs and know where the webpages will lead the application to.
- Brilliant Monkey – These types of testers have a very good idea of the application. They can also test the application based on the user’s perspective. The focus here is not just to break the application but to give inputs from a specific domain perspective. This helps in breaking the application as well as finding bugs.
Advantages of Monkey Testing
- It can uncover defects that are otherwise difficult to find.
- Because of the intent to crash the application, it is widely used in stress testing.
- It doesn’t require skilled resources to carry out the testing.
- It is cost-effective also as it doesn’t require any special setup or skilled resources.
Disadvantages of Monkey Testing
- Since it is random in nature, so it is hard to find bugs also.
- Even when the bugs are found, it is very hard to reproduce the exact steps to reproduce the bugs.
- It can be very time-consuming with very fewer bugs to show.
- Since it is completely random, so good test coverage cannot be guaranteed or measured.
Monkey Testing Tools
To perform any kind of automated testing using appropriate tools is a must. This is why developers or testers choose the tools wisely. Following are some of the softwares that are helpful during monkey testing.
1. UI/Application Exerciser Monkey on Android
This application is suitable to run on the device or the emulator. It automatically runs a stream of auto-generated tests like touches, clicks, or gestures. This helps immensely in testing the device from the inside. As it is automated, stress testing can be done easily.
2. Monkey Runner Tool
Unlike Exerciser monkey, the Monkey runner tool is useful for running test cases from the outside of the android code. The function of the money runner is not specific, yet it is usually used to test the device at the functional or framework level. It is also used to run test cases during unit testing. One thing to be kept in mind is monkey runner is in no way related to the exerciser monkey tool as that runs from within the device.
Monkey testing vs Gorilla testing
Monkey testing and gorilla testing both follow unstructured and random methods of testing. However, gorilla testing focuses on a specific module of the software whereas, monkey test cases involve inputs for the system as a whole.
|Monkey Testing||Gorilla Testing|
|It involves giving random test case inputs to the system and validating the behavior of the system.||Gorilla testing is also unstructured and random manual testing on a specific module of the system to confirm there are no bugs present in the module.|
|This testing is performed on the whole system.||This testing method is module-specific.|
|The goal of this testing is to make sure the system does not crash.||The objective of this testing is to make the module bugs-free.|
|This method is mostly adopted during system testing.||This method is adopted during unit testing.|
|It is also called Random testing, Fuzz Testing, or Stochastic Testing.||Gorilla Testing is also called Torture Testing, Fault Tolerance Testing, or Frustrating Testing.|
|Monkey testing is divided into 3 types – Dumb, Smart, and Brilliant Monkey Testing.||There are no further subtypes of gorilla testing.|
With this, we have come to the end of this tutorial. Do check out our software testing tutorial series for more resources on manual and automated software testing.