Negative Vs. Positive Testing

February 7, 2019
John Kensinger
John Kensinger

While there are many types of software testing, two basic and paramount categories are Positive and Negative Testing.

Positive Testing

Positive Testing is a type of testing whereby a valid data set is entered as the input. In this case, it confirms whether or not software is working as expected by using positive inputs. In short, this form of testing seeks to confirm that the software does exactly what it’s supposed to do.

For example, let’s say you have a text box that will turn green when you enter numbers. If you enter three numbers, the box should turn green. If it does, then that would be an accepted positive test. If it doesn’t, then it has failed the positive test; in other words, it doesn’t work as expected or as it should.

Negative Testing

On the other hand, Negative Testing is a type of testing whereby an invalid data set is entered as the input. In this case, it confirms that the software is not working as expected by using negative, or incorrect, inputs. This form of testing confirms that the software does not do anything it should not do with the incorrect input.

Using the same text box example from above, say you enter three letters instead of numbers. The box should not turn green. If it does turn green, that would be a failed negative test; in other words, if numbers are not entered, it should not turn green.

Two Parameters

Both types of testing are most commonly applied in test cases and typically entail two parameters, boundary value analysis and equivalence partitioning.

Boundary Value Analysis

Boundary value analysis is a technique whereby tests are designed with preset boundary values in a range. This prevents input values from being placed at extreme ends of the input domain (the farther apart they appear, the greater the chance of system error). Thus, the focus of boundary value analysis is to find the errors existing at the boundaries as opposed to the center.

Equivalence Partitioning

Equivalence partitioning entails separating input data into partitions of equivalent data from which test cases can be selected. This parameter seeks to define types of errors (trends) found in test cases in order to reduce the total amount of cases that must be written out.

When to use each one?

Many critics argue that negative testing is too similar to positive testing to provide any sort of novel insight. However, while similar, they are certainly not identical, and using both forms of testing in tandem can allow for the most comprehensive testing measure. While positive testing affirms that the given use case is valid, or correct, negative testing can prove that the software is devoid of issues that may deter a customer from successfully utilizing it.

Read More

July 19, 2019
Reducing Risk in Agile Development

How can you reduce risk when implementing agile development in your SDLC?

July 12, 2019
Bug Reproductions and Why They Matter

What are bug reproductions, and why do they matter? Could you be missing out?

July 10, 2019
Top 10 QA Blogs

Here are our top 10 software testing blogs.

Ship Faster, Sleep Better

Get a Demo