Demystifying the puzzle: “Test Case” & “Test Scenario”

“In the field of Software Testing, misunderstanding a feature is like a cancer for your ongoing testing process, which make your Test scenarios and Test cases inefficient and inaccurate.”

Knowing the difference between “Test Scenarios” and “Test Cases” is the first step of your testing journey. So, let’s take our first step in the right path and understand what test cases and scenarios are and how we can frame them, to maximize the scope of testing. Let’s move to the definitions, tips and some examples for Test Scenarios and Test Cases for a better understanding and more clarity.

Test Scenario:  A test scenario is a statement which describes a functionality of an application which is useful for end to end feature testing. And a single test scenario can be associated with one or many test cases.

Example 1:

Assume we need to test the login functionality of “Sign in” page of any site.

Scenario: Verify the Login Functionality.

Example 2:

Let’s take another example: Assume you need to test the thermo steel water.

Taking “Durability” as a feature, scenarios can be:

1) Verify durability with liquids of different temperature.

2) Verify durability by pouring different types of liquids.

And thus, the list can go on.

As we see Test Scenario is made of two words, Test which stands for validation or verification and Scenario stands for user journey. Combining both will be verifying user journey.

Tips to Create Test Scenarios

  • A single Test Scenario should be attached to a minimum of one feature in your project.
  • Avoid creating complicated Test Scenarios spanning multiple features.
  • If there is a scenario spanning multiple features, then make sure that you have isolated scenarios to test such features.

Test Cases: Test case can be defined as a set of positive and negative executable steps having pre-defined conditions, test data, expected result, post-conditions and actual result based on which tester can determine if a functionality in an application is partially or fully working.

One to many test cases can be associated with a single scenario. Or you can derive your application testing on test cases solely.

Example 1:

Assume we need to test the login functionality of “Sign in” page of any site.

Test Case 1: Enter valid User Name and valid Password
Test Case 2: Enter valid User Name and invalid Password
Test Case 3: Enter invalid User Name and valid Password
Test Case 4: Enter invalid User Name and invalid

Example 2:

Taking the 1st scenario for thermo steel bottle durability test, the test case can be as follows:

Test Case 1: Pouring hot water of 125-degree Fahrenheit in the bottle.

Test Case 2: Put ice in the bottle and on that pour hot water.

Tips to write Test cases:

  • An effective test case should contain
  1. Test case id – It will help test case report maintainable and easy to map with scenarios.
  2. Unit to test: It will define what needs to be verified?
  3. Test data: Variables and their related values
  4. Steps to be executed
  5. Expected result – Provides expected outcome of a test case when executed.
  6. Actual result- It is the result after the actual test case is executed.
  7. Pass/Fail – Pass/Fail can be flagged according to the variation in expected vs actual result.
  8. Comments
  • Steps need to be clear, precise and easy to understand. One step should represent single step only.
  • Cover functional, non-functional, boundary level, and positive and negative test cases as well.
  • Test Cases are prone to regular revision and update, so review them once you are done with a test case.
  • And, finally make it simple but not too simple. Make it complex but not too complex.

A comparison between a Test Scenario and Test Case in a tabular format.

Test Scenario Test Case
Guides a user on “what to test”. Guides a user on “how to test”.
Easy to maintain and are less time consuming. As there are redesigns in an application which come from new or enhancing functionalities, Test cases become more complex to maintain.
Helpful in an agile way of testing end to end functionality. Helpful in exhaustive testing of application.
Are high level actions. Are low level actions.
Mostly Test scenarios are derived from use cases. Test cases are derived from scenarios.

 

Note: Using both Test Scenario and Test Cases together will ensure a robust, high coverage testing initiative. It’s a best practice to write Test Scenarios and then move on to Test Cases.

And now, let’s go through some of the advantages which these two provide in field of testing:

  1. Better Consistency: When we use test cases and test scenarios for test executions, the engineer’s work will be organized and simplified. E.g. When a release version 1.0 is being tested with test cases maintained properly, the same test cases can be quickly executed for the next release 1.0.1 and having test cases also helps us to identify which issue in what priority impacted the old build.
  2. No dependency: Documenting Test cases and Test scenarios effectively will make testing more process dependent instead of person.

And the list can be continued with Accuracy, Maximized Coverage, Reusability etc. These advantages will be different, and you may find them in different stages in your testing project.

Don’t forget to share some of your valuable experiences while learning them and the advantages/disadvantages you faced while working with Test Scenarios and Test Cases.

Jeevan

Related posts

Challenges bring the best out of us. What about you?

We love what we do so much and we're always looking for the next big challenge, the next problem to be solved, the next idea that simply needs the breath of life to become a reality. What's your challenge?