7

I still do not fully understand the difference between a User Story and a Test Scenario. How are the two different?

10

A user story describes a piece of functionality from the perspective of a user. A classic example is:

As a registered customer, I need to see a list of my orders so I can manage my purchasing.

A test scenario is a description of how a piece of functionality is expected to behave, with no specific perspective. The user story example I gave implies several test scenarios:

  1. A logged in customer can navigate to an order history page and view a list of all their orders.
  2. A logged in customer can navigate to an order history page and will not see orders for any other customer.
  3. A customer who is not logged in cannot navigate to an order history page.

The important thing to remember here is that different testers will often generate different test scenarios for any given user story: they will cover the same functionality, but depending on the needs of the organization and the tester's preferences the scenarios may be high level or more granular.

4

The most basic distinction between a User Story and a Test Scenario is that:

User Story is a business artifact which defines the software requirement or an application feature.

Whereas Test Scenario is a test artifact which defines the steps to validate and verify that the software requirement or application feature exists.

For example: In a ecommerce application, the following can be classified as User Stories:

  1. As a User I want to checkout items in shopping cart
  2. As a User I want to update my delivery address

The following can be classified as Test Scenarios for the above mentioned User Story no.1:

1.1 Verify User can checkout an item from shopping cart

  • Given User is viewing item details
  • When User clicks on Add to Cart button
  • Then Item is displayed in the Shopping Cart page
  • When User clicks on Checkout button
  • Then Application displays a confirmation message: 'Checkout successful!'

1.2 Verify Application does not allow user to checkout an empty shopping cart

  • Given User has not added any item to shopping cart
  • When User navigates to Shopping Cart page
  • When User clicks on Checkout button
  • Then Application displays a error message: 'Shopping Cart is empty! Please add items to checkout.'

Similarly for User Story no.2:

2.1 Verify a new user can add a new delivery address

2.2 Verify an existing user can add a new delivery address

I hope the difference is clear.

Good luck.

3

They have a different focus:

  • User Story: Explains the value, the why of the functional requirement. Is high level. A means to discuss the end-in-mind.
  • Test scenario: Explains how to validate the execution of (non-)functional requirement. Contains more details. A means to validate behaviour.

Both could be in a format of story-telling and thus feel high-level, but the reason to use them is different.

In Agile software development I think these links might help:

User stories:

User stories are short, simple descriptions of a feature told from the perspective of the person who desires the new capability, usually a user or customer of the system.

https://www.mountaingoatsoftware.com/agile/user-stories

Test scenarios:

A feature usually contains a list of scenarios.

...

Every scenario consists of a list of steps, which must start with one of the keywords Given, When, Then, But or And.

https://github.com/cucumber/cucumber/wiki/Feature-Introduction

  • Why only functional requirement for the test scenario? In performancetesting for example you also have test scenarios. – Patrick Oct 13 '17 at 10:38
  • 1
    I think in the context of UserStory vs TestScenario functional is the most common misconception, but yes performance testing could be a test-scenario of a story or a test-scenario on its own. Given I increase the load of the server, When a new user logins in, Then the applications behaves within acceptable parameters (e.g. response-times, etc..). But non-functional requirements are not typical user-stories, although users probably care about them. Added (non-) functional to the answer :) – Niels van Reijmersdal Oct 13 '17 at 11:55
0

User Story - Usually associated with agile, a user story is essentially a requirement but written in a certain way.

A user story will contain the following information

  • title - in the format of As a {type of user}, I want {a outcome} so that {a reason>}.
  • Acceptance criteria - A list of criteria which you can consider as features of a user story.

Test Scenario - This contains the test cases or steps to validate the story and usually you would want to validate each acceptance criteria which has been listed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.