Software testing is the process of Verification and Validation to check whether the software application under test is working as expected. To test the application we need to give some input and check if getting results 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 application can be carried out in two different ways, Positive testing and Negative testing. Let’s see What is Positive and Negative testing and how to write positive and negative test cases.
What is Positive Testing?
Positive Testing is a testing process where the system is validated against the valid input data. In this testing, the tester always checks for only a 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 a software application does that what it is supposed to do.
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.
What is Negative Testing?
Negative Testing commonly referred to as error path testing or failure testing is done to ensure the stability of the application. Negative testing is the process of applying as much creativity as possible and validating the application against invalid data.
In Negative Testing, the system is validated by providing invalid data as input. A negative test checks if an application behaves as expected with its negative inputs. This is to test the application that does not do anything that is not supposed to do so.
Example of Negative Testing
Consider the same above “age textbox” example which should accept only integers values. So here provide the characters like “abcdef” 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 the system should not allow entering non-integer values.
Let’s take another 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 textbox should accept 6 characters.
- Password textbox should up to 20 characters.
- Password textbox should accept any value in between 6-20 chars length.
- Password textbox should accept all numeric & alphabets values.
Negative Test scenarios
- Password textbox should not accept less than 6 characters.
- Password textbox should not exceed more than 20 characters.
- Password textbox should not accept special characters.
Test Design Techniques for Positive and Negative Testing
Following techniques are used for Positive and negative validation of testing is:
- Equivalence Partitioning
- Boundary Value Analysis
This is a software testing technique that divides the input data into many partitions. Values from each partition must be tested at least once. Partitions with valid values are used for Positive Testing. While partitions with invalid
values are used for negative testing.
Boundary Value Analysis
This is one of the software testing technique in which the test cases are designed to include values at the boundary. If the input data is used within the boundary value limits, then it is said to be Positive Testing. If the input data is picked outside the boundary value limits, then it is said to be Negative Testing.
User Interface (UI) Test Cases for Pen
These test cases cover the testing of the Graphical User Interface of the application to be tested which is Pen in our case.
- Verify that the length and the diameter of the pen are as per the specifications.
- Verify the outer body material of the pen, if it is metallic, plastic or any other material specified in the requirement specifications.
- Verify the color of the outer body of the pen. It should be as per the specifications.
- Verify that the brand name and/or logo of the company creating the pen should be clearly visible.
- Verify that any information displayed on the pen should be legible and clearly visible.
Functional Positive Test Cases for Pen
Functional test cases are the test cases that involve testing the different functional requirements of the application under test.
- Verify the type of pen, whether it is a ballpoint pen, ink pen or gel pen.
- Verify that the user is able to write clearly over different types of papers.
- Verify the weight of the pen, it should be as per the specifications. In case not mentioned in the specifications, the weight should not be too heavy to impact its smooth operation.
- Verify if the pen is with a cap or without a cap.
- Verify the color of the ink of the pen.
- Verify the odor of the pen’s ink on writing over a surface.
- Verify the surfaces over which pen is able to write smoothly apart from paper e.g. cardboard, rubber surface, etc.
- Verify that the text written by the pen should have consistent ink flow without leaving any blob.
- Verify that the pen’s ink should not leak in case it is tilted upside down.
- Verify if the pen’s ink should not leak at higher altitudes.
- Verify if the text written by the pen is erasable or not.
- Verify the functioning of pen on applying normal pressure during writing.
- Verify the strength of the pen’s outer body. It should not be easily breakable.
- Verify that text written by pen should not get faded before a certain time as mentioned in the specification.
- Verify if the text written by the pen is water-proof or not.
- Verify that the user is able to write normally on tilting the pen at a certain angle instead of keeping it straight while writing.
- Check the grip of the pen, whether it provides adequate friction for the user to comfortably grip the pen.
- Verify if the pen can support multiple refills or not.
- In the case of an ink pen, verify that the user is able to refill the pen with all the supported ink types.
- In the case of an ink pen, verify that the mechanism to refill the pen is easy to operate.
- In the case of a ballpoint pen, verify the size of the tip.
- In the case of a ball and gel pen, verify that the user can change the refill of the pen easily.
Functional Negative Test Cases for Pen
The negative test cases include test cases that check the robustness and the behavior of the application when subjected to unexpected conditions.
- Verify the functioning of a pen at extreme temperatures – much higher and lower than room temperature.
- Verify the functioning of a pen at extreme altitude.
- Verify the functioning of a pen at zero gravity.
- Verify the functioning of the pen on applying extreme pressure.
- Verify the effect of oil and other liquids on the text written by a pen.
- Verify if the user is able to write with a pen when used against the gravity i.e. upside down.
- Verify the functioning of a pen when a user tries to write on unsupported surfaces like glass, plastic, wood, etc.
- Verify if the pen works normally or not when used after immersing in water or any other liquid for some period of time.
User Interface (UI) Test Cases for Login
- Write a test case on each form object.
- Written test cases should be a combination of both negative and positive test cases.
- Also, test cases should always be a combination of functional, performance, UI, usability, and compatibility test cases.
Functional Positive Test Cases for Login
- Verify the ‘Forgot Password’ functionality.
- Verify the messages for invalid login.
- Verify the ‘Remember Me’ functionality.
- Verify if the data in password field is either visible as asterisk or bullet signs.
- Verify if a user is able to login with a new password only after he/she has changed the password.
- Verify if the login page allows to log in simultaneously with different credentials in a different browser.
- Verify if the ‘Enter’ key of the keyboard is working correctly on the login page.
- Verify the time taken to log in with a valid username and password.
- Verify if the font, text color, and color coding of the Login page is as per the standard.
- Verify if there is a ‘Cancel’ button available to erase the entered text.
- Verify the login page and all its controls in different browsers
Functional Negative Test Cases for Login
- Verify if a user cannot login with a valid username and an invalid password.
- Verify the login page for both, when the field is blank and Submit button is clicked.
- Verify if a user cannot enter the characters more than the specified range in each field (Username and Password).
- Verify the login page by pressing ‘Back button’ of the browser. It should not allow you to enter into the system once you log out.
- Verify the Login page against SQL injection attack.
Difference between Positive Testing and Negative Testing
|POSITIVE TESTING||NEGATIVE TESTING|
|It is performed only for expected conditions.||It is performed for unexpected conditions.|
|It doesn’t cover all possible cases.||It covers all possible cases.|
|It doesn’t ensure a good quality product.||It ensures a good quality product.|
|It is less important as compared to Negative testing.||It is more important as compared to Positive testing.|
|It can be performed by people having less knowledge.||It can only be performed by professionals.|
|It takes less time.||It takes more time.|
|It is performed on every application.||It is performed where are chances of unexpected conditions.|
|It ensures software is normal.||It ensures 100% defect-free software.|