Question

This question is in continuation of me previous question at Positive test cases and negative test cases.

Suppose there is field which accepts only alphabets and suppose I write a test case which tests it by using alphabets only, then this is positive test case.

It is expected that if i enter any value other than alphabets then system will display error message "Only alphabets allowed!".

And If i check it with numeric values and it throws error message "Only alphabets allowed!" (as expected) then will this be a negative test case or the positive one?

Was it helpful?

Solution

Entering wrong input to fields is Negative test case. You write negative test cases and there could be two outcomes to it:

  1. Either this will work as expected, it means you will get error message and you will say test passed i.e. negative test passed

  2. Or it will break, means it will accept the input, in this case test has failed i.e. your negative test case has failed, this is a bug.

OTHER TIPS

Sorry, my response will be off topic, but the (my) rationale will be explained below.

Why does classifying your test cases by positivity or negativity matter? You have to perform both tests anyway. I prefer classifying tests as "primary" and "alternate". "Primary" describe happy paths, i.e. paths that allow the end user to actually do her job with your software. Alternate test cases describe the paths that impede the end user from doing her job, or achieving a result. (Invalid input, wrong credentials, resource unavailable, ...)

This is my definition for classifying tests. These are my words (borrowed from outside articles, with crispened definitions) It is useful to me, because I write/perform primary tests first, then alternate tests. I write primary tests thinking about what the user wants to do and how. (UX-mode) I write alternate tests thinking about what could actually "go wrong", like corrupt sysetm data, leak corporate information, and all other evils I can think of. (QA-mode)

The importance of using two words to classify tests (positive/negative) matters only if many people around you on the same project use these words. Then you should agree on a common definition. (and classification criteria) I don't think you'll get absolute answers by googling these words, just echoes of local testing cultures... unless you find any central unique authority that provides precise definitions, like a book on testing, or a website on testing, or a corporate document on testing.

If your feature description is like "In the yiffy field, only alphabetical characters are allowed", then testing on numerals is a negative testcase.

However if the not entering of others than alphabetical characters is that important that the feature description is like "In the yiffy field, the user can not enter non alphabetical characters", then testing on numerals would be a positive testcase.

But don't be too strict on this, because testing is all about finding the grey lines. In my language, the ij is a perfectly normal character, while in Germany the ß is very common. ٠١٢٣٤٥٦٧٨٩ Are digits/numerals (actually, they are the arabic numbers). As a tester you need to think about that testcases and evaluate how important a feature is (what is the risk is anyone does this) while testing. You don't want to spend precious time on testing nonsense.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top