Outside In - Behaviour Driven Development (BDD)
Upcoming SlideShare
Loading in...5
×
 

Outside In - Behaviour Driven Development (BDD)

on

  • 3,388 views

The BDD Workshop offers a comprehensive, hands-on introduction to behavior driven development via an interactive-demo. ...

The BDD Workshop offers a comprehensive, hands-on introduction to behavior driven development via an interactive-demo.

Over the past decade, eXtreme Programming practices like Test-Driven Development (TDD) and Behaviour Driven Development (BDD) have fundamentally changed software development processes and inherently how engineers work. Practitioners claim that it has helped them significantly improve their collaboration with business, development speed, design & code quality and responsiveness to changing requirements. Software professionals across the board, from Internet startups to medical device companies to space research organizations, today have embraced these practices.

This workshop explores the foundations of TDD & BDD with the help of various patterns, strategies, tools and techniques.

Statistics

Views

Total Views
3,388
Views on SlideShare
2,220
Embed Views
1,168

Actions

Likes
7
Downloads
90
Comments
0

16 Embeds 1,168

http://blogs.agilefaqs.com 1074
http://feeds.feedburner.com 20
http://nareshjain.com 19
http://localhost 15
http://agilefaqs.com 13
http://www.thoughtworks.com 5
http://www.linkedin.com 5
http://nashjain.github.io 4
http://newsblur.com 3
http://translate.googleusercontent.com 2
https://www.linkedin.com 2
http://www.newsblur.com 2
http://10.0.1.4 1
http://presentationstack.com 1
http://webcache.googleusercontent.com 1
http://dev.newsblur.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Outside In - Behaviour Driven Development (BDD) Outside In - Behaviour Driven Development (BDD) Presentation Transcript

  • Behavior Driven Development Naresh Jain naresh@agilefaqs.com @nashjain http://nareshjain.com Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Warmup ScenariosPick one scenario and in relation to your scenario,what are the specific observable results that will tellyou that the activity has been successfullycompleted?Going out for Movie (THX sound and Digital projection)Going out for meal (one veg.)Going shopping ($50) [5 Minutes]Present back to the group your findings. [3 minutes per group] Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Commercial Break!
  • Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Tech Talks!
  • Product  Discovery  -­‐  Overview PersonasElevator Business Pragmatic User Pitch Goals Personas Goals Chartering Scenarios Day in Life & of each Narratives Persona Story Mapping Activity Map Interaction UI Sketch Task Map Design Planning Grouping Reiterating Prioritization by Themes User Story Authoring Acceptance User Criteria Stories
  • Vision Elevator Business Pitch Goals Goal Chartering PersonasPragmatic UserPersonas Goals Capability Day in Life Scenarios & of each Narratives Persona Story Mapping Feature Activity Map UI Sketch Interaction Design Task Map Story Planning Grouping by Reiterating Scenario Prioritization Themes User Story Authoring Acceptance User Stories Criteria Code
  • User StoriesWhat are we really trying to build? Copyright © 2013, AgileFAQs. All Rights Reserved.
  • What is a Story?Story is a smallest piece of functionality that add business valueStories should follow Ron Jeffries’ 3 CsCard – Placeholder for conversationConversation – Actual discussion between dev team and userConfirmation – Acceptance criteria to determine when the story is finished Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Typical Story Format Story Title - Actor Action ContextIn order to... <user goal/business justification>As a .. <user who requires this feature>I need .. <do something> Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Story ExampleTitle: Keen Reader subscribes to a blogIn order to stay up-to-date with new postsAs a keen reader of your blogI need to subscribe to your blog Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Another Story ExampleTitle: Social Networking Enthusiast uploads profile pictureIn order for my friends to see how I look and recognize meAs a Social Networking EnthusiastI need to upload my profile picture Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Stories are fundamental unit of activityBusiness Goals Product Backlog Release Backlog Sprint Backlog Inception Release planning Iteration planning User Goals As a ____, I want to As a ____, I want to As a ____, I want to be able to ____ so be able to ____ so be able to ____ so that ____ that ____ that ____ Possible automation of the acceptance test I will know this is I will know this is done when _______ done when _______ Might have an initial estimate (perhaps for both analysis and development), Development team and an expression of breaks out the technical and business To do this I must: detail of work confidence that this is real More detailed estimate, and 1) _____ needed to pass test and achievable a specific acceptance test – 2) _____ low confidence stories might be “spiked” or prototyped Copyright © 2013, AgileFAQs. All Rights Reserved.
  • What makes a good Story?Stories should follow the INVEST principle:IndependentNegotiableValuableEstimateableSmallTestable Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Scenarios Acceptance CriteriaCopyright © 2013, AgileFAQs. All Rights Reserved.
  • ScenarioIs a set of conditions that the Story must meet for it to beaccepted as completeIs typically provided by the customer or product owner. Is not a replacement for conversation. Is the results of the conversation Scenarios are NOT tests Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Writing ScenariosScenario should contain: ACTOR VERB – DESCRIBING A BEHAVIOR OBSERVABLE RESULTTo accommodate pre-conditions scenarios can be expressed as Given [Precondition] When [Actor + Action] Then [Observable Result] Copyright © 2013, AgileFAQs. All Rights Reserved.
  • ExampleSocial Networking Enthusiast uploads profile picture Given the user has a valid facebook account and a digital picture on her computer, When she uploads a picture in facebook, Then her the picture should be visible to all her friends in her network. Given an user is trying to find a friend on facebook, When the user searches for a person using their name, Then their profile picture should be displayed along with other details. In order to keep facebooks reputation intact and stay out of legal hassles As owner of facebook, I need users to upload authentic, personal profile picture Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Cucumber Style BDDFeature: Login In order to access secure content As a registered user I need to authenticate myself Scenario: Login with valid credentials Given I am not logged in When I try to login with "test" and "secret" Then I should be logged in Scenario: Login with invalid credentials Given I am not logged in When I try to login with "test" and "wrongpassword" Then I should not be logged in And I should be shown error message "Invalid username or password" Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Step DefinitionGiven /^I am not logged in$/ do browser.navigate_to("http://your_url.com")endWhen /^I try to login with "([^"]*)" and "([^"]*)"$/ do |username, password| browser.textbox("user").value = username browser.password("password").value = password browser.submit("Login").clickendThen /^I should be logged in$/ do Then /^I should not be logged in$/ do if !browser.button("Logout").exists? if !browser.submit("Login").exists? raise "Not logged in" raise "Logged in" end endend endThen /^I should be shown error message "([^"]*)"$/ do |msg| value = browser.div("errorMessage").text if value != msg raise "Incorrect message: #{value}" endend Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Acceptance Criteria & Tests: Definition Acceptance Tests Acceptance Criteria+ Examples (data + scenarios) Acceptance Tests Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Scenarios =Executable Tests Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Tasks Team members further break down each story into tasks that need to be completed to meet the acceptance criteria for the story.To accomplish this story:we start off with a simple upload and image displayrestrict user to only upload certain image types (gif, jpg and png)figure out where to store the image. (performant and fault-tolerant)scale down (size, resolution, etc.) of the imageand so on... Copyright © 2013, AgileFAQs. All Rights Reserved.
  • DemoCopyright © 2013, AgileFAQs. All Rights Reserved.
  • BDDCopyright © 2013, AgileFAQs. All Rights Reserved.
  • Key Questions Business FacingAre we building the right product?Are we building the product right? Technology/Implementation Facing Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Brian Marick’s Test Categorization Business FacingSupports Programming Critique product Technology/Implementation Facing Copyright © 2013, AgileFAQs. All Rights Reserved.
  • It Helps to Think of Tests this way... Business Facing Acceptance Testing Exploratory TestingDrives Development Critique product Low-fi prototypes UI and Usability Testing Performance Testing Unit Testing System Tests Technology/Implementation Facing Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Inverting the Testing Pyramid Typical testing strategies lead to an inverted testing pyramid... Manual Checking End-to-End GUI Tests 80-90% Integration 5-15% Tests Unit Tests 1-5% Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Inverting the Testing Pyramid GUI 1% Tests Performance Tests End to End 4% Security Flow Tests Tests One Layer Below GUI Workflow Tests 6% Integration Test 9% Biz Logic Acceptance Tests 10% Unit Tests 70% This is the need of the hours... Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Test Driven Development Add a Test Pass Run the Test FailTDD Rhythm - Test, Code, Refactor Make a little change Fail Run the Test Pass Refactor Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Behavior Driven Development Iteration Automated Acceptance Tests P Scenario E R F O RStory Automated M Unit Test E T Automated UI N E C Tests S E T S Automated Acceptance Tests Exploratory Scenario Testing Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Benefits of BDD Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Why?Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Better Commitment and Buy-in Focus on Business Value Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Ubiquitous Domain Language Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Right focusCopyright © 2013, AgileFAQs. All Rights Reserved.
  • Evolutionary Design Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Breaking the Knowledge Silos in Distributed Team Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Greater ROICopyright © 2013, AgileFAQs. All Rights Reserved.
  • Predictability & Confidence Copyright © 2013, AgileFAQs. All Rights Reserved.
  • Thank you Naresh Jainnaresh@agilefaqs.com Copyright © 2013, AgileFAQs. All Rights Reserved.