5.7. UI Testing Patterns

To help with UI testing, there are a number of different patterns which people follow to help organize their testing.

5.7.1. The Test Monkey

A test monkey is a test whose only purpose is randomness. Test monkeys will enter random strings into text boxes and then randomly click on the screen. When using a test monkey, your hope is that it will help flush out those quirky integration issues. Test monkeys may also be called stochastic tests, which is really the same testing pattern, but sounds more technical. Test monkeys are often used for destructive testing. There are two types of test monkey patterns: the dumb test monkey and the smart test monkey.

Dumb test monkey tests are black box tests. They don't know how the application works and they only subject the applications to random user activity. Dumb test monkeys may not realize they caused an error, but are valuable because of their randomness.

Figure 5-22. The entire Selenium suite working together

Smart test monkeys are not as random. Their inputs are generated from data that is reflective of user data. This data is often gathered from log files or data that has been obfuscated from the database.

You may have heard of the infinite monkey theorem: the idea is that a monkey (or other object performing the same task) hitting keys on a typewriter at random for an infinite amount of time has a very good ...

Get Testing ASP.NET Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.