Positive and Negative Testing

Home > Glossary > Positive and Negative Testing

Positive and Negative Testing

Positive Testing:

Positive testing is testing the expected outcome by providing the expected inputs for an application.

Consider the following requirement:

Requirement: Application A is accepting two(2) positive numbers and prints the sum of the two (2) numbers.

Positive test for this application is to input 2 positive numbers (ex: 3 and 4) and verify that the application produces the correct sum of the two numbers (ex: 7 in this example).

Positive Test for Application A:
Step 1: Input number 3 and number 4 to application A
Step 2: Verify that the application prints 7 (sum of the two numbers provided)

Negative Testing:

Negative testing is testing an application for unexpected, unusual inputs. For example, consider the above requirement for application A. Negative test can be to input none positive numbers and verify how the application behaves. Ideally, application A should handle non positive numbers gracefully – possibly by displaying an error message to the user.

Negative Test for Application A:

Step 1: Input negative numbers -2 and -4 to application A
Step 2: Verify that the application prints an error message/inform the user to enter positive numbers.

Other inputs can be: 0, characters, null, large numbers, decimal values, etc.