A common perception of behavior-driven development (BDD) focuses on test automation with Cucumber-style “Given..When..Then” scenarios. But this is just the tip of the iceberg: in fact BDD ranges from requirements discovery and description through to driving technical design and implementation; helping testers focus their testing efforts more effectively; and even providing reliable, useful, and accurate technical documentation.
This session discusses what BDD is about, its benefits, and how it affects development teams and processes. You will see how JVM teams can effectively implement BDD with tools such as JBehave, Cucumber, Thucydides, and Spock. Come learn how much more there is to BDD than just “Given..When..Then.”
17. So what is this BDD thing?
BDD
Hunting out value
Collaboration
18. So what is this BDD thing?
BDD
Hunting out value
Collaboration
Building the right software
19. So what is this BDD thing?
Hunting out value Automated Acceptance
BDD
Criteria
Collaboration
Building the right software
20. So what is this BDD thing?
Hunting out value Automated Acceptance
BDD
Criteria
API and code design
Collaboration
Building the right software
21. So what is this BDD thing?
Building the right software
Hunting out value Automated Acceptance
BDD
Criteria
API and code design
Collaboration
Building the software right
22. So what is this BDD thing?
Building the right software
Hunting out value Automated Acceptance
BDD
Criteria
API and code design
Collaboration
Living Documentation
Building the software right
23. The business owner
tells the business
analyst what he wants
1
2 The business
analyst writes a
requirements
document
3 The developer
translates the
requirements
into software
4 The tester
translates the
requirements
into test cases 5 The technical
writer translates
the software
into functional
and technical
documentation
BDD in a nutshell
A traditional development process
24. The business owner
tells the business
analyst what he wants
1
2 The business
analyst writes a
requirements
document
3 The developer
translates the
requirements
into software
4 The tester
translates the
requirements
into test cases 5 The technical
writer translates
the software
into functional
and technical
documentation
BDD in a nutshell
A traditional development process
25. The business owner
tells the business
analyst what he wants
1
2 The business
analyst writes a
requirements
document
3 The developer
translates the
requirements
into software
4 The tester
translates the
requirements
into test cases 5 The technical
writer translates
the software
into functional
and technical
documentation
BDD in a nutshell
A traditional development process
26. The business owner
tells the business
analyst what he wants
1
2 The business
analyst writes a
requirements
document
3 The developer
translates the
requirements
into software
4 The tester
translates the
requirements
into test cases 5 The technical
writer translates
the software
into functional
and technical
documentation
BDD in a nutshell
A traditional development process
27. The business owner
tells the business
analyst what he wants
1
2 The business
analyst writes a
requirements
document
3 The developer
translates the
requirements
into software
4 The tester
translates the
requirements
into test cases 5 The technical
writer translates
the software
into functional
and technical
documentation
BDD in a nutshell
A traditional development process
28. The business owner
tells the business
analyst what he wants
1
2 The business
analyst writes a
requirements
document
3 The developer
translates the
requirements
into software
4 The tester
translates the
requirements
into test cases 5 The technical
writer translates
the software
into functional
and technical
documentation
BDD in a nutshell
A traditional development process
29. The business owner
tells the business
analyst what he wants
1
2 The business
analyst writes a
requirements
document
3 The developer
translates the
requirements
into software
4 The tester
translates the
requirements
into test cases 5 The technical
writer translates
the software
into functional
and technical
documentation
BDD in a nutshell
A traditional development process
30. The business owner
tells the business
analyst what he wants
1
2 The business
analyst writes a
requirements
document
3 The developer
translates the
requirements
into software
4 The tester
translates the
requirements
into test cases 5 The technical
writer translates
the software
into functional
and technical
documentation
BDD in a nutshell
A traditional development process
31. The business owner
tells the business
analyst what he wants
1
2 The business
analyst writes a
requirements
document
3 The developer
translates the
requirements
into software
4 The tester
translates the
requirements
into test cases 5 The technical
writer translates
the software
into functional
and technical
documentation
BDD in a nutshell
A traditional development process
32. The business owner
tells the business
analyst what he wants
1
2 The business
analyst writes a
requirements
document
3 The developer
translates the
requirements
into software
4 The tester
translates the
requirements
into test cases 5 The technical
writer translates
the software
into functional
and technical
documentation
BDD in a nutshell
A traditional development process
33. The business owner
tells the business
analyst what he wants
1
2 The business
analyst writes a
requirements
document
3 The developer
translates the
requirements
into software
4 The tester
translates the
requirements
into test cases 5 The technical
writer translates
the software
into functional
and technical
documentation
BDD in a nutshell
A traditional development process
34. The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
BDD in a nutshell
The business analyst,
the developer and the
tester elaborate the
requirements together.
4 The tester uses
these scenarios
as the basis for
her tests
5
The automated tests provide
feedback on progress and help
document the application
The scenarios guide the
developer and act as
automated tests
They define
requirements as
structured, English-language
format
"scenarios"
A BDD development process
35. The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
BDD in a nutshell
The business analyst,
the developer and the
tester elaborate the
requirements together.
4 The tester uses
these scenarios
as the basis for
her tests
5
The automated tests provide
feedback on progress and help
document the application
The scenarios guide the
developer and act as
automated tests
They define
requirements as
structured, English-language
format
"scenarios"
A BDD development process
36. The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
BDD in a nutshell
The business analyst,
the developer and the
tester elaborate the
requirements together.
4 The tester uses
these scenarios
as the basis for
her tests
5
The automated tests provide
feedback on progress and help
document the application
The scenarios guide the
developer and act as
automated tests
They define
requirements as
structured, English-language
format
"scenarios"
A BDD development process
37. The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
BDD in a nutshell
The business analyst,
the developer and the
tester elaborate the
requirements together.
4 The tester uses
these scenarios
as the basis for
her tests
5
The automated tests provide
feedback on progress and help
document the application
The scenarios guide the
developer and act as
automated tests
They define
requirements as
structured, English-language
format
"scenarios"
A BDD development process
38. The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
BDD in a nutshell
The business analyst,
the developer and the
tester elaborate the
requirements together.
4 The tester uses
these scenarios
as the basis for
her tests
5
The automated tests provide
feedback on progress and help
document the application
The scenarios guide the
developer and act as
automated tests
They define
requirements as
structured, English-language
format
"scenarios"
A BDD development process
39. The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
BDD in a nutshell
The business analyst,
the developer and the
tester elaborate the
requirements together.
4 The tester uses
these scenarios
as the basis for
her tests
5
The automated tests provide
feedback on progress and help
document the application
The scenarios guide the
developer and act as
automated tests
They define
requirements as
structured, English-language
format
"scenarios"
A BDD development process
40. The business owner
and the business
analyst have a
conversation about
what he needs.
1
2
3
BDD in a nutshell
The business analyst,
the developer and the
tester elaborate the
requirements together.
4 The tester uses
these scenarios
as the basis for
her tests
5
The automated tests provide
feedback on progress and help
document the application
The scenarios guide the
developer and act as
automated tests
They define
requirements as
structured, English-language
format
"scenarios"
•Specifica)ons
are
elaborated
collabora)vely
•Specifica)ons
use
a
common
language
•Executable
specifica)ons
provide
fast
feedback
42. A typical BDD workflow
Frequent Flyer Application
Goal: Encourage travellers to fly with Flying High airlines more often by allowing
them to cumulate Frequent Flyer points that they can spend on cheaper flights.
Goals
43. A typical BDD workflow
Frequent Flyer Application
Goal: Encourage travellers to fly with Flying High airlines more often by allowing
them to cumulate Frequent Flyer points that they can spend on cheaper flights.
Goals
Earning points
from flights
Capabili9es
Earning points
from spending
with partners
Viewing points
earned
Spending
points on
bookings
44. A typical BDD workflow
Frequent Flyer Application
Goal: Encourage travellers to fly with Flying High airlines more often by allowing
them to cumulate Frequent Flyer points that they can spend on cheaper flights.
Goals
Earning points
from flights
Capabili9es
Earning points
from spending
with partners
Viewing points
earned
Spending
points on
bookings
Viewing current points balance Features
View points needed to
achieve the next status level
Calculating points needed
for a given destination
46. A typical BDD workflow
Calculating points needed for a given destination
As a traveller
I want to know how many points I need to go to a given destination
So that I can plan my next trip with Flying High Airlines
Feature
47. A typical BDD workflow
Calculating points needed for a given destination
As a traveller
I want to know how many points I need to go to a given destination
So that I can plan my next trip with Flying High Airlines
Feature
Acceptance Criteria
-Need 2 points per km
-Members can calculate points needed on their account home page
Acceptance
Criteria
48. A typical BDD workflow
Calculating points needed for a given destination
As a traveller
I want to know how many points I need to go to a given destination
So that I can plan my next trip with Flying High Airlines
Feature
Acceptance Criteria
-Need 2 points per km
-Members can calculate points needed on their account home page
Acceptance
Criteria
49. A typical BDD workflow
Calculating points needed for a given destination
As a traveller
I want to know how many points I need to go to a given destination
So that I can plan my next trip with Flying High Airlines
Feature
Acceptance Criteria
-Need 2 points per km
-Members can calculate points needed on their account home page
Acceptance
Criteria
Automated
Acceptance
Criteria
74. Collaboration before Automation
“Having
the
conversa/on
is
more
important
than
recording
the
conversa/on
is
more
important
than
automa/ng
the
conversa/on”
-‐
Liz
Keogh
78. High-level BDD
Reporting for non-developers
as well as developers
Communicate about features
that business owners will
understand and find
meaningful
…
79. High-level BDD
Reporting for non-developers
as well as developers
Communicate about features
that business owners will
understand and find
meaningful
Higher automation and
maintenance costs
…
97. A
high-‐level
BDD
tool
should
Produce
business-‐readable
results
Fit
smoothly
into
your
build
pipeline
Integrate
with
your
development
infrastructure
Allow
developers
to
collaborate
with
testers
to
implement
and
refactor
the
automa9on
code
110. Low-level BDD
Technical documentation for
other developers
Implementation details that
business owners may not be
interested in spock
RSpec
111. Low-level BDD
Technical documentation for
other developers
Implementation details that
business owners may not be
interested in spock
RSpec
112. Low-level BDD
Technical documentation for
other developers
Implementation details that
business owners may not be
interested in
Faster to write and easier to
maintain
spock
RSpec
136. A
low-‐level
BDD
tool
should
Be
highly
readable
Be
developer-‐friendly
Make
it
easy
to
think
in
terms
of
specifica9ons,
not
tests
Encourage
fast
feedback
cycles
You
may
need
several!