Whole TEAM approach to Agile
Testing - BDD can help better
By Shraddha Gupta and Saket Deshpande
15th July 2017
Presented during ATA
Pune 15th Meetup
© 2016 Fiserv, Inc. or its affiliates.2
Speaker Profiles
Shraddha Gupta is working as Team Lead, Quality
Engineering for Electronic Payments unit. Her Business Unit
provide financial institutions and other companies with the
products and services required to process electronic payment
transactions.
She has 10 years of experience in IT, in BFSI domain
specifically working on Mainframe and Mobile Testing. She
has been working as lead role for past 1 year and is part of
Agile Delivery team working on Mobile Application testing.
Saket Deshpande is working as Senior Test Engineer in
Fiserv. Prior working with Fiserv he was associated with
Persistent Systems and GS LABS.
He is ISTQB & CP-AAT Certified Tester and has more than
4.5 years of experience in Software testing specifically in
Functional, Automation testing, Server side testing, Linux,
API testing etc.
© 2016 Fiserv, Inc. or its affiliates.3
Agenda Review
Whole TEAM approachA
Challenges faced by new AgilistsB
Introduction to BDDC
BDD – Specifications by ExampleE
F BDD Demo
D BDD Tools
Whole Team Approach
Importance Implementation
© 2016 Fiserv, Inc. or its affiliates.5
Conventional bonding between Developers and Tester
 Lack of Interaction – working in
Silos
 Lack of Customer Collaboration –
Delayed collaboration with customer
 Diversity in Viewpoint – Leads to
arguments over achieving goal.
© 2016 Fiserv, Inc. or its affiliates.6
Importance - Whole TEAM approach to achieve Agile Quality
✓ Meaningful commitment to Quality
✓ Shared vision of product
✓ Respecting the tests
Challenges faced by new Agilist
Challenges Solutions
© 2016 Fiserv, Inc. or its affiliates.8
Common Challenges faced by new Agilist
➢ COMMUNICATION :: “TO PRODUCE AND COMMUNICATE RELEVANT INFORMATION
PROMPTLY”
➢ COLLABORATION :: “TO MAKE TESTING, DEVELOPMENT AND BUSINESS COLLABORATE”
➢ HOW TO TEST EARLY BUT NOT DO ANTICIPATORY TEST DESIGN?
➢ FIT QA IN THE SAME ITERATION AS DEVELOPMENT?
➢ IN SPRINT AUTOMATION IN THIS PROJECT
➢ SHOULD I FOCUS ON MANUAL OR AUTOMATION
➢ FEAR TO LOSE IDENTITY
➢ CHANGING REQUIREMENTS /LAST MINUTE CHANGES
➢ NOT ENOUGH INFORMATION ON THE STORY
➢ CONTINUOUS TESTING
© 2016 Fiserv, Inc. or its affiliates.9
Solutions
Have heard about BDD.
Will it help to achieve
all this stuff.
What is BDD? Let me
explore
.
Introduction to BDD
Why BDD
Key
Features
BDD in
nutshell
BDD guided
Development
BDD’s
Evolution
© 2016 Fiserv, Inc. or its affiliates.11
Perception Vs Perspective
How some thing appears is always a matter of Perspective.
Everyone has a unique perspective and all are important
© 2016 Fiserv, Inc. or its affiliates.12
Why BDD?
Behaviour-Driven Development process that
encourages collaboration in a software project
between developers, QA, project managers,
and the business team.
Express a requirement as a Story
BDD story is written by the whole team and
used as both requirements and executable test
cases.
© 2016 Fiserv, Inc. or its affiliates.13
▪ BDD is second generation agile methodology.
▪ BDD is Outside-in(Test First approach), high-automation, agile methodology.
▪ Dan North created a BDD framework at the end of 2003.
✓ Where to start in the process
✓ What to test and what not to test
✓ How much to test in one go
✓ What to call the tests
✓ How to understand why a test fails
BDD focuses ….
Behaviour Driven Data Development’s Evolution
© 2016 Fiserv, Inc. or its affiliates.14
It’s often said that BDD is TDD ‘DONE RIGHT with a specific mind-set.
Principle of Behaviour Driven Data Development
BDD
Automate
Conversation
Have
Conversation
Capture
Conversation
BDD believes in……
 Working Together to find better solutions
 Use real world examples to build a shared
understanding of the domain
 People understand requirements best
using concrete examples.
 Examples clear up
ambiguity and misunderstandings.
 Examples expose missing requirements.
 Examples force everyone to think harder
about a problem.
© 2016 Fiserv, Inc. or its affiliates.15
Conversation Focused
Behaviour Driven Development in a nutshell…
Conversations matter because
software is made by people, for
people.
© 2016 Fiserv, Inc. or its affiliates.16
Conversation Focused
We call this “The Three Amigos”
Behaviour Driven Development in a nutshell…
© 2016 Fiserv, Inc. or its affiliates.17
Example Based
Behaviour Driven Development in a nutshell…
© 2016 Fiserv, Inc. or its affiliates.18
Key features of Behaviour Driven Development
Is it a Tool?
Is it about Testing?
Is it about Silo and
acceptance criteria?
✓ It’s about Communication and Behaviour
✓ It’s about Exploring the Unknown.
✓ It is about sharing and understanding.
✓ It is about telling STORIES through CODE
© 2016 Fiserv, Inc. or its affiliates.19
BDD guided Development
Vision
Goals
Capabilities
Features
Stories
Acceptance Criteria
Examples
Code
What do you want to
achieve?
What will the business get out of it?
What do users and stakeholders
need to deliver these goals?
you can break a feature
up into stories
How can your application
help the users to do this?
Concrete examples are
easier to understand
Acceptance criteria
help clarify features.
How BDD Works
Gherkin - Story and
Scenario
BDD Process
Cycle
BDD Language
© 2016 Fiserv, Inc. or its affiliates.21
BDD’s -Language
BDD uses Domain Specific Language called Gherkin.
Gherkin is a ubiquitous language for analysis, which is used to write Features,
Scenarios, and Steps. The purpose of Gherkin is to help us write concrete
requirements.
Feature files mean different things to different people:
• They are requirements for product owners.
• They are acceptance criteria for developers.
• They are test cases for testers.
• They are scripts for automators.
• They are descriptions for other stakeholders.
Thus, BDD fosters healthy collaboration because feature files are pertinent to all
stakeholders (or “amigos”). Features files are like receipts – they’re a “proof of purchase” for the
team. They document precisely what will be delivered.
© 2016 Fiserv, Inc. or its affiliates.22
BDD - Story and Scenarios
Story
As a <role/persona>
I want <activity>
So that <business value>
Scenarios
Given <context/precondition>
When <event/action>
Then <outcome/post
condition>
© 2016 Fiserv, Inc. or its affiliates.23
BDD Process Cycle with Gherkin
Watir
Selenium
Web Services
Web Application
These are the
features derived
from User Story
used by gherkin
© 2016 Fiserv, Inc. or its affiliates.24
BDD Process Cycle with TDD
“You can’t stay agile without clean code
You can’t have clean code without refactoring
You can’t refactor without good automated tests”
© 2016 Fiserv, Inc. or its affiliates.25
Fully Behaviour Driven Sprint
Write stories
with Gherkin
acceptance
criteria
Three Amigos
Grooming:
Refined Gherkin
Commit Stories
to Sprint
Before Sprint
Develop
Automate
Test Steps
Run all tests
During Sprint
BDD Tools
Cucumber jbehave Specflow JUnit, Nunit, RSpec
© 2016 Fiserv, Inc. or its affiliates.27
BDD Process Cycle with Tools
BDD Specification by Example
Cucumber jbehave Specflow JUnit, Nunit, RSpec
© 2016 Fiserv, Inc. or its affiliates.29
BDD Specification by Example
Update Super
Market Billing
system for GST
New Bills should be
generated with GST for
applicable goods with
correct rate
GST Applied to goods
that falls in GST
eligible category
GST should NOT be
applied as Fix tax for
all category
Single tax entry for GST.
No additional tax applied
Correct calculation
and application of
GST.
Why
[Business Goal]
Who
[Role]
What
[Features]
How
[Examples]
© 2016 Fiserv, Inc. or its affiliates.30
BDD Demo
© 2016 Fiserv, Inc. or its affiliates.31
10 reasons why BDD helps better
✓ Communication between business and development is extremely focused as a
result of common language.
✓ Business needs tie directly to the code that is written.
✓ Developers know what test cases they should write to accommodate TDD.
✓ All the underlying benefits of TDD become more easily realized.
✓ Code is easier to maintain.
✓ Code is self documenting.
✓ Stories are easier to “groom” – breakdown, task and plan.
✓ Teams can be more agile.
✓ Developers can be trained / on-boarded easier.
✓ There is more visibility into team progress and status.
© 2016 Fiserv, Inc. or its affiliates.32
References
• https://www.scrumalliance.org/community/articles/2015/june/a-confused-
tester-in-agile-world
• https://automationpanda.com/2017/02/01/bdd-101-bdd-and-agile/
• https://www.slideshare.net/kmstechnology/behavior-driven-development-and-
automation-testing-using-cucumber
• https://www.slideshare.net/aloyer/bdd-writing-better-scenario/40-
BuyingPropertiesFeature_Buying_propertiesAs_a_playerI
• http://www.agile-doctor.com/2012/03/06/10-reasons-why-bdd-changes-
everything/
• https://www.agilealliance.org/resources/sessions/behavior-driven-development-
bdd-value-through-collaboration/
© 2016 Fiserv, Inc. or its affiliates.33
Thank You…

Whole team approach to agile testing bdd can help better pune 15th meetup

  • 1.
    Whole TEAM approachto Agile Testing - BDD can help better By Shraddha Gupta and Saket Deshpande 15th July 2017 Presented during ATA Pune 15th Meetup
  • 2.
    © 2016 Fiserv,Inc. or its affiliates.2 Speaker Profiles Shraddha Gupta is working as Team Lead, Quality Engineering for Electronic Payments unit. Her Business Unit provide financial institutions and other companies with the products and services required to process electronic payment transactions. She has 10 years of experience in IT, in BFSI domain specifically working on Mainframe and Mobile Testing. She has been working as lead role for past 1 year and is part of Agile Delivery team working on Mobile Application testing. Saket Deshpande is working as Senior Test Engineer in Fiserv. Prior working with Fiserv he was associated with Persistent Systems and GS LABS. He is ISTQB & CP-AAT Certified Tester and has more than 4.5 years of experience in Software testing specifically in Functional, Automation testing, Server side testing, Linux, API testing etc.
  • 3.
    © 2016 Fiserv,Inc. or its affiliates.3 Agenda Review Whole TEAM approachA Challenges faced by new AgilistsB Introduction to BDDC BDD – Specifications by ExampleE F BDD Demo D BDD Tools
  • 4.
  • 5.
    © 2016 Fiserv,Inc. or its affiliates.5 Conventional bonding between Developers and Tester  Lack of Interaction – working in Silos  Lack of Customer Collaboration – Delayed collaboration with customer  Diversity in Viewpoint – Leads to arguments over achieving goal.
  • 6.
    © 2016 Fiserv,Inc. or its affiliates.6 Importance - Whole TEAM approach to achieve Agile Quality ✓ Meaningful commitment to Quality ✓ Shared vision of product ✓ Respecting the tests
  • 7.
    Challenges faced bynew Agilist Challenges Solutions
  • 8.
    © 2016 Fiserv,Inc. or its affiliates.8 Common Challenges faced by new Agilist ➢ COMMUNICATION :: “TO PRODUCE AND COMMUNICATE RELEVANT INFORMATION PROMPTLY” ➢ COLLABORATION :: “TO MAKE TESTING, DEVELOPMENT AND BUSINESS COLLABORATE” ➢ HOW TO TEST EARLY BUT NOT DO ANTICIPATORY TEST DESIGN? ➢ FIT QA IN THE SAME ITERATION AS DEVELOPMENT? ➢ IN SPRINT AUTOMATION IN THIS PROJECT ➢ SHOULD I FOCUS ON MANUAL OR AUTOMATION ➢ FEAR TO LOSE IDENTITY ➢ CHANGING REQUIREMENTS /LAST MINUTE CHANGES ➢ NOT ENOUGH INFORMATION ON THE STORY ➢ CONTINUOUS TESTING
  • 9.
    © 2016 Fiserv,Inc. or its affiliates.9 Solutions Have heard about BDD. Will it help to achieve all this stuff. What is BDD? Let me explore .
  • 10.
    Introduction to BDD WhyBDD Key Features BDD in nutshell BDD guided Development BDD’s Evolution
  • 11.
    © 2016 Fiserv,Inc. or its affiliates.11 Perception Vs Perspective How some thing appears is always a matter of Perspective. Everyone has a unique perspective and all are important
  • 12.
    © 2016 Fiserv,Inc. or its affiliates.12 Why BDD? Behaviour-Driven Development process that encourages collaboration in a software project between developers, QA, project managers, and the business team. Express a requirement as a Story BDD story is written by the whole team and used as both requirements and executable test cases.
  • 13.
    © 2016 Fiserv,Inc. or its affiliates.13 ▪ BDD is second generation agile methodology. ▪ BDD is Outside-in(Test First approach), high-automation, agile methodology. ▪ Dan North created a BDD framework at the end of 2003. ✓ Where to start in the process ✓ What to test and what not to test ✓ How much to test in one go ✓ What to call the tests ✓ How to understand why a test fails BDD focuses …. Behaviour Driven Data Development’s Evolution
  • 14.
    © 2016 Fiserv,Inc. or its affiliates.14 It’s often said that BDD is TDD ‘DONE RIGHT with a specific mind-set. Principle of Behaviour Driven Data Development BDD Automate Conversation Have Conversation Capture Conversation BDD believes in……  Working Together to find better solutions  Use real world examples to build a shared understanding of the domain  People understand requirements best using concrete examples.  Examples clear up ambiguity and misunderstandings.  Examples expose missing requirements.  Examples force everyone to think harder about a problem.
  • 15.
    © 2016 Fiserv,Inc. or its affiliates.15 Conversation Focused Behaviour Driven Development in a nutshell… Conversations matter because software is made by people, for people.
  • 16.
    © 2016 Fiserv,Inc. or its affiliates.16 Conversation Focused We call this “The Three Amigos” Behaviour Driven Development in a nutshell…
  • 17.
    © 2016 Fiserv,Inc. or its affiliates.17 Example Based Behaviour Driven Development in a nutshell…
  • 18.
    © 2016 Fiserv,Inc. or its affiliates.18 Key features of Behaviour Driven Development Is it a Tool? Is it about Testing? Is it about Silo and acceptance criteria? ✓ It’s about Communication and Behaviour ✓ It’s about Exploring the Unknown. ✓ It is about sharing and understanding. ✓ It is about telling STORIES through CODE
  • 19.
    © 2016 Fiserv,Inc. or its affiliates.19 BDD guided Development Vision Goals Capabilities Features Stories Acceptance Criteria Examples Code What do you want to achieve? What will the business get out of it? What do users and stakeholders need to deliver these goals? you can break a feature up into stories How can your application help the users to do this? Concrete examples are easier to understand Acceptance criteria help clarify features.
  • 20.
    How BDD Works Gherkin- Story and Scenario BDD Process Cycle BDD Language
  • 21.
    © 2016 Fiserv,Inc. or its affiliates.21 BDD’s -Language BDD uses Domain Specific Language called Gherkin. Gherkin is a ubiquitous language for analysis, which is used to write Features, Scenarios, and Steps. The purpose of Gherkin is to help us write concrete requirements. Feature files mean different things to different people: • They are requirements for product owners. • They are acceptance criteria for developers. • They are test cases for testers. • They are scripts for automators. • They are descriptions for other stakeholders. Thus, BDD fosters healthy collaboration because feature files are pertinent to all stakeholders (or “amigos”). Features files are like receipts – they’re a “proof of purchase” for the team. They document precisely what will be delivered.
  • 22.
    © 2016 Fiserv,Inc. or its affiliates.22 BDD - Story and Scenarios Story As a <role/persona> I want <activity> So that <business value> Scenarios Given <context/precondition> When <event/action> Then <outcome/post condition>
  • 23.
    © 2016 Fiserv,Inc. or its affiliates.23 BDD Process Cycle with Gherkin Watir Selenium Web Services Web Application These are the features derived from User Story used by gherkin
  • 24.
    © 2016 Fiserv,Inc. or its affiliates.24 BDD Process Cycle with TDD “You can’t stay agile without clean code You can’t have clean code without refactoring You can’t refactor without good automated tests”
  • 25.
    © 2016 Fiserv,Inc. or its affiliates.25 Fully Behaviour Driven Sprint Write stories with Gherkin acceptance criteria Three Amigos Grooming: Refined Gherkin Commit Stories to Sprint Before Sprint Develop Automate Test Steps Run all tests During Sprint
  • 26.
    BDD Tools Cucumber jbehaveSpecflow JUnit, Nunit, RSpec
  • 27.
    © 2016 Fiserv,Inc. or its affiliates.27 BDD Process Cycle with Tools
  • 28.
    BDD Specification byExample Cucumber jbehave Specflow JUnit, Nunit, RSpec
  • 29.
    © 2016 Fiserv,Inc. or its affiliates.29 BDD Specification by Example Update Super Market Billing system for GST New Bills should be generated with GST for applicable goods with correct rate GST Applied to goods that falls in GST eligible category GST should NOT be applied as Fix tax for all category Single tax entry for GST. No additional tax applied Correct calculation and application of GST. Why [Business Goal] Who [Role] What [Features] How [Examples]
  • 30.
    © 2016 Fiserv,Inc. or its affiliates.30 BDD Demo
  • 31.
    © 2016 Fiserv,Inc. or its affiliates.31 10 reasons why BDD helps better ✓ Communication between business and development is extremely focused as a result of common language. ✓ Business needs tie directly to the code that is written. ✓ Developers know what test cases they should write to accommodate TDD. ✓ All the underlying benefits of TDD become more easily realized. ✓ Code is easier to maintain. ✓ Code is self documenting. ✓ Stories are easier to “groom” – breakdown, task and plan. ✓ Teams can be more agile. ✓ Developers can be trained / on-boarded easier. ✓ There is more visibility into team progress and status.
  • 32.
    © 2016 Fiserv,Inc. or its affiliates.32 References • https://www.scrumalliance.org/community/articles/2015/june/a-confused- tester-in-agile-world • https://automationpanda.com/2017/02/01/bdd-101-bdd-and-agile/ • https://www.slideshare.net/kmstechnology/behavior-driven-development-and- automation-testing-using-cucumber • https://www.slideshare.net/aloyer/bdd-writing-better-scenario/40- BuyingPropertiesFeature_Buying_propertiesAs_a_playerI • http://www.agile-doctor.com/2012/03/06/10-reasons-why-bdd-changes- everything/ • https://www.agilealliance.org/resources/sessions/behavior-driven-development- bdd-value-through-collaboration/
  • 33.
    © 2016 Fiserv,Inc. or its affiliates.33 Thank You…