Slide 1

Slide 1 text

Behavior Driven Development How it can open your eyes 1

Slide 2

Slide 2 text

Brilliant Fantastic | | [email protected] @jwright 2

Slide 3

Slide 3 text

3

Slide 4

Slide 4 text

Disclaimer It works on my machine 4

Slide 5

Slide 5 text

Jeez Not another *DD Process 5

Slide 6

Slide 6 text

How do you verify what you are building is the thing that the customer wants? 6

Slide 7

Slide 7 text

56% of all bugs can be traced to errors made during the requirements stage -- Tom DeMarco 7

Slide 8

Slide 8 text

Minimizing The Feedback Loop 8

Slide 9

Slide 9 text

Get Requirements Analyze Design Code Test 9

Slide 10

Slide 10 text

Code Test Test Driven Development “Test Eventually” / “Test While” Design 10

Slide 11

Slide 11 text

It’s not about testing It’s about design 11

Slide 12

Slide 12 text

Inspection to find defects is a waste -- Shingeo Shingo 12

Slide 13

Slide 13 text

Inspection to prevent defects is essential -- Shingeo Shingo 13

Slide 14

Slide 14 text

Code Test Test Driven Development “Test First” Design 14

Slide 15

Slide 15 text

Red > Green > Refactor 15

Slide 16

Slide 16 text

Design is a process not a phase 16

Slide 17

Slide 17 text

Design Code Test Behavior Driven Development Analyze 17

Slide 18

Slide 18 text

Extends TDD 18

Slide 19

Slide 19 text

Common Language between developers & customers 19

Slide 20

Slide 20 text

Gives You a starting point 20

Slide 21

Slide 21 text

Gherkin The Common Language 21

Slide 22

Slide 22 text

Feature: In order to As a I want to Feature name / identifier Value proposition Role / Actor Feature description Feature: Add an item to my cart In order to purchase an item As an online shopper I want to place something in my cart to show intent that I plan on purchasing it 22

Slide 23

Slide 23 text

Scenario: Given When Then Acceptance criteria Setup (arrange) User action / change occurs (act) Outcome (assert) Scenario: A user without an account can add items to their cart Given I do not have an account And a product exists with name: “Ton-Ton Sleeping bag” When I browse to the product’s detail page And I click “Add to Cart” Then I should be on the cart page And I should have an item in my cart with name: “Ton-Ton Sleeping bag” 23

Slide 24

Slide 24 text

Outside-in Development 24

Slide 25

Slide 25 text

Write Scenarios 25

Slide 26

Slide 26 text

Steps are pending 26

Slide 27

Slide 27 text

Write steps definitions 27

Slide 28

Slide 28 text

Go down to RSpec 28

Slide 29

Slide 29 text

Write code example 29

Slide 30

Slide 30 text

Make example pass 30

Slide 31

Slide 31 text

Go back up to Cucumber 31

Slide 32

Slide 32 text

Make steps pass 32

Slide 33

Slide 33 text

Refactor! 33

Slide 34

Slide 34 text

Mindsets Not Toolsets 34

Slide 35

Slide 35 text

Tools are just tools....using them doesn’t automatically mean you’re doing BDD -- The RSpec Book 35

Slide 36

Slide 36 text

Tools for Ruby 36

Slide 37

Slide 37 text

RSpec https://github.com/dchelimsky/rspec 37

Slide 38

Slide 38 text

Cucumber https://github.com/cucumber/cucumber 38

Slide 39

Slide 39 text

Friends https://github.com/ianwhite/pickle https://github.com/jnicklas/capybara I got nothing... 39

Slide 40

Slide 40 text

Tools for .NET 40

Slide 41

Slide 41 text

SpecFlow http://www.specflow.org/ 41

Slide 42

Slide 42 text

Example use case 42

Slide 43

Slide 43 text

43

Slide 44

Slide 44 text

Backgrounds provided by http://simpledesktops.com 44

Slide 45

Slide 45 text

A Must Read The RSpec Book: BDD with RSpec, Cucumber, & Friends 45

Slide 46

Slide 46 text

Brilliant Fantastic | | [email protected] @jwright 46