Friday, January 30, 2009

Augment Manual Tests with Automation

When people think of test automation, the knee-jerk reaction is to think of some tool that performs a test or test-related activity for you. That tool runs unattended and gives you results of some kind when it's finished. That's definitely part of automation, but by no means the only thing it can do. You can also use it to create utilities that testers can use to speed up the testing process.

Here's a scenario for you - a tester needs to confirm that a text box can accept strings up to a given length. If there are too many characters in the string, the AUT throws an error message. We've probably all seen and done this type of boundary test many times. And you probably created your input strings the same way I did - you opened up Word, held down the X key for a bit, then used the word count feature to see how long of a string you'd made. If it was too long, you deleted some of it. Too short, you added characters until you hit the right length. Then you copy/paste that string into your box, see if the right error was displayed and moved on to the next test.

That's a tedious way to perform a simple boundary test. I got frustrated with doing that and built a small helper utility whose sole purpose was to generate strings. It was just a small dialog that asked how many characters I wanted my string to be, and after I entered that, it generated a string of that length and automatically placed it on the clipboard. I pasted the string into the desired field, confirmed that my error was displayed, and moved on. I didn't have to mess around with Word anymore, and I could create those needed strings much faster and more accurately than before.

I shared that helper utility with other members of my team and it was very well received. Several of the developers on the team asked for it too, so they could do some preliminary tests before the code got passed over to the testers. Over time, the String Generator evolved so that people could just click a button to "quick-create" strings of a predefined length.

The string generator only took me a few minutes to write, and it turned out to be a real time saver. Always keep your eyes open for places where a little bit of code can save a lot of manual effort.

No comments:

Post a Comment