Functional testing is a core piece of a software engineering effort. With the advent of mobile and social computing, non- functional testing has also gained prominence in recent times, but at the very core, functional testing still remains one of the top goals of a testing effort in ensuring a quality release to end users.
If one were to closely look at what constitutes functional testing, it is not very difficult to point out that it covers both the positive (happy path testing) and the negative (error scenario testing) testing routes. The real question is, given the time constraints we often work within, are both these arms adequately tested for. While the positive testing scenarios are often more straightforward, the negative scenarios need a lot of creativity and simulation.
As opposed to merely executing all possible workflows, herein the tester is simulating varied conditions that would trigger errors so as to verify a) if the right errors were thrown out and b) if the user is given the right set of opportunities to recover gracefully from an error. The other angle to consider here, which is slightly more subjective is the emotions of the user, which are often at highs, when negative scenarios/failure conditions are encountered.
As a tester, there is thus both an objective negative scenario testing and a subjective user emotional state testing that is involved in this area.
One may often limit negative testing to be purely scenario driven. While this is not fully untrue, negative data generation is also very important while test planning, case generation and execution. A simple scenario can be manipulated to become positive or negative based on the data used – thus testers have to keep in mind that negative testing does not always mean a separate set of scenarios that need to be used.
For instance, say the user has to enter input for a login field – instead of my name *Rajini*, I decide to enter, *R12$ini*. This is negative testing that is data driven as opposed to scenario driven. Both types of these negative tests are important to ensure comprehensive functional testing coverage.
Besides core functional testing, other places where such negative data is useful include localization functional, database functional, security and accessibility testing attributes.
Negative path testing is not something new for us as testers. However, with all the new testing techniques and tools coming into the picture, it is important for us to refresh some of these basic concepts at the grass root level so we arrive at the right blend of testing practices to bring in comprehensive test coverage and for which, negative path testing is a very important component.