Monkey testing is a random type of testing carried out by automated testing tools. There are both “smart monkeys” and “dumb monkeys” in testing and they work randomly.
Smart monkey testing is very good for load and stress testing because it has the capability to find a number of bugs; however, they are very expensive to develop.
On the other hand, dumb monkeys are quite cheaper to develop and they can perform some basic testing. Dumb monkeys can find bugs like hangs and crashes.
Monkey testing is a random, automated unit test. The test is not scripted and is run mainly to check if a system or an application will not crash. It is also a micro scale test typically run by testers to check specific functions or program codes. The automated testing tools are called ‘monkeys’ which load or input the data to test, if the software can handle them.
The term monkey comes from a popular saying “a thousand monkeys at a thousand typewriters will eventually type out the entire works of Shakespeare” (the Infinite monkey theorem). Monkey testing is sometimes described as “random, without any specific test in mind” While monkey is the popular name for the test, “stochastic” is the formal or technical term of this type of testing.
Here is a general flow, sequence, or events while you are using the monkey-testing tool:
- Register the software for test with the applicable server.
- Check, if the needed references are proper and then you need to open the test suite.
- Run the test suite.
- The monkey’s interactions are recorded in a log file called monkey test.
- The monkey may continue for an indefinite period unless it stops or crashes. If it crashes, the action is recorded in the log file.
- The testing result is reported to those concerned about the operation for their appropriate actions. The testing data obtained is a good reference for the continuous improvement of the developing process.
Two types of monkey testing are smart monkey or dumb monkey tests. Each type is identifiable by their respective characteristics listed below:
A smart monkey knows:
- Its location
- Its capability and what it can do
- Where it can go
- Its past location or where it has been
- Visual Integrity or capable of recognition, if the result conform to the expected result
The smart monkey’s capabilities can be explained through the following examples:
- It can read the software’s map and other information; so, it is capable of moving around.
- A smart monkey would be able to operate a computer’s calculator. It would know what buttons to press to start, what button to choose in the operational menu and the button to close the operation and to Exit. It would not click the buttons at random, hoping to stumble upon the right one.
- It looks for bugs that could crash the software
- It can examine and check correctness of data. Identifies and reports any illegal in puts.
- It reports bugs or problems it encounters.
Smart monkeys rank based on the IQ programmed. The inputs differ in each IQ level of smart monkey. Smart monkeys learn their product knowledge from a model of the software it has to test.
On the other hand, a dumb monkey is technically called ‘Ignorant Monkey’. How it differs from a smart monkey is described below:
- It does not use a state table from the software for test. This allows dumb monkey to start testing at lesser set up time.
- It cannot identify, if inputs are illegal or legal
- It can find just a few bugs, but usually finds the important ones that breaks the system.
- Software-application ignorant, but understands and catches environmental bugs that cause hangs and crashes.
Based on the above descriptions of the smart and dumb monkeys, the testers can choose the appropriate type for the kind of information needed.
Cost is an important and major consideration in any business decision. Aside from the functional features of the smart and dumb monkeys, the cost of using them against the expected benefit need consideration by the tester to make a good decision or choice. Software testing costs money for testing time, tools and personnel. Yet, software developers cannot do away with testing before releasing the product to the client or end user.
How do the two types of monkey testing compare cost wise?
A smart monkey test tool is quite expensive. The model or state table generation is the single major contributor to the cost. On the other hand, the cost of setting up the dumb monkey is very low. Knowing the testing cost against the needed testing capability would help the tester to make the right decision.
What factor justifies the cost of monkey testing software before its release to the end user? To appreciate the necessity of software testing, you may consider the following cases of possible failures in software reliability, quality and capacity performance. The failures could be simple, functional ones, but irritating to the uses like in the following examples:
- E-commerce storefront software intermittently fails in the payment function. This results to losses to the site owner.
- The accuracy of the calculations of the amount to be paid is simple, but of vital importance to the e-store owner. Failure would be a big loss, as internet transactions are entered at all times from all over the world.
- Almost all banking transactions are electronic, and run by the software installed. Any glitch, would not only affect the bank, but mainly, the bank’s clients. The failure could only last for a few minutes, but consider that every few seconds, transactions from the different branches are accumulated to much more than one would initially imagine.
- There are times when an unexpected surge in business volume might occur. The business owners will notice the trend, but are confident that their payment facilities can still handle even double the present volume. Then, the system crashes over just half way the volume it guaranteed and it is software related. Can you imagine the effect that failure has to the business? Think of the loss in business momentum and reputation.
The failures in the cited examples are simple functions that a properly set up monkey test could have detected. This is an instance, when the cost of failure is so much more than the cost of prevention. In nutshell, a delicate combination of both smart and dumb monkey tests would help you create a stable and efficient application.
Now that you know and understand the basics of monkey testing, let us understand the basic advantages and disadvantages of using these tools. When do you use these tests? How does a tester decide to use smart monkey or dumb monkey? Here are the lists of advantages and disadvantages in using smart or dumb monkey for testing:
Smart monkey advantages
- Smart monkey excels in finding bugs, if properly set up, with an accurate state model.
- Capable of finding a significant number of bugs.
- Valuable tool for load and stress testing.
Dumb monkey advantages
- Finds bugs even at the early stage of the development. This saves testing time later and corrective actions are possible at the earliest possible time.
- Easier set up, this allows testing to begin as soon as the parts are available.
- It can test continuously for several days, unless it encounters bugs or crash.
- This a good test for the reliability of the system or application over a period.
- Will not find many bugs, but when it finally finds the bugs, it is most likely the major ones, hangs and crashes.
- Easy to set up; can be used in any application.
- Costs less than smart monkey.
Smart monkey disadvantages
- Costs more than the dumb monkey.
- Capability depends on the state model installed. The more the state models, the more expensive will be the smart monkey.
Dumb monkey disadvantages
- It is capable only of limited and basic tests. “Educating” the dumb monkey further would make it less dumb, but would mean additional cost.
- Detection of only a few bugs is possible.
An automated testing tool like monkey testing can be a means of efficiency, if used properly. Presently, many bugs may still elude it. A good understanding of the strengths and weaknesses of either the smart or the dumb monkey is essential to arrive at a good decision in choosing which one to use.
One drawback is that monkey testing needs expensive models or state table, which serve as testing references, and are expensive. However, you should note that monkey testing is effective in testing only specific, critical parts. The effectiveness of monkey testing is heavily dependent on the kind of instructions the programmers have provided. Even veteran testers accept that no single testing tool or method that can free of software free of bugs and errors. The right combination of test methods and tools, based on error detection efficiency, cost and testing speed is the best guarantee that a product at its optimum condition is delivered to the end user.