Skip to content

Feature Behaviour Documentation | Gherkin Style User Stories

Fionna Chan edited this page Dec 16, 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: Variable Name

Given the experiment has 1 iteration of data from training
When I click at a variable name
Then I should see one dot is removed from the Metrics chart below "Learning Progress"
And the shape, the color and the tooltip labels of the other lines remained the same
Given the experiment has at least 2 iterations of data from training
When I click at a variable name
Then I should see one line is removed from the Metrics chart below "Learning Progress"
And the shape, the color and the tooltip labels of the other lines remained the same

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
And the sparklines should have the same number of iterations as the best policy on the policy chart

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 of [any training status] with at least 1 iteration of data and switched to another experiment with at least 1 iteration of data via clicking the side nav

Simulation Metrics: Variable Name, & Metrics Chart under Learning Progress

Given one or more variable names were deselected on the experiment page
When I switched to another experiment
Then I should see all variable names being selected
And I should see all metric dots (if only 1 iteration of data exist) / lines on the Metrics chart below "Learning Progress"

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

Metrics Chart under Learning Progress

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 metrics chart should be visible even if it is empty

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)

Metrics Chart under Learning Progress

Given the experiment is at [Running] status
When the metrics chart gets updated
Then the metrics chart lines must be updated without losing the data points shown previously before the update
And the metrics chart should have the same number of iterations as the best policy on the policy chart and any of the sparkline charts

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 a [Running] Experiment and I clicked "Stop Training"

"Stop Training" Button

Given the experiment is at [Running] status
When I click "Stop Training"
Then the "Stop Training" button should disappear

Training Status

Given the experiment is at [Running] status
When I click "Stop Training"
Then the training status should change from "Running" to "Stopping" or "Stopped"

Side Navbar Status Icon

Given the experiment is at [Running] status
When I click "Stop Training"
Then the training status icon on the navbar should change from "Running" to "Stopped"

Other Browser Tabs of the Same Experiment

Given the experiment is at [Running] status
When I click "Stop Training"
Then the page elements should react in the same way as on the tab where the action was taken

Other Browser Tabs of a Different Experiment of the Same Model

Given the experiment is at [Running] status
When I click "Stop Training"
Then the only change on the other browser tabs would be the navbar icon status

Other Browser Tabs of a Different Experiment of a Different Model

Given the experiment is at [Running] status
When I click "Stop Training"
Then there should be no change

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