Skip to content

Feature Behaviour Documentation | Gherkin Style User Stories

Fionna Chan edited this page Oct 14, 2020 · 6 revisions

Why Do We Need User Stories?

As our app is growing in size and complexity, it is easy to lose track of how each feature should exactly behave.

In order to reduce regression bugs, and to communicate feature requirement across teams, this is a WIP documentation of user stories written in Gherkin syntax.

The main benefit of using the Gherkin syntax is that we can implement the BDD tests according to the requirements easily.

Example of a User Story

Feature: As a user I want to sign in so I can see my marketing campaigns

Scenario: User supplies correct user name and password

Given that I am on the sign-in page
When I enter my user name and password correctly
And click ‘Sign In’
Then I am taken to the dashboard

Scenario: User does NOT supply correct user name and password

Given that I am on the sign-in page
When I enter my user name and password incorrectly
and click ‘Sign In’
Then I see an error message ‘Sorry, incorrect user name or password.’

Pathmind Webapp User Stories

Feature: As a user I am on the Experiment Page viewing an experiment of [any training status]

Simulation Metrics: Variable Names

Given that I am on the experiment page
When I look at the simulation metrics box
Then I should see the list of variable names which is the same as the list of reward variables extracted from my simulation model

Observations

Given that I am on the experiment page
When I look at the observations box
Then I should see a list of observations extracted from my model
And the observations with a checked checkbox are the same as the observations I selected for the experiment before running it

Reward Function

Given that I am on the experiment page
When I look at the reward function box
Then I should see the reward function
And I can copy and paste the reward function by highlighting it or clicking the copy button on the top right corner

Feature: As a user I am on the Experiment Page viewing an experiment of [any training status] with at least 1 iteration of data

(impossible to be of [Not Started] / [Starting Cluster] status)

Simulation Metrics: Value

Given the experiment has 1 iteration of data from training
When I look at the simulation metrics box
Then I should see the values of the simulation metrics

Simulation Metrics: Sparklines

Given the experiment has 1 iteration of data from training
When I look at the simulation metrics box
Then I should see the sparklines of the simulation metrics

Policy Chart

Given the experiment has 1 iteration of data from training
When I look at the policy chart
Then the policy chart must have at least one dot in dark blue (the only data point from the best policy)
Given the experiment has at least 2 iterations of data from training
When I look at the policy chart
Then the policy chart must have more than one policy line (semi-transparent)
And there must be one "best policy" line in dark blue (solid color)

Feature: As a user I am on the Experiment Page viewing an Experiment which changed from [Starting Cluster] to [Running]

Simulation Metrics: Value

Given the experiment is at [Starting Cluster] status
When the experiment changed to [Running] status
Then the simulation metric values and the header "Value (i)" will change from hidden to shown

Simulation Metrics: Sparklines

Given the experiment is at [Starting Cluster] status
When the experiment changed to [Running] status
Then the sparklines and the header "Overview (i)" will change from hidden to shown

Policy Chart

Given the experiment is at [Starting Cluster] status
When the experiment changed to [Running] status
Then the training starting placeholder should become hidden
And the policy chart should be visible even if it is empty

Feature: As a user I am on the Experiment Page viewing a [Running] Experiment

Simulation Metrics: Value

Given the experiment is at [Running] status
When the simulation metric value gets updated
Then the simulation metric value must not change drastically (e.g. changing from 76 to 71 seems normal, however it should not change from 200 to 20 after 1 new iteration)
And the simulation metric value should not flash (e.g. previously showing 215, after receiving update it became 16, then after a few seconds it became 180)

Simulation Metrics: Sparklines

Given the experiment is at [Running] status
When the sparklines gets updated
Then the sparkline must not change its shape completely (i.e. as long as the best policy is the same, the data points for previous iterations should not change)

Policy Chart

Given the experiment is at [Running] status
When the policy chart gets updated
Then the policy chart lines must be updated without losing the data points shown previously before the update

Feature: As a user I am on the Experiment Page viewing an Experiment which changed from [Running] to [Completed]

Simulation Metrics: Value

Given the experiment is at [Starting Cluster] status
When the experiment changed to [Running] status
Then the simulation metric values will have the uncertainty value e.g. 1.02 ± 0.23 where 1.02 is the metric value and ± 0.23 is the uncertainty part

TO BE CONTINUED

Clone this wiki locally