In functional regression testing there is Positive and Negative testing. Positive testing confirms that a feature is functioning correctly. The workflow that captures this can be thought of as the 'happy path' tests.
Negative testing ensures that the proper safeguards are triggered when a feature is used incorrectly. Negative testing ensures that your application can handle negative inputs and actions gracefully, such as ensuring that a phone number field doesn't accept letters.
Writing Negative Tests
With Rainforest, negative testing can be performed through testing the various safeguards that should be in place so that things that should not happen, does not happen.
Write negative tests specifically to trigger an intended safeguard:
Negative tests are still regression tests, and as a best practice, individual regression tests should be written to produce a single and specific outcome. A negative test, following this principle, should have the triggering of an intended safeguard as its end goal.
Results of Negative Testing
If negative tests are written deterministically with an end-goal in mind, the meaning of the results from can be identified from the passage or failure of the test. Simply put, the outcome of these tests should indicate the following:
- If a tester passes the last step of the test, the actions the testers performed while testing triggered the intended safeguards. The passing negative test means that the safeguards worked as expected.
Enter "ABCDE" into Zip Code field.
Did you see an error saying "Please enter valid Zip Code"?
If the tester answers YES to this - the test passed.
If the tester answers NO to this (meaning the expected error code did not present) - the test failed.
Failure of a negative test should send up a warning flag, as this indicates actions must be taken to troubleshoot why this safeguard was not triggered.
Rainforest displays the steps a tester took in the results of a test. Results of negative test follow this format, which allows problem areas with an app to be quickly identified and efficiently addressed.
If you have any questions about how to execute negative testing in Rainforest, please let us know at email@example.com!