bdd: a bit of an experiment
TRANSCRIPT
![Page 1: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/1.jpg)
Liz Keogh
@lunivore
March 2015
![Page 2: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/2.jpg)
![Page 3: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/3.jpg)
![Page 4: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/4.jpg)
An Example of an Example
Given Fred has bought a microwave
And the microwave cost £100
When we refund the microwave
Then Fred should be refunded £100.
![Page 5: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/5.jpg)
Examples
Given a context
When an event happens
Then an outcome should occur
![Page 6: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/6.jpg)
Cucumber
Feature: Addition
In order to avoid silly mistakes
As a math idiot
I want to be told the sum of two numbers
Scenario: Add two numbers
Given I have entered 50 into the calculator
And I have entered 70 into the calculator
When I add the numbers together
Then the result should be 120 on the screen
This is what most people associate with BDD
![Page 7: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/7.jpg)
Having conversations
![Page 8: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/8.jpg)
Examples
Given a context
When an event happens
Then an outcome should occur
![Page 9: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/9.jpg)
![Page 10: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/10.jpg)
Can you give me an example?
![Page 11: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/11.jpg)
Is there a context in which this event will create a different outcome?
![Page 12: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/12.jpg)
Examples
Given Fred has bought a microwave
And the microwave cost £100
And the microwave was on 10% discount
When we refund the microwave
Then Fred should be refunded £90.
![Page 13: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/13.jpg)
Is this the only outcome that matters?
If we could achieve it with pixies, would it be enough?
![Page 14: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/14.jpg)
Examples
Given Fred has bought a microwave
And the microwave cost £100
When we refund the microwave
Then the microwave should be added to the stock count.
![Page 15: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/15.jpg)
Turn the outcome into a question!
Given Fred has bought a microwave And the microwave cost £100
When we refund the microwave
Should the microwave be added to the stock count?
![Page 16: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/16.jpg)
Acceptance criteria vs. Scenarios
Given Fred has bought a microwave
And the microwave cost £100
And the microwave was on 10% discount
When we refund the microwave
Then Fred should be refunded £90.
![Page 17: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/17.jpg)
Acceptance criteria vs. Scenarios
Given an item was sold with a discount
When a customer gets a refund
Then he should only be refunded the discounted price.
![Page 18: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/18.jpg)
![Page 19: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/19.jpg)
A story about an organisation with partners
several organisations
![Page 20: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/20.jpg)
Whenever we do anything new
we will make discoveries
![Page 21: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/21.jpg)
Deliberate Discovery
Assume ignorance
Assume second order ignorance
Optimize for discovery
![Page 22: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/22.jpg)
Real Options
Options have value
Options expire
Never commit early unless you know why
![Page 23: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/23.jpg)
![Page 24: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/24.jpg)
If a project has no risks,
don’t do it.
![Page 25: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/25.jpg)
Cynefin
Obvious
Complicated Complex
Chaotic
With thanks to
David Snowden and Cognitive Edge
![Page 26: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/26.jpg)
BDD works really well…
…hereish.
![Page 27: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/27.jpg)
How to use scenarios…
…in this
space.
![Page 28: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/28.jpg)
Cynefin Trying
things
out Probe
Experiment
![Page 29: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/29.jpg)
A Safe-To-Fail Probe has…
A way of knowing it’s succeeding
A way of knowing it’s failing
A way of dampening it
A way of amplifying it
Coherence
![Page 30: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/30.jpg)
Coherence
A reason for thinking that the probe might have
a positive impact
Can you think of a scenario
in which this experiment succeeds?
![Page 31: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/31.jpg)
Success Scenarios
Given my boyfriend and I have been going out for four years
When we move in with each other
Then we should be really happy together.
![Page 32: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/32.jpg)
Success Scenarios
Given Fred has signed up for Appytastic
When we sync to Facebook by default
Then Fred’s friends should see how awesome Appytastic is!
![Page 33: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/33.jpg)
Failure Scenarios
Given my boyfriend and I have been going out for four years When we move in with each other
Then we might get on each other’s nerves.
![Page 34: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/34.jpg)
Failure Scenarios
Given Fred has signed up for Appytastic When we sync to Facebook by default
Then Fred and Fred’s friends might see that Appytastic has
massive privacy issues.
![Page 35: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/35.jpg)
A way of knowing it’s succeeding
We are really happy together.
Fred’s friends see how awesome Appytastic is (and sign up).
![Page 36: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/36.jpg)
Well-formed outcomes
Sensation
Vision
Hearing
Smell
Taste
![Page 37: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/37.jpg)
Success Metrics!
Happiness: 5, 4, 3, 2, 1
Sign-up rate increases (can you think of
an example of how much it increases by?)
![Page 38: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/38.jpg)
A way of knowing it’s failing
We get on each other’s nerves.
Fred and Fred’s friends might see that Appytastic has
massive privacy issues.
![Page 39: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/39.jpg)
Failure metrics!
Annoyance: 5, 4, 3, 2, 1
(but you get what you measure, so measure happiness)
Sign-up rate decreases; proportion of positive tweets decreases
![Page 40: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/40.jpg)
What if a meteor
hits our data centre?
![Page 41: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/41.jpg)
A Safe-To-Fail Probe has…
A way of knowing it’s succeeding
A way of knowing it’s failing
A way of dampening it
A way of amplifying it
Coherence
A way of avoiding failure completely
![Page 42: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/42.jpg)
Make it cheap to fail.
Given my boyfriend and I have been going out for four years When we move in with each other
Then we might get on each other’s nerves.
(Rent a place together for a year.)
![Page 43: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/43.jpg)
Make it cheap to fail
Given Fred has signed up for Appytastic When we sync to Facebook by default
Then Fred and Fred’s friends might see that Appytastic has
massive privacy issues!
(Put the flag on the server.)
![Page 44: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/44.jpg)
Estimating Complexity
5. Nobody has ever done it before
4. Someone outside the org has done it before (probably a competitor)
3. Someone in the company has done it before
2. Someone in the team has done it before
1. We all know how to do it.
![Page 45: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/45.jpg)
Estimating Complexity
5 4 3
2
1
Complicated Complex
Obvious
![Page 46: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/46.jpg)
Familiarity
5 4 3
2
1
Experts familiar
with scenarios Unfamiliar
scenarios
Familiar
scenarios
![Page 47: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/47.jpg)
Familiarity
5 4 3
2
1 Disaster
movies!
![Page 48: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/48.jpg)
A Naïve Scenario
CONTEXT EVENT OUTCOME
Well-formed outcome
Event which leads to the
outcome
Reality. It’s all good,
right?
![Page 49: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/49.jpg)
Reality. It’s all good,
right?
Subgoals
CONTEXT EVENT OUTCOME
Well-formed outcome
Event which leads to the
outcome
Unwanted Context
Unwanted Outcome!
![Page 50: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/50.jpg)
Unwanted Context
Subgoals
CONTEXT EVENT OUTCOME
Well-formed outcome
Event which leads to the
outcome
Replacement context
Unwanted Outcome!
![Page 51: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/51.jpg)
Given Scenario
CONTEXT EVENT OUTCOME
Well-formed outcome
Event which leads to the
outcome
Unwanted Context
Replacement context
EVENT OUTCOME
Event which leads to
replacement
![Page 52: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/52.jpg)
Changing reality
CONTEXT EVENT OUTCOME
Well-formed outcome
Event which leads to the
outcome
Unwanted Context
Replacement context
EVENT
Event which leads to the
replacement
CONTEXT
![Page 53: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/53.jpg)
Creating options
Is there any context which we could introduce
in which more events
would give us outcomes we want?
![Page 54: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/54.jpg)
![Page 55: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/55.jpg)
![Page 56: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/56.jpg)
![Page 57: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/57.jpg)
![Page 58: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/58.jpg)
![Page 59: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/59.jpg)
Experiment Portfolio
At least one oblique
At least one naïve
Conflicting experiments
![Page 60: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/60.jpg)
Trust is what you do
when you don’t have any options.
Make it safe to fail.
![Page 61: Bdd: a bit of an experiment](https://reader031.vdocuments.us/reader031/viewer/2022021922/58777e971a28abc85f8b51b1/html5/thumbnails/61.jpg)
Liz Keogh http://lizkeogh.com @lunivore