7

I'm quite new to working in Agile and with user stories and scenarios in the BDD tool Cucumber and ideally I'll need to go on a course of all of this. I have a set of user stories that need to be edited for an upcoming release.

As an example one of the user stories is:

'As a user
I want a visual indicator on entry into the application'

This needs to be changed to:

As a producer, I don’t want a textured background in the application 

The Acceptance Criteria (In Gherkin format for those familiar with Cucumber) for the original user story (the first one above) is

    Scenario: Show background image when video is not playing

    Given the application restarts 
When the home menu is displayed
Then the full-screen textured background should be visible at the correct resolution

For the new user story (second one above), the acceptance criteria that I have written, but not certain of is:

Scenario: Show dark grey background when video is not playing

Given the application restarts 
When the home menu is displayed
Then the dark grey background should be visible at the correct resolution

Does this look right? Or am I missing information? I'm, quite new to this, so please bear with me.

MattDavey
  • 7,096
  • 3
  • 31
  • 32
fdama
  • 71
  • 2
  • 3
    Don't use Cucumber to test aesthetics. You're always going to verify them manually anyway, and check again every time they change. Just tie it to what the customer really wants, eg: "As a producer, I want to be able to see text clearly against the background", and leave the rest of it up to the UX guys. Aesthetics and usability are not good candidates for BDD scenarios IMO. The only exception to this is if you're producing some kind of GUI framework for use in another application (in which case what you have is fine). – Lunivore Aug 30 '12 at 20:08

1 Answers1

6

One item of feedback I would have about your stories. The When component is for describing an action that the user performs - therefore I would expect to see a verb near the start of each When step. Currently your When steps are more like Givens, as they set up the scenario in a known state.

Does the user actually have to do anything to get the home menu to display? It may be that in your scenario the user does not perform any action, in this case it's perfectly acceptable that there be no When steps, only Givens and Thens.

Given the application starts
Then the home menu should be displayed
And I should see a dark grey background

Or you might decide that the user action is (re)starting the application, in which case you don't necessarily need a Given...

When I restart the application
Then the home menu should be displayed
And I should see a dark grey background
MattDavey
  • 7,096
  • 3
  • 31
  • 32
  • 2
    I agree with the second example (The one starting with "When I restart the application"). "Given" should describe preconditions, "When" should describe an action and "Then" should describe something to be verified. I have a really hard time coming up with a scenario that feels correctly written without the "When" part. – Buhb Aug 23 '12 at 13:21
  • Agreed, although in the second example we haven't set up the state of the scenario, it probably requires a `Given the application is running` in order for `When I restart the application` to make sense. – MattDavey Aug 23 '12 at 13:38