Bdd: a bit of an experiment

61
Liz Keogh @lunivore March 2015

Transcript of Bdd: a bit of an experiment

Page 1: Bdd: a bit of an experiment

Liz Keogh

@lunivore

March 2015

Page 2: Bdd: a bit of an experiment
Page 3: Bdd: a bit of an experiment
Page 4: Bdd: a bit of an experiment

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

Examples

Given a context

When an event happens

Then an outcome should occur

Page 6: Bdd: a bit of an experiment

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

Having conversations

Page 8: Bdd: a bit of an experiment

Examples

Given a context

When an event happens

Then an outcome should occur

Page 9: Bdd: a bit of an experiment
Page 10: Bdd: a bit of an experiment

Can you give me an example?

Page 11: Bdd: a bit of an experiment

Is there a context in which this event will create a different outcome?

Page 12: Bdd: a bit of an experiment

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

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

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

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

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

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
Page 19: Bdd: a bit of an experiment

A story about an organisation with partners

several organisations

Page 20: Bdd: a bit of an experiment

Whenever we do anything new

we will make discoveries

Page 21: Bdd: a bit of an experiment

Deliberate Discovery

Assume ignorance

Assume second order ignorance

Optimize for discovery

Page 22: Bdd: a bit of an experiment

Real Options

Options have value

Options expire

Never commit early unless you know why

Page 23: Bdd: a bit of an experiment
Page 24: Bdd: a bit of an experiment

If a project has no risks,

don’t do it.

Page 25: Bdd: a bit of an experiment

Cynefin

Obvious

Complicated Complex

Chaotic

With thanks to

David Snowden and Cognitive Edge

Page 26: Bdd: a bit of an experiment

BDD works really well…

…hereish.

Page 27: Bdd: a bit of an experiment

How to use scenarios…

…in this

space.

Page 28: Bdd: a bit of an experiment

Cynefin Trying

things

out Probe

Experiment

Page 29: Bdd: a bit of an 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

Page 30: Bdd: a bit of an experiment

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

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

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

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

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

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

Well-formed outcomes

Sensation

Vision

Hearing

Smell

Taste

Page 37: Bdd: a bit of an experiment

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

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

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

What if a meteor

hits our data centre?

Page 41: Bdd: a bit of an 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

A way of avoiding failure completely

Page 42: Bdd: a bit of an experiment

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

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

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

Estimating Complexity

5 4 3

2

1

Complicated Complex

Obvious

Page 46: Bdd: a bit of an experiment

Familiarity

5 4 3

2

1

Experts familiar

with scenarios Unfamiliar

scenarios

Familiar

scenarios

Page 47: Bdd: a bit of an experiment

Familiarity

5 4 3

2

1 Disaster

movies!

Page 48: Bdd: a bit of an experiment

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

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

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

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

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

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
Page 55: Bdd: a bit of an experiment
Page 56: Bdd: a bit of an experiment
Page 57: Bdd: a bit of an experiment
Page 58: Bdd: a bit of an experiment
Page 59: Bdd: a bit of an experiment

Experiment Portfolio

At least one oblique

At least one naïve

Conflicting experiments

Page 60: Bdd: a bit of an experiment

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

Liz Keogh http://lizkeogh.com @lunivore