Stories? Scenarios? BDD? Are these just more words in the ever-growing list of jargon that developers have to know? Or are they something more important than new terms to memorise?
In this session we'll look at how BDD fits into the software development work-flow, how to tell user stories through features, and how to automate them in Behat.
These techniques will help to ensure you're writing well designed and tested software that focuses on what the users want from a system.
11. @TheMattBrunt
BDD IS A SECOND-GENERATION, OUTSIDE-IN, PULL-
BASED, MULTIPLE-STAKEHOLDER, MULTIPLE-
SCALE, HIGH-AUTOMATION, AGILE METHODOLOGY.
DAN NORTH
http://dannorth.net/whats-in-a-story/
51. @TheMattBrunt
Given I have a “Large T-Shirt” product that costs £9.99
And I have an empty basket
And I am a tax-exempt customer
When I add a “Large T-Shirt” to my basket
Then I should have a “Large T-Shirt” in my basket
And the basket total should be £9.99
But I should not have tax applied to my order
53. @TheMattBrunt
Feature: As a customer
I want to be able to add products to my basket
So that I can have a gift for my partner
Scenario: I can add a product to the basket
Given I have a "Large T-Shirt" product
When I add a “Large T-Shirt” to my basket
Then I should have a “Large T-Shirt” in my basket
FEATURE
54. @TheMattBrunt
SCENARIO
Feature: As a customer
I want to be able to add products to my basket
So that I can have a gift for my partner
Scenario: I can add a product to the basket
Given I have a "Large T-Shirt" product
When I add a “Large T-Shirt” to my basket
Then I should have a “Large T-Shirt” in my basket
55. @TheMattBrunt
STEP
Feature: As a customer
I want to be able to add products to my basket
So that I can have a gift for my partner
Scenario: I can add a product to the basket
Given I have a "Large T-Shirt" product
When I add a “Large T-Shirt” to my basket
Then I should have a “Large T-Shirt” in my basket
82. @TheMattBrunt
Scenario: I can add a product to my basket
Given I am on the “/product/1” page
When I press “Add to basket”
Then I should see “Playstation 4”
And I should see £250
BAD STORY
83. @TheMattBrunt
Scenario: I can add a single product to my basket
Given I have a “Playstation 4” that costs £250
When I add the “Playstation 4” to my basket
Then I should have 1 product in my basket
And the basket total should be £250
BETTER STORY
84. @TheMattBrunt
Scenario: I can add a product to my basket
Given I am on the “/product/1” page
When I press “Add to basket”
Then I should see “Playstation 4”
And I should see £250
WHAT HAPPENS WHEN THE UI CHANGES TO SAY “ADD TO CART”?
88. @TheMattBrunt
STORIES TOLD BY REAL WORLD EXAMPLES.
USER STORIES AS REQUIREMENTS.
INVOLVE MULTIPLE STAKEHOLDERS.
WRITE FEATURES BEFORE CODE.
WRITE FEATURES WITHOUT IMPLEMENTATION.