Software testing involves the thorough validation of the software to identify as many defects as possible and verify the compliance of the software with client requirements. A detailed testing with with data set values and different steps is involved. We have two testing strategies. They are positive testing and negative testing.
Positive testing determines that your software works as you expected. Software is tested with valid possibilities and valid data values. If an error occurs then software fails.
Negative Testing ensures that the application can handle the invalid input. For example: if a user enters any invalid data in the input data field then a message ‘please enter the correct data should be displayed’. The purpose of the negative testing is to detect such situations and verify it, to avoid the system from crashing. The testing ensures that the software can handle the improper behaviour of the system. The difference between the positive and negative testing is that the exceptions are avoided in the positive testing whereas exceptions are tested in the negative testing. From the software testers point of view it is important that software functions or works as per requirements. But it is important too, to verify that the software equally handles the abnormal situations for the invalid input to maintain the stability of the software. Mainly negative testing is done where there is possibility of software crashing. There can be various examples of negative testing.
- In the text field of Phone Number, the user may enter the phone number as alphabets or exceed the limit of the numeric values.
- In the Age field where the condition is the age should be greater than 0 and less than 100. The user may enter the value other than 0 to 100.
Check your understanding:
- Why negative testing is necessary?
- What are the possible scenarios in which negative testing is done?