SlideShare a Scribd company logo
magentys_logo_2014.jpg
BDD Master Class
WHAT
 Behavioural Driven Development (BDD) is a design process in software
engineering where you focus on the behaviour of a feature/application. So
instead of writing tests you should think of specifying behaviour.
 BDD is Test Driven Development done with a specific mindset; testing the
intent of the system rather than testing a particular piece of code. The
difference is subtle but the effects are large.
 BDD means examples (or scenarios) are written *before* the implementation
of the software and happens iteratively, in collaboration with non-technical
stakeholders
 Automated acceptance tests are a by-product of BDD
Traditional
Requirements
Analysis
Design
Code
Test
If Testing shows the
requirement has not
been met then the time
has been lost
Feedback loop takes
time as code is
deployed and devs
wait for test results
Only when code is
written is it identified
that it can’t meet the
design
BDD (Behavioural Driven Development)
Requirements
Analysis
Design
Code
Test
Feedback loop is
continuous and
happens throughout
each cycle
Deliver incremental
changes into
production quicker for
faster results
Team collaboration
up front removes
Chinese whispers
Collaborate
WHY
Lets use the “5 Whys” technique to help understand why we use BDD
Q1. Why would we use BDD?
A1. To get a better quality product
Q2. Why?
A2. Because we (often) get it wrong
Q3. Why?
A3. Because there are misunderstandings, ambiguities or errors in what has been specified
and/or what we eventually get in the form of the product
Q4. Why?
A4. Because the traditional methods for specifying behaviour are not always effective in
capturing
Q5. Why?
A5. Because they fail to use concrete examples and a ubiquitous language
THE PROBLEMS WITH BDD
 It is NOT a silver bullet, but is often perceived as one
 In reality, it is about design and has nothing to do with test automation, but is often
thought of as a test only activity, which means it will FAIL. It is a TEAM activity and
requires a high performing, collaborative and technical one, to be a success.
 It does not negate the need for testing. In fact, it means exploratory testing is
essential, as we should aim to capture 80% of scenarios before we develop. We
are agile and accept that things change and aim to document system behaviour not
tests.
 There can be a disconnect between the features and scenarios captured and what
they become upon implementation. This is a technical problem which can be
solved with good business process and there will be technology that can solve this
 Only one of these problems (the last one) is a REAL problem with BDD. The
rest are team based problems which can be easily solved.
COMMON BDD MISTAKES
 The most common mistake is tying the scenarios (or acceptance criteria) too closely to the
implementation. This is the difference between using Declarative and Imperative language.
An Imperative example:
Given I am on the log in page
When I enter user name “Hamish” and password “pa55w0rd”
And I click the log in button
Then I will be logged in
Why is this example bad?
1. It has made a number of assumptions (more likely) or prescriptions (even worse) about what the
system should appear like, when really the intent or behaviour is to just validly log in
 It assumes or prescribes a log in page
 It assumes or prescribes a user name and a password field is required
 It assumes or prescribes a button to log in is required
 This dictates to technical teams how the feature should be implemented and will probably
mean that when it is built the feature, step definition and page object code will all need to
be refactored
COMMON BDD MISTAKES
A Declarative example:
Given I have logged in to the demo application with valid credentials
Then I should see the demo application welcome message
Why is this example better?
1. It specifies the intent or behaviour without tying it to the implementation
 This means that technical teams can implement this however they choose, as long as they ‘log in’ and
see a welcome message -> SO TEAMS ARE FREE TO USE THEIR CREATIVITY -> TEAMS ARE
HAPPIER
 It means if the implementation changes less refactoring is required. The feature files and step definitions
are unlikely to change, however, the page object may change. For example, if we go from a user name
and password required, to windows authentication with no user name and password, then this scenario
is still valid, however, the previous one is not
1. It is smaller, more succinct and uses more eloquent language
COMMON BDD MISTAKES
 The second most common problem (I see) is writing ambiguous scenarios or ones which use
inconsistent grammar
 A real life example:
When I edit additional details like Authorised
And I can update the corporate client record
Then I can find the corporate client record when I search
Why is this example bad?
1. The "When" steps use "I can", which imply that the user can do something rather than does do
something. A "When" should be an action not an intention, which is either granular, or at a higher
level.
2. The "Then” steps use "I am" or "I can". This often leads to questioning of the result or
ambiguities. Using "should" means a contractual obligation and tends to lead to less
questioning. It marks the sentence, or expected result, as a requirement, which of course, in
agile, can of course be negotiated, but it is a starting point for discussion.

More Related Content

PPT
Introduction to Test Driven Development
PPTX
Improving Estimates
PDF
Getting Started With QA Automation
PPT
Thoughtful Software Design
PDF
Agile Testing 20021015
PDF
Achieve Intelligent Test Execution: Strategies for Streamlining Regression Te...
PDF
Inrotduction of Testing
PPT
VodQA3_ATDD_KetanSoni
Introduction to Test Driven Development
Improving Estimates
Getting Started With QA Automation
Thoughtful Software Design
Agile Testing 20021015
Achieve Intelligent Test Execution: Strategies for Streamlining Regression Te...
Inrotduction of Testing
VodQA3_ATDD_KetanSoni

What's hot (20)

PPTX
Life of a Tester v1
PDF
Getting Started With Testing
PDF
The WHY behind TDD/BDD and the HOW with RSpec
PDF
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
PDF
Vesterli worst adf_project_ever_wildcard_2013
PPT
Test driven-development
PDF
Agile Testing Framework - The Art of Automated Testing
PPTX
Writing Test Cases From User Stories And Acceptance Criteria
PPTX
Best pratice
PPTX
Making the Unstable Stable - An Intro To Testing
PPSX
Modeling Requirements Narrated2
PPTX
Modeling Requirements with SysML
PDF
Fighting with Waste Driven Development - XP Days Ukraine 2017
PDF
Put to the Test
PDF
Approaching ATDD/BDD
PDF
Jason Olson - Test What You've Built
PPTX
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
PDF
Automation testing in Agile project
PPTX
TDD That Was Easy!
PPTX
Test Automation Pyramid
Life of a Tester v1
Getting Started With Testing
The WHY behind TDD/BDD and the HOW with RSpec
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
Vesterli worst adf_project_ever_wildcard_2013
Test driven-development
Agile Testing Framework - The Art of Automated Testing
Writing Test Cases From User Stories And Acceptance Criteria
Best pratice
Making the Unstable Stable - An Intro To Testing
Modeling Requirements Narrated2
Modeling Requirements with SysML
Fighting with Waste Driven Development - XP Days Ukraine 2017
Put to the Test
Approaching ATDD/BDD
Jason Olson - Test What You've Built
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
Automation testing in Agile project
TDD That Was Easy!
Test Automation Pyramid
Ad

Similar to Bdd masterclass (20)

PPTX
Myths and Challenges of Behaviour Driven Development
PDF
Expo qa from user stories to automated acceptance tests with bdd
PPTX
BEHAVIOR-DRIVEN-DEVELOPMENT.pptx
PPTX
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
PDF
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
PDF
Webinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
PPTX
BDD Short Introduction
PPTX
Behavior Driven Development
PPTX
Topic tdd-and-bdd b4usolution
PPTX
A Quick overview of Behaviour Driven Development (BDD)
PDF
BDD in Action – principles, practices and real-world application
PPTX
Agile software requirements management with Impact Mapping and BDD
PPTX
Introduction to BDD
PPTX
When to embrace Behavior Driven Development?
PPTX
Tdd and bdd
PDF
Introduction to TDD and BDD
PPT
PPTX
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
PPTX
Behaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UX
PDF
Whole team approach to agile testing bdd can help better pune 15th meetup
Myths and Challenges of Behaviour Driven Development
Expo qa from user stories to automated acceptance tests with bdd
BEHAVIOR-DRIVEN-DEVELOPMENT.pptx
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
Webinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
BDD Short Introduction
Behavior Driven Development
Topic tdd-and-bdd b4usolution
A Quick overview of Behaviour Driven Development (BDD)
BDD in Action – principles, practices and real-world application
Agile software requirements management with Impact Mapping and BDD
Introduction to BDD
When to embrace Behavior Driven Development?
Tdd and bdd
Introduction to TDD and BDD
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
Behaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UX
Whole team approach to agile testing bdd can help better pune 15th meetup
Ad

More from MagenTys (15)

PDF
Can you work agile in a waterfall organisation? Wagile
PPTX
Agile for CIOs
PPTX
2 speed IT and how to get there
PPTX
BDD - Collaboration & Hands-on practices
PDF
Product Vs Craft
PPTX
Culture Before Tools or Does Tooling Foster Culture?
PPTX
Zero to tested
PPTX
How Retail Store Design Enhances Customer Experience
PDF
The Blurring Line Between Online and Offline Commerce Experiences
PPTX
Ed Oughton 2015 digital communications for a digital economy
PPTX
Cambridge meetup
PDF
Transforming Legacy In To The New World Of DevOps and PaaS
PPTX
John Muir presentation
PPTX
Alex Sbardella presentation
PPTX
Craig Smith presentation
Can you work agile in a waterfall organisation? Wagile
Agile for CIOs
2 speed IT and how to get there
BDD - Collaboration & Hands-on practices
Product Vs Craft
Culture Before Tools or Does Tooling Foster Culture?
Zero to tested
How Retail Store Design Enhances Customer Experience
The Blurring Line Between Online and Offline Commerce Experiences
Ed Oughton 2015 digital communications for a digital economy
Cambridge meetup
Transforming Legacy In To The New World Of DevOps and PaaS
John Muir presentation
Alex Sbardella presentation
Craig Smith presentation

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
KodekX | Application Modernization Development
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Cloud computing and distributed systems.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Big Data Technologies - Introduction.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Encapsulation_ Review paper, used for researhc scholars
KodekX | Application Modernization Development
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectral efficient network and resource selection model in 5G networks
Dropbox Q2 2025 Financial Results & Investor Presentation
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Understanding_Digital_Forensics_Presentation.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Bdd masterclass

  • 2. WHAT  Behavioural Driven Development (BDD) is a design process in software engineering where you focus on the behaviour of a feature/application. So instead of writing tests you should think of specifying behaviour.  BDD is Test Driven Development done with a specific mindset; testing the intent of the system rather than testing a particular piece of code. The difference is subtle but the effects are large.  BDD means examples (or scenarios) are written *before* the implementation of the software and happens iteratively, in collaboration with non-technical stakeholders  Automated acceptance tests are a by-product of BDD
  • 3. Traditional Requirements Analysis Design Code Test If Testing shows the requirement has not been met then the time has been lost Feedback loop takes time as code is deployed and devs wait for test results Only when code is written is it identified that it can’t meet the design
  • 4. BDD (Behavioural Driven Development) Requirements Analysis Design Code Test Feedback loop is continuous and happens throughout each cycle Deliver incremental changes into production quicker for faster results Team collaboration up front removes Chinese whispers Collaborate
  • 5. WHY Lets use the “5 Whys” technique to help understand why we use BDD Q1. Why would we use BDD? A1. To get a better quality product Q2. Why? A2. Because we (often) get it wrong Q3. Why? A3. Because there are misunderstandings, ambiguities or errors in what has been specified and/or what we eventually get in the form of the product Q4. Why? A4. Because the traditional methods for specifying behaviour are not always effective in capturing Q5. Why? A5. Because they fail to use concrete examples and a ubiquitous language
  • 6. THE PROBLEMS WITH BDD  It is NOT a silver bullet, but is often perceived as one  In reality, it is about design and has nothing to do with test automation, but is often thought of as a test only activity, which means it will FAIL. It is a TEAM activity and requires a high performing, collaborative and technical one, to be a success.  It does not negate the need for testing. In fact, it means exploratory testing is essential, as we should aim to capture 80% of scenarios before we develop. We are agile and accept that things change and aim to document system behaviour not tests.  There can be a disconnect between the features and scenarios captured and what they become upon implementation. This is a technical problem which can be solved with good business process and there will be technology that can solve this  Only one of these problems (the last one) is a REAL problem with BDD. The rest are team based problems which can be easily solved.
  • 7. COMMON BDD MISTAKES  The most common mistake is tying the scenarios (or acceptance criteria) too closely to the implementation. This is the difference between using Declarative and Imperative language. An Imperative example: Given I am on the log in page When I enter user name “Hamish” and password “pa55w0rd” And I click the log in button Then I will be logged in Why is this example bad? 1. It has made a number of assumptions (more likely) or prescriptions (even worse) about what the system should appear like, when really the intent or behaviour is to just validly log in  It assumes or prescribes a log in page  It assumes or prescribes a user name and a password field is required  It assumes or prescribes a button to log in is required  This dictates to technical teams how the feature should be implemented and will probably mean that when it is built the feature, step definition and page object code will all need to be refactored
  • 8. COMMON BDD MISTAKES A Declarative example: Given I have logged in to the demo application with valid credentials Then I should see the demo application welcome message Why is this example better? 1. It specifies the intent or behaviour without tying it to the implementation  This means that technical teams can implement this however they choose, as long as they ‘log in’ and see a welcome message -> SO TEAMS ARE FREE TO USE THEIR CREATIVITY -> TEAMS ARE HAPPIER  It means if the implementation changes less refactoring is required. The feature files and step definitions are unlikely to change, however, the page object may change. For example, if we go from a user name and password required, to windows authentication with no user name and password, then this scenario is still valid, however, the previous one is not 1. It is smaller, more succinct and uses more eloquent language
  • 9. COMMON BDD MISTAKES  The second most common problem (I see) is writing ambiguous scenarios or ones which use inconsistent grammar  A real life example: When I edit additional details like Authorised And I can update the corporate client record Then I can find the corporate client record when I search Why is this example bad? 1. The "When" steps use "I can", which imply that the user can do something rather than does do something. A "When" should be an action not an intention, which is either granular, or at a higher level. 2. The "Then” steps use "I am" or "I can". This often leads to questioning of the result or ambiguities. Using "should" means a contractual obligation and tends to lead to less questioning. It marks the sentence, or expected result, as a requirement, which of course, in agile, can of course be negotiated, but it is a starting point for discussion.

Editor's Notes

  • #4: Feedback loop is too long have to code and deploy prior to finding results