Bdd: a bit of an experiment
-
Upload
agilecymru -
Category
Software
-
view
966 -
download
0
Transcript of Bdd: a bit of an experiment
Liz Keogh
@lunivore
March 2015
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.
Examples
Given a context
When an event happens
Then an outcome should occur
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
Having conversations
Examples
Given a context
When an event happens
Then an outcome should occur
Can you give me an example?
Is there a context in which this event will create a different outcome?
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.
Is this the only outcome that matters?
If we could achieve it with pixies, would it be enough?
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.
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?
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.
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.
A story about an organisation with partners
several organisations
Whenever we do anything new
we will make discoveries
Deliberate Discovery
Assume ignorance
Assume second order ignorance
Optimize for discovery
Real Options
Options have value
Options expire
Never commit early unless you know why
If a project has no risks,
don’t do it.
Cynefin
Obvious
Complicated Complex
Chaotic
With thanks to
David Snowden and Cognitive Edge
BDD works really well…
…hereish.
How to use scenarios…
…in this
space.
Cynefin Trying
things
out Probe
Experiment
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
Coherence
A reason for thinking that the probe might have
a positive impact
Can you think of a scenario
in which this experiment succeeds?
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.
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!
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.
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.
A way of knowing it’s succeeding
We are really happy together.
Fred’s friends see how awesome Appytastic is (and sign up).
Well-formed outcomes
Sensation
Vision
Hearing
Smell
Taste
Success Metrics!
Happiness: 5, 4, 3, 2, 1
Sign-up rate increases (can you think of
an example of how much it increases by?)
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.
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
What if a meteor
hits our data centre?
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
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.)
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.)
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.
Estimating Complexity
5 4 3
2
1
Complicated Complex
Obvious
Familiarity
5 4 3
2
1
Experts familiar
with scenarios Unfamiliar
scenarios
Familiar
scenarios
Familiarity
5 4 3
2
1 Disaster
movies!
A Naïve Scenario
CONTEXT EVENT OUTCOME
Well-formed outcome
Event which leads to the
outcome
Reality. It’s all good,
right?
Reality. It’s all good,
right?
Subgoals
CONTEXT EVENT OUTCOME
Well-formed outcome
Event which leads to the
outcome
Unwanted Context
Unwanted Outcome!
Unwanted Context
Subgoals
CONTEXT EVENT OUTCOME
Well-formed outcome
Event which leads to the
outcome
Replacement context
Unwanted Outcome!
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
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
Creating options
Is there any context which we could introduce
in which more events
would give us outcomes we want?
Experiment Portfolio
At least one oblique
At least one naïve
Conflicting experiments
Trust is what you do
when you don’t have any options.
Make it safe to fail.
Liz Keogh http://lizkeogh.com @lunivore