Negative and Positive Testing

Kishor Munot
Aug 6 · 5 min read
Software Testing

Software testing plays a very important role in product development. Product testing increases confidence in product development and ensures that the product is user-friendly and bug-free. We complete the first stage of development of the product and give the product to the testing team to perform a functional and non-functional test on the product. The testing team considers all requirements and performs positive testing on the product and also performs load testing and other non-functional testing on the same. Sometimes we may encounter major bugs after the test is completed or before the product is released, and the possibility of damage to the product cannot be ruled out. The product also needs to be tested with positive scenarios well as negative while testing the product so that the users of the product do not find big questions and the product is not damaged.

Software Testing

Software Testing is a method to check whether the actual software product matches expected requirements and to ensure that the software product is defect-free. Software Testing aims not only at finding faults in the existing software but also at finding measures to improve the software in terms of efficiency, accuracy, and usability. It mainly aims at measuring the specification, functionality, and performance of a software program or application.

How much testing is enough?

Selecting which test conditions to cover is a fundamental problem of testing. The number of possible test cases is infinite for all but the simplest systems. Given Immortality and unlimited resources, we could conceivably test forever. However, in the real world or in real projects, we can only select a finite number of test cases for design, implementation, and execution.

Instead of trying to find every possible test case, an impossible ideal, we should focus on what tests give us the greatest value by covering the most important parts of the system or module. Testing is part of how these risks of failure can be reduced.

“How much testing is enough? I would like to answer this question differently because there is no exact answer to this question. It is parallel to a “good diet”. A good diet consists of carbohydrates, proteins, minerals, salt, and water. So, a good test coverage focuses on what is needed for overall health and adds what is required. In the idea of testing, a good app (as an example) is a combination of its functional stability, its performance, and the experience it delivers to the user. It is also about how does it help the business people achieve their goals. So, good test coverage is good coverage of all these parameters.

Positive Testing & Negative Testing

Positive testing determines that your application works as expected. If an error is encountered during positive testing, the test fails. Negative testing ensures that your application can gracefully handle invalid input or unexpected user behavior.

Positive Testing:
Positive testing is a type of software testing that is performed by assuming everything will be as expected. It is performed with the assumption that only valid and relevant things will occur. data set and all other functionalities will be as expected.

Negative Testing:
Negative testing is a type of software testing that is performed to check the system for unexpected conditions. Negative testing plays a much important role in high-performance software development. It checks whether on such unexpected conditions what will be the behavior of the software.

Sometimes, the client or end-user finds the major issue in your product and that issue blocks the use of their application. This type of situation is unsettling for both the client & end-user and the team that developed the application. Most of the time this situation occurs because we have not performed the negative tests on the application. It is very important to perform the negative tests on the developed product because we can't find critical bugs by only performing positive tests on the application.

Negative Testing is performed for unexpected conditions. It covers all possible cases & ensures a good quality product. It takes more time than positive testing but it should be done before deployment of the product. It is performed where are chances of unexpected conditions or unexpected behavior by the application.

Positive Testing vs Negative Testing

How to perform Positive and Negative Testing.

In both the testing, the following needs to be considered:

  • The tester or user performing a positive test must know the full requirements of a product, as well as the tester, must know the product in detail to perform a negative test such as all the information about e-commerce to test an e-commerce application.
  • The user should know about Boundary Value Analysis and Equivalence Partitioning so that the test completion criteria can be specified.

Example

As an example, consider the following user story:

“As an instructor, I want to be able to schedule vacation time so that I don’t get scheduled to teach when I’m not available.”

Acceptance criteria:

  • Should only be able to schedule vacation time in the future
  • Can only schedule vacation time for myself
  • Can’t take more than my annual allotment
  • Don’t allow more than two consecutive weeks of vacation to be scheduled

The story is typically written to describe the valid action that the user wants to take, and positive tests can be derived from it. Acceptance criteria often describe invalid actions or data, and negative tests can be derived from them.

Conclusion:

Testing helps deliver quality software applications and ensures the software is bug-free before the software is launched. For effective testing, use both — Positive and Negative testing which gives enough confidence in the quality of the software. In short, you should test your product unless you have the confidence to give a proper explanation if a problem arises during deployment.

Keep Learning & happy testing!!!!

Thank you.

nonstopio

A Bespoke Engineering Studio