Behaviour Driven Development (BDD) is an approach than encourages teams and stakeholders in general to reason about requirements in terms of “executable specifications”, and focus on implementing features with demonstrable business value. BDD is more than just a development technique: in fact, it introduces a whole new dynamic to interactions between team members and stakeholders, a dynamic that increases communication, improves productivity and reduces waste. Through ongoing conversations between business stakeholders and team members, a team applying BDD principles will explore the business goals, capabilities and behaviour that the stakeholders need. They then propose features that the system will need to deliver these capabilities, and use concrete examples and counter-examples to explore and understand these features more fully. In this talk, you will learn about the principles and benefits of BDD for the whole team, how BDD works in practice, and how it affects the various team members in a project. Finally, you will discover the relationship between behavior driven development and automated acceptance testing.
9. Building the
right thing
Features aligned
to business needs
Right product,
built right
Wasted effort
Doesn't
do wha
the use t
r wants
What
e
Project lat
Hard to
change
Over bu
sive to
dget
aintain
le
Unstab
Expen
Misaligned
m
requirements
Building the
thing right
How
Poor craftsmanship Quality
Bugs craftsmanship
21. I
want
to
sell
train
5cket
bookings
online OK.
How
will
that
benefit
you?
22. Travellers
won’t
have
to
waste
8me
queuing
at
the
sta8on
any
more
So
you
might
say:
Yes
In
order
to
save
,me
by
avoiding
the
queue
at
the
sta,on
As
a
traveller
I
want
to
book
my
,cket
online
23. So
why
do
we
care?
People
hate
queueing.
More
Aha!
So
it’s
about
selling
people
will
buy
train
8ckets
if
they
don't
more
8ckets!
have
to
queue.
Yes
24. So
we
could
say
this:
In
order
to
increase
,cket
sales
I
guess
so
As
a
rail
service
I
want
travellers
to
be
able
to
save
,me
by
booking
online
25. Can
you
give
me
an
example
of
how
someone
might
book
a
train
8cket
online?
Sure.
A
traveller
buys
a
8cket
online
from
Dubbo
to
Sydney.
Which
would
cost?
$25
So
we
could
say:
Given
Jane
wants
to
take
a
train
from
Dubbo
to
Sydney
When
she
books
a
,cket
online
Then
she
should
be
charged
$25
26. Hmm.
So
every
traveller
pays
the
same
price?
Of
course
not!
A
pensionner
would
only
pay
$20,
for
example.
Ok.
So
let’s
add
that
example
too:
Given
Joe
wants
to
take
a
train
from
Dubbo
to
Sydney
And
Joe
has
a
pension
card
When
he
books
a
,cket
online
Then
he
should
be
charged
$20
And
he
should
be
issued
with
a
valid
,cket
27. Can
you
give
me
any
other
examples
of
people
who
don’t
pay
$25
for
this
trip?
Yes,
we
give
students
a
30%
discount
Let’s
put
this
in
a
table
Trip base cost Concession type Expected Price
$25 Pensioner $20
$25 Military $20
$25 Student $17.50
$25 Under 12 $12.50
$25 Under 3 $0.00
29. I
want
to
sell
train
5cket
bookings
online
1) Identify a feature
30. I
want
to
sell
train
5cket
bookings
online
To
increase
5cket
sales
2) Understand why
31. I
want
to
sell
train
5cket
bookings
online
To
increase
5cket
sales
3) Find examples
Given
Jane
wants
to
take
a
train
from
Dubbo
to
Sydney
When
she
books
a
,cket
online
Then
she
should
be
charged
$25
32. I
want
to
sell
train
5cket
bookings
online
To
increase
5cket
sales
4) Challenge assumptions
Given
Jane
wants
to
take
a
train
from
Dubbo
to
Sydney
When
she
books
a
,cket
online
Then
she
should
be
charged
$25
Given
Joe
wants
to
take
a
train
from
Dubbo
to
Sydney
And
Joe
has
a
pension
card
When
he
books
a
,cket
online
Then
he
should
be
charged
$20
And
he
should
be
issued
with
a
valid
,cket
33. I
want
to
sell
train
5cket
bookings
online
To
increase
5cket
sales
5) Extend our model
Given
Jane
wants
to
take
a
train
from
Dubbo
to
Sydney
When
she
books
a
,cket
online
Trip base cost Concession type should
Expected Price
Then
she
be
charged
$25
$25 Pensioner $20
Given
Joe
wants
to
take
a
train
from
Dubbo
to
Sydney
$25 Military $20
And
Joe
has
a
pension
card
$25
Studente
books
a
,cket
online
When
h $17.50
$25
Underh12 hould
be
charged
$20
Then
e
s $12.50
And
he
should
be
issued
with
a
valid
,cket
$25 Under 3 $0.00
35. Now
we
can
automate
the
acceptance
criteria
Trip base cost Concession type Expected Price
$25 Pensioner $20
$25 Military $20
$25 Student $17.50
$25 Under 12 $12.50
$25 Under 3 $0.00
Acceptance criteria
36. Now
we
can
automate
the
acceptance
criteria
Trip base cost Concession type Expected Price
$25 Pensioner $20
$25 Military $20
$25 Student $17.50
$25 Under 12 $12.50
$25 Under 3 $0.00
Automated acceptance criteria
37. Now
we
can
automate
the
acceptance
criteria
Trip base cost Concession type Expected Price
$25 Pensioner $20
$25 Military $20
$25 Student $17.50
$25 Under 12 $12.50
$25 Under 3 $0.00
Living Documentation
41. High Level BDD
What features should we build?
Automated acceptance criteria
Written for the whole team
Spock
Low Level BDD
How do we build them?
Low level specification and design
Written for developers
58. What do you want to achieve?
Vision What will the business get out of it?
Goals What do users and stakeholders
need to deliver these goals?
Capabilities How can our application
help the users to do this?
We can break a Features
feature up into stories
Stories
Concrete examples are
easier to understand
Scenarios
Are we
there yet? Acceptance Criteria
Code
59. A business goal should
1) Increase Revenue
2) Reduce Costs
3) Protect Revenue
4) Avoid future costs
60. But who knows what the real goals are?
Chances
of
knowing
Senior
Management
Product
Owners
Scrum
Masters
Business
Analysts
Testers
Developers
Role
in
the
organiza8on
61. Every story will provide value to
the business
What makes you so sure?
62. Can you map each story back to a
business goal?
63. Requirements analysis is built on assumptions
Goal
ti on
To
increase
8cket
sale
su mp
revenue As
ti on
u mp
ss
Capability
Sell
8ckets
online A
“Selling tickets
online will increase
sales” Feature
Pay
by
any
credit
card
“More credit card
support will
increase online
sales”
64. How can you validate your assumptions?
Goal
ti on
To
increase
8cket
sale
su mp
revenue As
ti on
Text
u mp
ss
Capability
Sell
8ckets
online A
“Selling tickets
online will increase
sales” Feature
Pay
by
any
credit
card
“More credit card
support will
increase online
sales”
...by measuring the outcomes
65. Impact Mapping
a visual approach to identifying assumptions
Why Who How What
concessions
online booking
To increase travellers take the train
credit card
ticket sale more often
payment
revenue
suggest taking social network
the train to integration
friends
66. 1)
Iden.fy
your
assump.ons
2)
Measure
the
outcomes
3)
Verify
your
assump.ons
67. BDD and team
dynamics
Collaboration like you mean it
68. How do you build
a feature?
Story
WASTE
bug
reports
Working
code
boring
manual
tes5ng
69. How do you build
a feature?
Story
Examples
Automated
acceptance
Shared
criteria
understanding
Working
code
and
Working
Automated
Acceptance
Tests
Exploratory
tes5ng,
usability
tes5ng...