One reason why human testers are far better at finding bugs than automated scenarios is because testers aren’t just validating the expected results. They are also able to recognize unexpected surprises and anomalies within the application.

For example, take a look at this application and assume the test is to go to the ‘Create New App’ page of the Setup tab and ensure that these 12 options exist in the grid.

 

app-noexceptionThe tester would write a test case that says exactly that and maybe add a bit more detail about what the 12 options should be, including the title and description. The automation engineer would write a script to verify that these 12 options exist on this page and would likely add assertions to verify that the title and description matches what’s expected.

Here’s the problem. One day, this same page looks like this:

 

sqlexception

Did you notice the exception at the bottom? Congratulations, you’re a human and you’re much more alert than the automated script! While the test case only told you what to specifically look for, it also implies “nothing should be weird about this page”. A tester would have caught this and opened a bug, while the automated script would pass every time because it only follows the explicit instructions of the test case.

What the tester did was use her peripheral view. The test case didn’t have to say “ensure there are no exceptions shown in the message bar”; but she subconsciously ensures that in addition to the 12 options, there is nothing else out of place.

As an automation engineer, we need to be more conscious of our peripheral view and, as best we can, build this into our scripts. I’d argue that our peripheral view is not limited to things that may be hidden in error consoles and message bars, but also includes details that are hidden from the test case, itself.

For example, I teach an automation workshop for testers and make it a point to illustrate to them how automating straight from a test case can lead to faulty tests. I present to them a grid where they can enter text to filter the contents of the grid.

application for automation

Their test case is to enter in “Cucumber” and ensure that “The Cucumber for Java Book” is shown. I have them write a script that would verify that test case.

filterresultswork

Their scripts initially always look like this

That script runs, the test passes, they see green and feel really good. But guess what? If the app behaved in the following way, the test – as written – would still run, pass, and show green – giving everyone that feel-good feeling but the application is broken!

filterresultsbroken

What’s not explicitly stated here is that “The Cucumber for Java Book” should be the ONLY book that is shown! This was implied but not actually written in the test case. If we tested this as a human, we’d immediately catch the fact that the grid is not filtering at all and this might very well be a high-severity bug. However, as you can see from the script above, this bug would have gone uncaught by the automated script. We must be diligent about adding the explicit and implicit verification points to our scripts. One more line of code would save the day!