The internets are aflutter with a new browser testing tool known as “gremlins.js”. It’s a fun way to do “monkey testing” on your single page applications!
What’s monkey testing you ask? Also known as Fuzz Testing, it simulates random input and throws (or slings, if you will) it at your application, testing the robustness of your app. The idea is clicking your UI anywhere, in any sequence, at any time, you can identify potential bugs that you wouldn’t normally come across during standard “happy path” testing. You may have also heard of the similar ‘chaos monkey’ or ‘simian army’ tests that Netflix use to ensure their cloud services are operating at peak resiliency.
This will start generating random events against your UI – by default, an event every 10 milliseconds, up to 100 times. While this is happening, you’ll notice your browser window going all crazy (a la image below), as well as the console filling up with diagnostic data.
While this is going on, there will be some mogwais keeping track of your app’s general health in the console log as well. As soon as 10 errors are logged by mogwais, the horde pulls back and lets you determine what you need to fix to make your application more stable.
In addition to the basic gremlins, there’s a lot of other types you can use – such as formFiller, clicker, scroller, etc. There’s also different types of mogwais, such as a fps counter and alert monitor. And it’s super easy to roll your own – as simple as specifying a delegate.
With tonnes of configuration and customization options, try out gremlins.js on your web app and see how you robust your application is!