Negative & Positive Testing

Negative & Positive Testing

The primary objective of performing software testing is to identify the bugs in the code and enhance the quality of software or an application. To achieve this, we have two different but unique software testing approaches, positive testing, and negative testing.

What is Positive Testing?

Positive Testing is a type of testing that is performed on a software application by providing valid data sets as input. It checks whether the software application behaves as expected with positive inputs or not. Positive testing is performed in order to check whether the software application does exactly what it is expected to do.

What is Negative Testing?

Negative Testing is a testing method performed on the software application by providing invalid or improper data sets as input. It checks whether the software application behaves as expected with negative or unwanted user inputs. The purpose of negative testing is to ensure that the software application does not crash and remains stable with invalid data inputs.

Example: In case you have a phone number and email fields. In a positive test, you have to insert a valid email and a valid phone number and the fields accept the data without showing an error:

2022-06-12 er.png

In a negative test try to insert an invalid email and an invalid phone number, and the fields shouldn't accept the data and should show up error messages:

2022-06-12 (2).png

Final Words It is generally considered a good practice to combine both the positive and the negative testing approaches. This strategy provides higher tested application coverage as compared to using only one of the specified automated testing methodologies.