top of page
Writer's pictureNazia Nooreen

MONKEY TESTING

Monkey Testing , this name itself adds attention and interests in learning and helped me explore the concept more and create a blog post on it


What is Monkey Testing


Monkey testing ,is a technique used in Software Application Testing. As the name suggest monkey ,it acts as one.

Imagine a monkey smashing away at a keyboard. That's basically what monkey testing is! It's a type of software testing where you throw random inputs at your application to see if it breaks.


Think of it like this:

  • No documentation

  • No plan

  • Informal testing

  • Random Testing

  • Aim to break the application


By doing this the main goal is to find unexpected crashes or weird behavior. It's about trying to break the system in ways a normal user might not think of.


WHAT IS THE PURPOSE OF DOING THIS AND WHY DO WE DO THIS.

While reading this blogpost you might be wondering WHY is this importatnt and WHAT is the goal and purpose of implemention of this technique, To answer few of your thoughts ,Lets find out below


* **Find hidden bugs:** Monkey testing can uncover strange edge cases that you might miss with regular testing.

* **Test robustness:** It helps you see how your application handles unexpected situations and stress.

* **Simple to start:** It doesn't require a lot of planning or setup. Just start throwing random inputs!


While monkey testing might sound silly, BUt it can be a valuable tool for finding unexpected issues and making your software more robust. It's like a playful way to stress-test your application and see what it can handle.

The purpose of monkey testing is to find bugs and errors that may not be caught by traditional testing methods. It is also used to test the robustness and stability of the system.


**Types of monkey testing:**

There are two main types of monkey testing:


Dumb monkey testing: In this type, the tester provides random inputs to the system without any specific goal or purpose.

Smart monkey testing: In this type, the tester provides random inputs to the system with a specific goal or purpose in mind.


Advantages of monkey testing:

It can help find bugs that may not be caught by traditional testing methods.

It is a simple and easy way to test the system.

It can be used to test the robustness and stability of the system.


Disadvantages of monkey testing:

It can be time-consuming and inefficient.

It may not be able to find all bugs.

It can be difficult to reproduce the steps that led to a bug.


It's tricky to give Specific examples for monkey testing on a website I can't interact with directly. However, I can offer some general scenarios and how they'd apply to amazon.com, focusing on its likely features:


Dumb Monkey" Scenarios

Scenario 1:

Rapid-fire clicks: Imagine a script that just clicks randomly on any clickable element on the page, very quickly. This could reveal:

Unhandled JavaScript errors: Does the site crash if you click buttons in an unexpected order?

Race conditions: If actions happen too fast, does data get corrupted or lost? (e.g., submitting a form multiple times)

UI glitches: Do elements overlap, disappear, or behave strangely under rapid interaction?


Scenario 2

Random input in forms: Instead of valid names/emails, the monkey types gibberish, special characters, very long strings, etc. into contact forms, search bars, etc. This tests:

Input validation:** Does the site prevent bad data, or does it cause errors in the backend?

Security: Can you inject code or exploit vulnerabilities with unexpected input? (though this is more in-depth security testing)

Error handling: Are error messages clear if invalid data is entered?


Scenario 3

Stress testing with navigation: The monkey randomly goes back and forth between pages, opens many tabs, refreshes constantly. This can reveal:

Memory leaks: Does the site's memory usage grow uncontrollably, leading to slowdowns?

Server load issues: Can the server handle many concurrent users doing unpredictable things?


Smart Monkey Scenarios:

Scenario 1:

Blog post interactions: If amzon.com has comments, the monkey might:

Post very long comments: you are testing character limits, formatting issues.

Try to submit comments with HTML/JavaScript: you are checking for security against code injection.

Rapidly like/unlike posts : You are testing for race conditions or rate limiting.


Tools:

Monkey testing is often automated with tools .There are various tools available for automating monkey testing, such as Gremlins.js, MonkeyRunner, and UI AutoMonkey. Experiment with these tools to see how they can help you generate and execute monkey tests more efficiently.


Integrate monkey testing into your CI/CD pipeline:Incorporate monkey testing as part of your continuous integration and continuous delivery (CI/CD) process to automatically run monkey tests on each new build or release.


Analysis and Reporting


Log and analyze test results: By implementing this we can keep detailed logs of the monkey testing process, including the generated inputs, system behavior, and any crashes or errors encountered. Analyze these logs to identify patterns and prioritize bug fixes.

To Generate reports: you can Create reports that summarize the monkey testing results, including the number of tests executed, the number of crashes or errors found, and the areas of the application that are most susceptible to unexpected behavior.


Specific Considerations for Web Applications


Browser compatibility: Test your web application across different browsers and devices to ensure it can handle random inputs and interactions in various environments.

Network conditions: Simulate different network conditions, such as slow connections or intermittent connectivity, to see how the application behaves under stress.

Security testing: Use monkey testing to uncover potential security vulnerabilities, such as cross-site scripting (XSS) or SQL injection flaws.


Remember, monkey testing is most effective when combined with other testing techniques. Use it as a complementary approach to uncover unexpected issues and improve the robustness of your software.

Though ,everything looks happy path ,it comes with its own challenges .


Limitations:

It's unlikely to find *all* bugs, but it's good for uncovering the unexpected.


HAPPY EXPLORING!!

27 views

Recent Posts

See All
bottom of page