Monday, March 16, 2009

Your Automated Tests Are Stupid

Yes, they are. And not because you didn't put a lot of effort into planning them, nor are they stupid because you implemented them poorly. Your tests are stupid because the computer is stupid. It' s going to check exactly what you told it to, and only what you told it to. Keep that in mind; if you write a test that verifies a field in your app correctly displays the sum of two numbers, then your test will make sure that the sum of 2+2 = 4. That's great, but the test will miss a lot of things that a manual tester would catch. For example, if the results are suddenly displayed in bright pink; if they're in a font size too small to see; if they're displayed offscreen. Your automated tests will also miss any spelling mistakes in fields adjacent to the field being tested, which a manual tester would (hopefully) notice.

The point I'm trying to make here is that automated tests will not and should not replace your manual testers. Automation should be used to augment your manual testers; in the case above, you could have an automated test verify hundreds of thousands of various input combinations, and then have a manual tester run through once to do a spot check. That way you get the best of both worlds - you're assured that the app is functioning properly from both a technical and a human perspective.

3 comments:

  1. I would argue that a test like that would be best handled at the code level. Perhaps a unit test that makes sure the SumNumbers() function works. You shouldn't have to test the value through the UI, only that the value shows up at all. And that *might* not be worth the trouble to automate.

    ReplyDelete
  2. I agree with you, Alex. That sort of test would be best handled via unit test. But lots of teams do use UI automation for this type of scenario and they take the attitude that "if the automated test passed, everything's fine with that part of the app." I just want to reinforce that even though automation can help you get more tests done, a human element still needs to be the deciding factor in whether a bit of code is ready for the real world.

    ReplyDelete
  3. Agreed. Certainly wasn't arguing the main point of the post.

    ReplyDelete