Introduction to Functional Web Testing With Twill & Selenium

Part 1 :: Extra Time :: Negative Tests

Synopsis

The happy path isn't all happy all the time.

Negative Tests

One important aspect of testing that is frequently overlooked is what we call negative testing. That is, testing the error states of your application -- both expected and unexpected.

Positive testing is testing that attempts to show that a given module of an application does what it is supposed to do.

Negative testing is testing that attempts to show that the module does not do anything that it is not supposed to do.

Testing pundits often tell testers to look for error because if you look for success, you will often find success -- even when there is error. By proxy, if you do not find an error and you have reliable test cases (that latter point is crucial), then a positive test case will show that the application did not, in fact, manifest that error. However, showing an error when it should have done so is an example of a "positive test" by the strict definition of that term.

Some areas ripe for negative testing:

  • Fuzzing
  • SQL injection
  • Sessions
  • Required fields
  • Dates
  • Boundaries/Limits (on text entry, numeric entry, date ranges, etc.)

Fluid 960 Grid System, created by Stephen Bau, based on the 960 Grid System by Nathan Smith. Released under the GPL/ MIT Licenses.