Behaviour Driven Development is no longer the "new kid on the block", but it's still widely misunderstood. In this session we'll examine where it came from and what it's good for. We'll also dispel some myths that have grown up over the years.
3. @sebrose http://claysnow.co.uk
BDD is a second-generation, outside-in,
pull-based, multiple-stakeholder, multiple-
scale, high-automation, agile methodology.
It describes a cycle of interactions with
well-defined outputs, resulting in the
delivery of working, tested software that
matters.
Dan North
http://skillsmatter.com/podcast/java-jee/how-to-sell-bdd-to-the-business
Wednesday, 18 March 15
8. @sebrose http://claysnow.co.uk
At the end of 2003, I decided it was time to
put my money – or at least my time – where
my mouth was. I started writing a replacement
for JUnit called JBehave, which removed any
reference to testing and replaced it with a
vocabulary built around verifying behaviour.
Dan North
http://dannorth.net/introducing-bdd/
Wednesday, 18 March 15
20. @sebrose http://claysnow.co.uk
BDD is a second-generation, outside-in,
pull-based, multiple-stakeholder, multiple-
scale, high-automation, agile methodology.
It describes a cycle of interactions with
well-defined outputs, resulting in the
delivery of working, tested software that
matters.
Dan North
http://skillsmatter.com/podcast/java-jee/how-to-sell-bdd-to-the-business
Wednesday, 18 March 15
21. @sebrose http://claysnow.co.uk
having conversations
is more important than
capturing conversations
is more important than
automating conversations
Liz Keogh
http://lizkeogh.com/2014/01/22/using-bdd-with-legacy-systems/
Wednesday, 18 March 15
22. @sebrose http://claysnow.co.uk
http://lizkeogh.com/2011/03/04/step-away-from-the-tools/
Have enough conversations to know how to get
started. Find out where the riskiest bits are, and
where the system behaves unusually. Chat.
Discuss. Discover. Work out how, and when,
you’re going to get feedback on the work you’re
about to do.
Then, and only then, reach for the tools.
Liz Keogh
Wednesday, 18 March 15
27. "Behaviour-Driven Development (BDD)
builds upon Test-Driven Development
(TDD) by formalising the good habits of
the best TDD practitioners."
-- The Cucumber Book, 2011
Living documentation
Wednesday, 18 March 15
28. The best TDD
practitioners...
• Work from the outside-in, i.e. test-first
• Use examples to clarify their requirements
• Develop and use a ubiquitous language
Living documentation
Wednesday, 18 March 15
29. The best BDD
practitioners...
• Focus on value
• Discover examples collaboratively
• Create living documentation
Living documentation
Wednesday, 18 March 15
35. @sebrose http://claysnow.co.uk
“I get paid for code that works, not for tests, so my
philosophy is to test as little as possible to reach a
given level of confidence ...
“I suspect this level of confidence is high
compared to industry standards”
http://stackoverflow.com/questions/153234/how-deep-are-your-unit-tests/153565#153565
Wednesday, 18 March 15
39. @sebrose http://claysnow.co.uk
Feature: Sign up
Scenario: New user redirected to their own page
Given I am not logged in
And I visit the homepage
And I follow "Sign up"
And I fill in "Username" with "Matt"
And I fill in "Password" with "password"
And I fill in "Confirm password" with "password"
When I press "Sign up"
Then I should be on my feeds page
And I should see "Hello, Matt"
Wednesday, 18 March 15
40. @sebrose http://claysnow.co.uk
Feature: Sign up
Scenario: New user redirected to their own page
When I sign up for a new account
Then I should be taken to my feeds page
And I should see a greeting message
Wednesday, 18 March 15
41. @sebrose http://claysnow.co.uk
Imperative vs
Declarative Style
Feature: The entire system
This feature illustrates what can happen when you
take the declarative style too far.
Scenario: It works
When I use the system
Then it should work perfectly
Wednesday, 18 March 15
42. @sebrose http://claysnow.co.uk
Imperative vs Declarative
Style
Feature: Sign up
Scenario: New user redirected to their own page
Given I am not logged in
And I visit the homepage
And I follow "Sign up"
And I fill in "Username" with "Matt"
And I fill in "Password" with "password"
And I fill in "Confirm password" with "password"
And I press "Sign up"
Then I should be on my feeds page
And I should see "Hello, Matt"
Feature: Sign up
Scenario: New user redirected to their own page
When I sign up for a new account
Then I should be taken to my feeds page
And I should see a greeting message
Wednesday, 18 March 15
43. @sebrose http://claysnow.co.uk
(A great blog post on this subject by Dan North)
http://dannorth.net/2011/01/31/whose-domain-is-it-anyway/
Whose domain is it
anyway?
Wednesday, 18 March 15