What is Negative testing?

by admin

Negative Testing is a software testing technique used to validate application expected behavior with invalid input data. Also, we can consider that this is one of the Software Testing Techniques available in Black Box testing.
This is one of the most effective software testing techniques to find defects.
Negative Testing with Example: We will see how Negative Testing is used to test below requirement
Requirement: Risk assessment team in a credit card department of a bank requires to monitor payments when each transaction of an amount greater than or equal to Rs 1, 000, 00 is made more than or equal to 2 times in a day
The above requirement is developed technically as below
1.All credit card transactions for a day are captured in a mainframe file called dataset
2.Dataset above as in step 1 is loaded daily into a database table called credit card transactions
3.A COBOL program is developed which picks up the data from database table ‘credit card transactions’ to create a report called ‘Risk Assessment Report’ in showing a transaction of amount greater than or equal to Rs 1, 000, 00 is made more than or equal to 2 times in a day
4.Risk assessment team reviews the ‘Risk Assessment Report’ daily for transactions as specified in the above requirement
QA Test approach will be as below to test this requirement:
We must make sure the report is created with the specific amount and number of transactions as mentioned in the requirement.
Test Approach or Mainframe Test Approach: In QA testing we must simulate the steps 1 to 4 like in real time environment as mentioned above to make sure right transactions are captured in ‘Risk Assessment Report’
1. First we must create a mainframe file called dataset. In this file, we must update the data like below
a) Amount == Rs 2, 000, 00 and Number of Transactions == 2 times (Positive condition since Amount and Number of Transactions are valid data to be in ‘Risk Assessment Report’)
b) Amount == Rs 3, 000, 00 and Number of Transactions == 3 times (Positive condition since Amount and Number of Transactions are valid data to be in ‘Risk Assessment Report’)
c) Amount == Rs 3, 000, 00 and Number of Transactions == 1 time (Negative condition since Number of Transactions is in valid data to be in ‘Risk Assessment Report’)
d) Amount == RS 50,000 and Number of Transactions == 3 times (Negative condition since Amount is in valid data to be in ‘Risk Assessment Report’)
e) Amount == Rs 40,000 and Number of Transactions == 1 times (Negative condition since both Amount and Number of Transactions are in valid data to be in ‘Risk Assessment Report’)
2. After creating data set with positive and negative data as in step 1, load the dataset into a database table credit card transaction
3. Run the mainframe job which in turns executes a COBOL program to create ‘Risk Assessment Report’
4. Now QA team must verify ‘Risk Assessment Report’ to verify below
i)Positive data in step 1 a) above will be reported in ‘Risk Assessment Report’ since it satisfies the condition of amount greater than or equal to Rs 1, 000, 00 is made more than or equal to 2 times in a day as mentioned in requirement
ii)Positive data in step 1 b) above will be reported in ‘Risk Assessment Report’ since it satisfies the condition of amount greater than or equal to Rs 1, 000, 00 is made more than or equal to 2 times in a day as mentioned in requirement
iii)Negative data in step 1 c) above will not be reported in ‘Risk Assessment Report’ since it does not satisfy the condition of more than or equal to 2 times in a day as mentioned in requirement
iv)Negative data in step 1 d) above will not be reported in ‘Risk Assessment Report’ since it does not satisfy the condition of amount greater than or equal to Rs 1, 000, 00 as mentioned in requirement
v)Negative data in step 1 e) above will not be reported in ‘Risk Assessment Report’ since it does not satisfy the condition of amount greater than or equal to Rs 1, 000, 00 is made more than or equal to 2 times in a day as mentioned in requirement

Share this article

Leave a comment

Your email address will not be published. Required fields are marked *