Software Testing Questions

Are you preparing for a software testing interview?

This site has collected the most commonly asked software testing questions that you will face during your interview. We’ve also got the right answers to those questions.

You need to prepare well to have a chance of besting all the other people who are applying for the same job. This means you have to be able to answer any of the software testing questions that are listed on this site, because these questions are sure to come up during the interview.

Where to start? First, check out the most recently answered software testing questions below. Afterwards, go through the categories in the navigation bar (“Testing Types”, “SDLC”, …) to make sure you have each major category covered.

Be Sociable, Share!

Recent Posts

Negative Test Cases

What are negative test cases?

If you get faced by this software testing question during an interview, first define positive and negative test cases, and then give a few examples.

Positive test cases test that the application does what it should.

Negative test cases test that the application doesn’t do what it shouldn’t do.

Huh? Not too clear?

Basically, positive test cases means feeding in valid input into the application, and checking that the app computes the right result, or otherwise behaves in the correct way.

Negative test cases, on the other hand, feed the application invalid input, and generally try to trick the app in different ways. The point is that the app should not do the “correct” thing – the thing that it would do in the positive case.

Examples?

Negative Test CasesImagine a basic login screen. The login screen should only allow you to log in when you’ve supplied the right username and password.

The positive test case would check that the application allows you to log in when you give it a valid username and password.

A negative test case would check that the app doesn’t allow you to log in when you give an invalid username and password, or when you don’t supply any password, or when you supply a password containing characters that the system doesn’t accept as password characters.

Example 2:

Imagine a function written in a dynamically typed language that computes the square of a number.

The positive test cases would feed a number to the function, and check that the result is indeed the square of that number.

The negative test cases would depend on the specifications for how the function should behave for all input other than integers. Should the app throw an exception, return the input value, try to compute the square using operator overloading, return some constant, or is the behavior undefined? The specifications have to tell us this. However, at the least, we can test whether the function will crash or throw a fault or otherwise do something that is clearly undesirable. So the negative test case might feed the function a string, an object reference, a list, or any other non-number value.

Be Sociable, Share!
  1. How Do You Know When To Stop Testing? Leave a reply
  2. How Would You Test a Vending Machine? Leave a reply