When it comes to grouping test scenarios, basically you have two alternative paths: an easy route or a tough one. The fundamental part is to classify them. Although a few everyday concepts might not always resonate well in our minds, it is crucial to build confidence and assurance of successful outcomes. In this article, we illustrate a simple example and provide convenient techniques to illuminate these concepts, ensuring you always get it right.
Dividing Test Scenarios/Cases into Positive or Negative
The test development process can be broken down into three steps:
Recommended IPTV Service Providers
- IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
- IPTVRESALE – Rating 5/5 ( 200+ Reviews )
- IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
- IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
- IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
- IPTVTOPS – Rating 5/5 ( 43 Reviews )
- Identify requirements
- Create test scenarios (concise descriptions of what to check)
- Prepare specific instructions on the testing procedure (test cases)
In the process of devising test scenarios, we categorize these scenarios into positive and negative conditions. You may be curious as to whether this division is indeed necessary. If so, what is the purpose it fulfills? Given that we must examine all situations, the question remains. It’s a perplexing question, but this sorting aims to guarantee sufficient coverage and ascertain we are testing both the anticipated route (positive) and alternative routes (negative) that the system is embodied to manage. Feel free to share any additional reasoning behind this categorizing in the comments below.
Now let’s dive into some requirements, articulate test scenarios, and execute the classification.
#1) Login: A user obtains system access upon the accurate entry of credentials. If the credentials are inaccurate, admission is denied, and an error message appears.
#2) View products: An online catalog presents all obtainable products in a list when the “View products” hyperlink is activated.
#3) Logout: By activating the “Logout” link, the user’s session terminates.
Let’s develop several test scenarios for these requirements.
Table A: The accurate method
Test scenario ID | Test scenario description | Positive/Negative |
---|---|---|
TS_login_01 | Authenticate successful login with accurate credentials | Positive |
TS_login_02 | Authenticate access denial with wrong credentials | Negative |
TS_ViewProduct_01 | Authenticate all products are shown when “View products” link is activated | Positive |
TS_logout_01 | Authenticate user session termination when “Logout” is activated | Positive |
However, on occasion, I notice test scenarios written in this manner:
Table B: Entries colored Red indicate incorrect test scenarios.
Test scenario ID | Test scenario description | Positive/Negative |
---|---|---|
TS_login_01 | Authenticate successful login with accurate credentials | Positive |
TS_login_02 | Authenticate access denial with wrong credentials | Negative |
TS_ViewProduct_01 | Authenticate all products shown when “View products” link is activated | Positive |
TS_ViewProduct_02 | Authenticate non-listing or wrong listing when “View products” link is activated | Negative |
TS_logout_01 | Authenticate user session termination when “Logout” is activated | Positive |
TS_logout_02 | Authenticate user remaining logged in when “Logout” is activated | Negative |
For the situation of successful login, there is a converse scenario when it fails to be efficient. Nevertheless, not all requirements necessitate negative situations, hence there is no obligation to generate negative scenes for every requirement.
Crux: Not every requirement demands negative scenarios.
If you still harbor doubts regarding the classification or how you would discern, here’s a straightforward guide at your disposal:
Applications are dynamic, and the input we provide triggers a certain conduct and result. By correlating the input and output variables, we can effortlessly comprehend the rules of classification.
Let’s bring the instance of the login:
Input | Output | Positive/Negative |
---|---|---|
Correct (right login details) | Correct (User logs in) | Positive |
Incorrect (wrong login details) | Correct (An error prompt) | Negative |
Correct (right login details) | Incorrect – Login fails | Bug/Defect |
Incorrect (wrong login details) | Incorrect (system logs them in) – “Oh, the horror!” 🙂 | Bug/defect |
From the table above, we can infer that the primary flow is tagged as positive and the alternative flow (which precisely mirrors the correct behavior of the application) is tagged as negative.
The last couple of cases colored in red denote bugs. The objective of testing is to validate specifications, and when they malfunction, we identify bugs. Given that we are not investigating for defects, the last two instances become invalid.
Applying the same thinking to logout and view products, yields the following results:
Input | Output | Positive/Negative |
---|---|---|
Logout (click) | Correct – Successfully logs out | Positive |
Logout (click) | Incorrect – Session persists | Bug/defect |
View products (click) | Correct – Exhibits products | Positive |
View products (click) | Incorrect (not listed or incorrect product display) | Bug/defect |
As discernible from above, for these particular requirements, there is no chance of incorrect input. Thus, it’s not obligatory to compose negative test scenarios/cases.
Closing Remarks:
The system might be subjected to both positive or negative inputs, yet it needs to generate correct outputs, irrespective. The cases involving correct inputs get classified as positive, while the cases that tackle correct but negative inputs are tagged as negative.
A few helpful hints:
#1) While authoring end-to-end test cases for user acceptance reassessments (UAT) or system examinations, positive testing cases are generally incorporated.
#2) Occasionally, the division can be subjective. For instance, when there is an option to delete an entity on a site and a subsequent confirmation message that inquires, “Are you sure you wish to erase this entry?” with OK and Cancel options, according to some, the act of clicking cancel is deemed a positive case. However, others view it as negative, as the primary intent of the “Delete” option is elimination rather than nullification. Consequently, a tester’s intuition can also influence the classification.
#3) Not all positive instances possess an equal and contrary negative case.
The suggested method ensures accurate classification. You are encouraged to employ it yourself and ascertain if it suits your workflow. Bear in mind that “Often, shortcuts are the longest way around,” albeit not always the case here!
For a more formally articulated explanation of negative testing, kindly refer to our article: What is Negative Testing and How to Generate Negative Test Cases?
About the author: This knowledgeable write-up was penned by Swati S., a valued member of the STH team. Join her live QA training course: “The most comprehensive software testing training you will ever receive!“
If you found this article insightful and would appreciate more explanations of fundamental concepts in future articles, kindly inform us. Your comments, questions, feedback, and patronage here at STH are highly regarded and cherished. Happy testing!