Differences Between Positive and Negative Testing in Software Testing: Software testing is a process of Verification and Validation to check whether software application under test is working as expected. To test the application, we need to give some input and check if getting the result as mentioned in the requirements or not. This testing activity is carried out to find the defects in the code & improve the quality of software application. Testing of the application can be carried out in two different ways, Positive testing and Negative testing.
Positive Testing is a testing process where the system validated against the valid input data. In this testing tester always check for the only valid set of values and check if an application behaves as expected with its expected inputs. The main intention of this testing is to check whether software application not showing an error when not supposed to & showing an error when supposed to. Such testing is to be carried out, keeping the positive point of view & only execute the positive scenario. Positive Testing always tries to prove that a given product and project always meet the requirements and specifications. Positive testing is testing the normal day to day life scenarios and check the expected behavior of the application.
Read Also: selenium interview questions
Example of Positive testing
Consider a scenario where you want to test an application which contains a simple textbox to enter age and requirements say that it should take only integers values. So here provide only positive integer values to check whether it is working as expected or not is the Positive Testing. Most of the application developers are implementing Positive scenarios where testers get fewer defects to count around positive testing.
Negative Testing is a testing process where the system validated against the invalid input data. A negative test checks if an application behaves as expected with its negative inputs. The main intention of this testing is to check whether software application not showing an error when supposed to & showing an error when not supposed to. Such testing is to be carried out, keeping the negative point of view & only execute the test cases for the only invalid set of input data.
Negative testing is a testing process to identify the inputs where the system is not designed or un-handled inputs by providing different invalid. The main reason behind Negative testing is to check the stability of the software application against the influences of the different variety of incorrect validation data set.
Example of Negative Testing
Consider the same above age textbox example, which should accept only integers values. So here provide the characters like “abcd” in the age textbox & check the behavior of the application, either it should show a validation error message for all invalid inputs (for all other than integer values), or system should not allow entering noninteger values.
Read Also: 10 Rules for Writing Automated Test Cases
The Negative testing helps to improve the testing coverage of your software application under test. Both positive and negative testing approaches are equally important for making your application more reliable and stable.
Let’s take the other example of Positive and negative testing scenarios:
- If the requirement is saying that the password text field should accept 6 – 20 characters and only alphanumeric characters.
Positive Test Scenarios
- The password text box should accept 6 characters
- The password text box should look up to 20 characters
- The password text box should accept any value in between 6-20 chars length.
- The password text box should accept all numeric & alphabets values.
Negative Test Scenarios
- The password text box should not accept less than 6 characters
- The password text box should not exceed more than 20 characters
- The password text box should not accept special characters
Keep in mind that both positive and negative testing is equally important for effective testing, which helps to improve the quality of software. Negative testing help to find more defects & improve the quality of the software application under test, but it should be done once the positive testing is completed. End users can enter any input values, and such real-life scenarios can be tested before moving software live. Main aim means the purpose of Positive and Negative Testing is to prove that the application works as per the requirements and specifications
If you like SoftwareTestingo and would like to contribute something to this community, then you can also write an article using our Contact us page or mail your article to email@example.com. So that we can review your article, and that also appears on the SoftwareTestingo.com main page and help other Testers.
Please Improve this article if you find anything incorrect by commenting on the comment box, and we are happy to work on the article to maintain accuracy and improvement.