Behavior Driven
Development
Naveen Kumar Singh
Professional Scrum Trainer (PST)
naveenhome@gmail.com
Professional Scrum Trainer (PST) at Scrum.Org
 Works as consultant agile coach and facilitator in software development field
 Facilitate Scrum.Org and Scrum Alliance Training workshop
 20 years working experience in product as well as service companies
including Xerox, Convergys, Cognizant and many more
 Have been teaching and coaching multiple organizations on agile and
engineering practices including Hays, Danfoss, KMG Infotech, Stryker,
Robert Bosch, NCR Corporation and many more
Strength – Demonstrable knowledge about Scrum, Kanban and Large-
Scale Scrum (LeSS, Nexus, Spotify) with Technical practices such TDD,
BDD, CI/CD, DevOps
Weakness – Don’t go by book and don’t like prescriptive frameworks
Don’t blame waterfall. We haven’t practiced it 
New way is Agile way. But is this working for
you?
Specification
Coding
Test cases
Testing
Deploy
Rework
So what to do?
Max 2 suggestions
per team 5
Mins
What Will cover here?
Goal Impact
Deliverables User Activities Features
User Stories Acceptance Criteria
Examples
Source Code
Scrum is nice but how to start delivering value?
What’s needed to start Scrum?
• Problem Statement – Traffic jam in Dubai
during pick hours
• You as stakeholder - What you can do?
• Simple solution - Are you Okay with Car
Pooling?
• What stopping you?
GOAL
• Let’s develop Car Pool Application
Registration Share Ride Book Ride Payment Review
Can we start development?
• Too big to develop and requirement is not yet
clear?
• So what Next? Refinement
Registration Share Ride Book Ride Payment Review
Product Backlog Refinement
• When we refine? Couple of time before 1st
sprint and then continuous.
• Who do that? Product Owner and
Development Team
• What we do? Understand, Split, Estimate and
Order
• How to spilt? Is INVEST enough?
Some Splitting Technique
• Split based on WORKFLOW
Registration Signup Verification Login
Login
Manage
Profile
Logout
Some Splitting Technique
• Split based on OPERATION
Share Ride
Publish New
Ride
View and
Confirm
Modify Ride
Search all
My ride
Delete Ride View Only
Some Splitting Technique
• Split based on RULES
Signup No Rules Only 18+
Only IT
People
Only
Colombo
People
Some Splitting Technique
• Split based on DATA TYPE
Payment
Return
Favor
Credit Card Cash Card
Account
Transfer
Food
Coupon
Try splitting 2 per group
Signup Verification
Manage
Profile
Publish New
Ride
Book Ride Review Credit Card Search Ride
10
Mins
SO CAN WE START SPRINT?
• We need acceptance criteria.
• Not more than 3-4 criteria for a story.
Acceptance Criteria
• Feature: Quick Post
• As a car owner I want to post my ride with
minimum requirement so that anyone can
register for it.
Acceptance Criteria – Why?
Define
boundaries
Provide values
to feature
Shared
understanding
Help in derive
tests
Help in
knowing
when to stop
Acceptance Criteria
• Source:______________ Destination:________________
• Time:________________ #Seat available:_____________
• Name:_______________ Email:______________________
• Phone:_______________
Cancel Submit
Share Your Ride
Acceptance Criteria
• Feature: Quick Post
• As a car owner I want to post my ride with
minimum requirement so that anyone can
register for it.
Data must be searchable to book ride
Ensure only valid data getting saved even as guest user
Cancel should clear data so user can add new ride
Successful submission will redirect user on home page
Discussion of Acceptance Criteria
If(user==“new”
{
object = user
}
Else
error
We should encourage
employee to update
rides
Login -> Click on
“New” and enter test
data and then Result
&%$^&
Collaboration of 3 amigos
Technical
Feasibility
Happy Path
Exceptions, Test
Data, Boundary
Conditions
Developer Business Tester
Building right or right product?
Business Failure
Useless Stuff
Business Success
Technical Debts
Specification By
Example
Build it Right
Build the Right Things
What are Specifications by Example
 Thin Slices of System Behavior
 That Deliver Business Value
 Described as concrete examples
 That are potentially automatable
 To create executable specifications
 Captured in live documentation
Specifications By Collaboration
What are Specifications by Example
Given_________________
When_________________
Then__________________
Gherkin
Given “Naveen” enter source “Office” and destination “Airport”
and time “5.30pm” with 2 seats available
And he provides his mail id “naveenhome@gmail.com” and
phone number “9810547500”
When Click on “Submit”
Then Display message “Ride Share” with “OK” button
And take “Naveen” to “home” page on click on “OK”
And his ride should be shown on top
Acceptance Criteria
• Feature: Quick Post
Successful submission will redirect user on home page
Given “Naveen” enter source “Office” and destination “Airport”
and time “5.30pm” with 2 seats available
And he provides his mail id “naveenhome@gmail.com” and
phone number “9810547500”
When Click on “Submit”
Then Display message “Ride Share” with “OK” button
And take “Naveen” to “home” page on click on “OK”
And his ride should be shown on top
Gherkin
 Feature – Name of feature
 Scenario – Behavior to be developed
 Given – Pre-conditions
 When – Actions to be performed
 Then – Expected Result
 And – Use for multiple Given, When & Then
 But – Describe exception cases
 Scenario Outline – Define multiple scenarios
 Examples – Multiple Scenarios
 Background – Avoid repeated Given
Can We start Sprint Now?
 Why not? We have testable specification so let’s start
 Let’s make a rule for team to have examples for every
specification
 If examples not available then specification will not get picked up
for sprint
 Convert examples in test is our first activity
 Write enough code to pass those tests
Test First
Test
Code
Test Again
Refactor
Pass
Fail
Fail
Behavior Driven Development
BDD
Given Scenario
Then Expected
Outcome
When Perform
Action
Let’s get started
 Write Feature to describe scenario in Gherkin
 Eclipse, Java, Cucumber, Selenium, Junit
 Create Test Runner class file
 Generate Steps file
 Write code to pass test
BDD - Characteristics
 A testable story (it should be the smallest unit that fits in an
iteration)
 The title should describe an activity
 The narrative should include a role, a feature, and a benefit
 The scenario title should say what's different
 The scenario should be described in terms of Givens, Events, and
Outcomes
 The givens should define all of, and no more than, the required
context
 The event should describe the feature
BDD - Lifecycle
3
5
Your Project Features Scenarios Steps
Your System
Automation
Library
Support Code
Step
Definitions
Technology
Facing
Business
Facing
Professional Scrum Foundation (PSF)
Professional Scrum Developer (PSD)
Professional Scrum Master (PSM)
professional Scrum product Owner (PSPO)
Scaled Professional Scrum (SPS)
Test Driven Development (TDD) Practitioner
Behavior Driven Development (BDD) Practitioner
Professional Agile Tester
Professional DevOps Consultant
Professional Lean Kanban Consultant
Extreme Programming (XP) Practitioner
GOLD SPONSORS
BRONZE SPONSOR SUPPORTER
MEDIA PARTNERS
SPONSORS & PARTNERS

Workshop: Behavior Driven Development - Deliver value by Naveen Kumar Singh

  • 1.
    Behavior Driven Development Naveen KumarSingh Professional Scrum Trainer (PST) naveenhome@gmail.com
  • 2.
    Professional Scrum Trainer(PST) at Scrum.Org  Works as consultant agile coach and facilitator in software development field  Facilitate Scrum.Org and Scrum Alliance Training workshop  20 years working experience in product as well as service companies including Xerox, Convergys, Cognizant and many more  Have been teaching and coaching multiple organizations on agile and engineering practices including Hays, Danfoss, KMG Infotech, Stryker, Robert Bosch, NCR Corporation and many more Strength – Demonstrable knowledge about Scrum, Kanban and Large- Scale Scrum (LeSS, Nexus, Spotify) with Technical practices such TDD, BDD, CI/CD, DevOps Weakness – Don’t go by book and don’t like prescriptive frameworks
  • 3.
    Don’t blame waterfall.We haven’t practiced it 
  • 4.
    New way isAgile way. But is this working for you? Specification Coding Test cases Testing Deploy Rework
  • 5.
    So what todo? Max 2 suggestions per team 5 Mins
  • 6.
    What Will coverhere? Goal Impact Deliverables User Activities Features User Stories Acceptance Criteria Examples Source Code
  • 7.
    Scrum is nicebut how to start delivering value?
  • 8.
    What’s needed tostart Scrum? • Problem Statement – Traffic jam in Dubai during pick hours • You as stakeholder - What you can do? • Simple solution - Are you Okay with Car Pooling? • What stopping you?
  • 9.
    GOAL • Let’s developCar Pool Application Registration Share Ride Book Ride Payment Review
  • 10.
    Can we startdevelopment? • Too big to develop and requirement is not yet clear? • So what Next? Refinement Registration Share Ride Book Ride Payment Review
  • 11.
    Product Backlog Refinement •When we refine? Couple of time before 1st sprint and then continuous. • Who do that? Product Owner and Development Team • What we do? Understand, Split, Estimate and Order • How to spilt? Is INVEST enough?
  • 12.
    Some Splitting Technique •Split based on WORKFLOW Registration Signup Verification Login Login Manage Profile Logout
  • 13.
    Some Splitting Technique •Split based on OPERATION Share Ride Publish New Ride View and Confirm Modify Ride Search all My ride Delete Ride View Only
  • 14.
    Some Splitting Technique •Split based on RULES Signup No Rules Only 18+ Only IT People Only Colombo People
  • 15.
    Some Splitting Technique •Split based on DATA TYPE Payment Return Favor Credit Card Cash Card Account Transfer Food Coupon
  • 16.
    Try splitting 2per group Signup Verification Manage Profile Publish New Ride Book Ride Review Credit Card Search Ride 10 Mins
  • 17.
    SO CAN WESTART SPRINT? • We need acceptance criteria. • Not more than 3-4 criteria for a story.
  • 18.
    Acceptance Criteria • Feature:Quick Post • As a car owner I want to post my ride with minimum requirement so that anyone can register for it.
  • 19.
    Acceptance Criteria –Why? Define boundaries Provide values to feature Shared understanding Help in derive tests Help in knowing when to stop
  • 20.
    Acceptance Criteria • Source:______________Destination:________________ • Time:________________ #Seat available:_____________ • Name:_______________ Email:______________________ • Phone:_______________ Cancel Submit Share Your Ride
  • 21.
    Acceptance Criteria • Feature:Quick Post • As a car owner I want to post my ride with minimum requirement so that anyone can register for it. Data must be searchable to book ride Ensure only valid data getting saved even as guest user Cancel should clear data so user can add new ride Successful submission will redirect user on home page
  • 22.
    Discussion of AcceptanceCriteria If(user==“new” { object = user } Else error We should encourage employee to update rides Login -> Click on “New” and enter test data and then Result &%$^&
  • 23.
    Collaboration of 3amigos Technical Feasibility Happy Path Exceptions, Test Data, Boundary Conditions Developer Business Tester
  • 24.
    Building right orright product? Business Failure Useless Stuff Business Success Technical Debts Specification By Example Build it Right Build the Right Things
  • 25.
    What are Specificationsby Example  Thin Slices of System Behavior  That Deliver Business Value  Described as concrete examples  That are potentially automatable  To create executable specifications  Captured in live documentation
  • 26.
  • 27.
    What are Specificationsby Example Given_________________ When_________________ Then__________________ Gherkin Given “Naveen” enter source “Office” and destination “Airport” and time “5.30pm” with 2 seats available And he provides his mail id “naveenhome@gmail.com” and phone number “9810547500” When Click on “Submit” Then Display message “Ride Share” with “OK” button And take “Naveen” to “home” page on click on “OK” And his ride should be shown on top
  • 28.
    Acceptance Criteria • Feature:Quick Post Successful submission will redirect user on home page Given “Naveen” enter source “Office” and destination “Airport” and time “5.30pm” with 2 seats available And he provides his mail id “naveenhome@gmail.com” and phone number “9810547500” When Click on “Submit” Then Display message “Ride Share” with “OK” button And take “Naveen” to “home” page on click on “OK” And his ride should be shown on top
  • 29.
    Gherkin  Feature –Name of feature  Scenario – Behavior to be developed  Given – Pre-conditions  When – Actions to be performed  Then – Expected Result  And – Use for multiple Given, When & Then  But – Describe exception cases  Scenario Outline – Define multiple scenarios  Examples – Multiple Scenarios  Background – Avoid repeated Given
  • 30.
    Can We startSprint Now?  Why not? We have testable specification so let’s start  Let’s make a rule for team to have examples for every specification  If examples not available then specification will not get picked up for sprint  Convert examples in test is our first activity  Write enough code to pass those tests
  • 31.
  • 32.
    Behavior Driven Development BDD GivenScenario Then Expected Outcome When Perform Action
  • 33.
    Let’s get started Write Feature to describe scenario in Gherkin  Eclipse, Java, Cucumber, Selenium, Junit  Create Test Runner class file  Generate Steps file  Write code to pass test
  • 34.
    BDD - Characteristics A testable story (it should be the smallest unit that fits in an iteration)  The title should describe an activity  The narrative should include a role, a feature, and a benefit  The scenario title should say what's different  The scenario should be described in terms of Givens, Events, and Outcomes  The givens should define all of, and no more than, the required context  The event should describe the feature
  • 35.
    BDD - Lifecycle 3 5 YourProject Features Scenarios Steps Your System Automation Library Support Code Step Definitions Technology Facing Business Facing
  • 36.
    Professional Scrum Foundation(PSF) Professional Scrum Developer (PSD) Professional Scrum Master (PSM) professional Scrum product Owner (PSPO) Scaled Professional Scrum (SPS)
  • 37.
    Test Driven Development(TDD) Practitioner Behavior Driven Development (BDD) Practitioner Professional Agile Tester Professional DevOps Consultant Professional Lean Kanban Consultant Extreme Programming (XP) Practitioner
  • 38.
    GOLD SPONSORS BRONZE SPONSORSUPPORTER MEDIA PARTNERS SPONSORS & PARTNERS