Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Behaviour-Driven Development: Feature this!

Avatar for Fred Heath Fred Heath
October 02, 2014

Behaviour-Driven Development: Feature this!

Talk given at ArrrrCamp 2014

Avatar for Fred Heath

Fred Heath

October 02, 2014

Other Decks in Technology

Transcript

  1. What this is about • Quick BDD Intro • How

    to get started: Actor discovery • Writing Features: do it right
  2. From Features to Code Code Features Step Definitions P R

    O D U C T O W N E R U S E R T E S T I N G D E V E L O P M E N T
  3. Why BDD? Everyone talks the same language Expectations are fully

    understood Living documentation Measurable progress Considerable bug reduction
  4. Actors “An Actor is an external entity that has a

    vested interest or stake in the system and the power to safe-guard this interest by dictating system behaviour.”
  5. Feature Discovery As a [Specialised Actor] I want [specific System

    Behavior] So that I can [have a tangible benefit] Feature: Conference talk viewer As a Delegate I want to see a summary of all the talks So that I can see if I like any
  6. Feature Discovery As an [Specialised Actor] I want [some System

    Behavior] So that I can [have a tangible benefit] Feature: View conference talks As a Delegate I want to see a summary of all the talks So that I can see if I like any decide whether to attend the conference
  7. Feature Discovery Feature: Menu item highlighting Scenario Outline: Menu shows

    current page Given I go to <any_page> Then the side menu should highlight the page I'm currently on Examples: | any_page | | Home | | About | | Products |
  8. Feature Discovery Feature: Navigation Link consistency As the Design Director

    I want to the site to be navigated in the same way as the other company sites So that the company can maintain a consistent corporate image Scenario Outline: Menu shows current page …....
  9. Feature scenarios Feature: ticket booking As an Attendee I want

    to book a ticket So that I can attend the conference
  10. Feature scenarios Scenario: Successful booking Given I am on the

    "Book a ticket" screen When I enter "[email protected]" in "email" field And I enter "Joe" in "first_name" field And I enter "Bloggs" in "last_name" field And I click the "Book Now" button Then the message "ticket is reserved" appears
  11. Ambiguous vocabulary Scenario: New card request Given my account is

    valid And the session hasn't expired Then I have the option to request a new card
  12. Ambiguous vocabulary Scenario: New card request Given my account is

    valid And the session hasn't expired Then I have the option to request a new card
  13. Summary • Quick BDD Intro • How to get started:

    Actor discovery • Writing Features: do it right
  14. Tips & Tricks 1. Everyone works together (no role barriers)

    2. Know your system and your Actors 3. Specialise your Actors 4. Every feature must tell a valid story 5. Features are about the 'what' not the 'how' 6. Use clear, unambiguous terms