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.
9. @Brunty
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/
48. @Brunty
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 have a “Large T-Shirt” in my basket
And the basket total should be £9.99
But I do not have tax applied to my order
50. @Brunty
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 have a “Large T-Shirt” in my basket
FEATURE
51. @Brunty
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 have a “Large T-Shirt” in my basket
52. @Brunty
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 have a “Large T-Shirt” in my basket
54. @Brunty
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 will see “Playstation 4”
And I will see £250
55. @Brunty
Scenario: I can add aproduct to my basket
Given I have a “Playstation 4” that costs £250
When I add the “Playstation 4” to my basket
Then I will have 1 product in my basket
And the basket total will be £250
BETTER STORY
56. @Brunty
WHAT HAPPENS WHEN THE UI CHANGES TO SAY “ADD TO CART”?
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 will see “Playstation 4”
And I will see £250
76. @Brunty
STORIES TOLD BY REAL WORLD EXAMPLES.
USER STORIES AS REQUIREMENTS.
INVOLVE MULTIPLE STAKEHOLDERS.
WRITE FEATURES BEFORE CODE.
WRITE FEATURES WITHOUT IMPLEMENTATION.
77. @Brunty
BEGINNING:
HAVE A CONVERSATION, CAPTURE THAT CONVERSATION
MIDDLE:
AUTOMATE AND IMPLEMENT THAT CONVERSATION
END:
HAPPY STAKEHOLDERS AND WELL BUILT SOFTWARE