What is monkey testiing ? Should you try Monkey testing for your product ?

Share:

Recently people asking me about monkey testing. Now a day’s people trying different testing approaches to achieve best quality for their product. So here questions are, what is monkey testing? Should you try that for your product? and when to use that? 

monkey testiing

Monkey Testing

Monkey testing is a software testing technique where product is tested randomly, giving random inputs and checking response of the system. Most of times these inputs are not even valid inputs. You can assume monkey is using smartphone or computer. It can press any button any input he can give, totally random. 

There are smart monkeys also, called Gorillas. So Gorilla testing is somewhat smarter than normal monkey test. Gorilla Testing is performed on specifically few selective modules with few test cases. It's not random nor predefined. You can modify monkey-APIs and make them Gorillas.  

How to write automation for Monkey testing 

Mostly monkey testing is performed by Automation tools only because manual tester could not validate everything randomly. He may not enter invalid inputs or may not leave incomplete task and start other one. 
  • For android app, there is already one ADB command
    "
    adb shell monkey -p <package_name> -v n -s SEED"
  • For python script you can directly use
    "
    from com.android.monkeyrunner import <module>" (here is the detailed article on MunkeyRunner API)
  • For web you can write script with selenium and webdriver.io (we mostly avoid to test web using monkey)

Why to use Monkey Testing  
  • Most of companies use this technique to find crash for their application. 
  • It is also kind of stress testing for product. 
  • It's easy to automate random inputs on random scenarios. 
  • No need of smart resource for such testing.
Are there any Disadvantages of monkey testing? 
yes, there are few disadvantages.
  •  Most of time no chance of finding bug (so it should not be include in your main testing plan ) 
  • Most of bugs may be invalid.
  • It's hard to reproduce bug found by monkey testing.  (To reproduce it's better you use screen recording or proper logging).
Should you try Monkey testing for your product?
  
Yes, if your product is mobile application, then you must try. But in what testing phase we should try monkey testing? You should never try monkey testing in starting phase. You might end up with lots of bugs without proper reproducing steps. So, it is advisable to try monkey testing when all testing is over, all the bugs are fixed and there is some time for relies of product.