Negative Testing
Negative Testing
This tutorial will help you understand negative testing with some examples. Negative testing is also known as Error Path testing or Failure testing.
Negative testing is a type of software testing that checks how the system handles unexpected or invalid inputs or scenarios. The purpose of negative testing is to prevent the system from crashing or behaving abnormally when faced with such invalid inputs or scenarios. It is an essential aspect of software testing that aims to ensure the stability and reliability of a system under unfavorable conditions. While positive testing evaluates the system’s behavior when it is functioning as expected, negative testing focuses on how the system responds to abnormal or incorrect inputs.
Negative testing involves executing negative test scenarios or inputs. We can use test techniques such as boundary value analysis, equivalence partitioning, error guessing, or exploratory testing to generate negative test cases. We must also define each negative test case’s expected outcomes or behaviors.
A negative test case is a type of test case that verifies how well a system can handle incorrect, unexpected, or invalid inputs. Executing a negative test case is called negative testing.
Negative Testing Examples
Common examples of negative testing include entering invalid data into form fields, exceeding system limits, disrupting network connections, and manipulating input files. By simulating these adverse conditions, testers can assess the system’s ability to handle errors gracefully, recover from failures, and protect critical data.
Website Login Page
Consider a sample website login webpage. A negative test case is to enter an invalid username and password. The system should not grant website access to the user. The system should display an error message to the user.
E-Commerce Website
Consider an E-Commerce Website where merchants sell products online. Users are allowed to buy the products using credit cards. The process of users adding the products to the shopping cart and buying the products is called the Checkout process.
A negative test case is to add items to the cart and provide an invalid credit card. The payment gateway should display an error message. The E-commerce website should not process the payment.
This type of testing ensures the application is stable and can handle incorrect, invalid, or unexpected input scenarios without crashing, improving the product. It helps to improve the testing coverage of the application under test.
Video Tutorial
Main Goal
The main goal of negative testing is to identify potential vulnerabilities, weak points, and limitations of the software under test. By deliberately subjecting the system to invalid data, unexpected user inputs, and error-inducing scenarios, testers can uncover issues such as crashes, error messages, security breaches, and data corruption that might go unnoticed during regular testing.
Positive and negative testing approaches are essential to make the system under test more reliable, secure, and stable.
Software Testing Tutorials
Wikipedia