SlideShare a Scribd company logo
BDD
Behaviour Driven Development
Why we should use it
Project restarts
One of the major causes of both cost and time
overruns is restarts.
For every 100 projects that start, there are 94
restarts. This does not mean that 94 of 100 will
have one restart, some projects can have
several restarts.
src: http://www.projectsmart.co.uk/docs/chaos-report.pdf
What is BDD?
Behavior Driven Development (BDD) is a
software engineering practice designed to help
teams build and deliver more valuable, higher
quality software faster.
It is not about programming, testing or
management.
It's about building together.
Building together
To do this, we need a way to
describe the requirement such
that everyone
● the business folks (customer)
● the product owner
● the development team
have a common understanding
of the scope of the work.
source: http://dannorth.net/whats-in-a-story/
Actionable
Common understanding
Business
value
Low
hanging
fruit
Product
requirements Delivery
Impact
analyses
Acceptance
criteria
JavaScript
Performance
tweakers.ne
t
Trafficker Advertisements Video Views
We all have our jargon….
Use case
It would be great if we could connect multiple advertisement
agents worldwide. Then visitors can see local advertisements.
Feature: Local advertisements for visitors
In order to see local advertisements,
As a Visitor I want the website to detect my country settings,
So that the right Advertising agent will serve my advertisements
Present the story to the dev team
The Visitor doesn't benefit from this feature, but the Advertising
traffickers. They will have full control over country based
advertisements. How about control on channels?
Feature: Country Based Advertisement Serving on portals
In order to be able to serve advertisements by different agents
As a Advertising trafficker
I want define the agent based on the country and channel
Making the boss happy
I love you guys. This will bring in even more $ money $.
While you're on it please add support for pages as well....
Feature: Country Based Advertisement Serving on portals
In order to be able to serve advertisements by different agents
As a Advertising trafficker
I want define the agent based on the country, channel and page
Writing the story
Feature: Country Based Advertisement Serving on portals
In order to be able to serve advertisements by different agents
As a Advertising trafficker
I want define the agent based on the country, portal and page
Refining the story
Feature: Country Based Advertisement Serving on portals
In order to be able to serve advertisements by different agents
As a Advertising trafficker
I want define the agent based on the country, portal and page
Scenario Outline: Visitors on certain channel pages
Given the visitor is from "<country>"
When the visitor is on the "<page>" page
And the visitor is on the "<channel>" channel
Then advertisements should be served by <agent>
Examples:
#######################################################
| country | page | channel | agent |
#######################################################
| default | default | default | Google |
| The Netherlands | home | default | Google |
| America | game | Family | AdTech |
| America | home | Teens | StarMedia |
| America | home | Girls | Google |
Behat + Mink + Selenium2 = YEAH!
Generated snippet
<?php
use BehatBehatTesterExceptionPendingException;
use BehatMinkExtensionContextMinkContext;
use BehatBehatContextSnippetAcceptingContext;
class WebContext extends MinkContext implements SnippetAcceptingContext
{
/**
* @Given the visitor is from :arg1
*/
public function theVisitorIsFrom($arg1)
{
throw new PendingException();
}
/**
* @When the visitor is on the :arg1 page
*/
public function theVisitorIsOnThePage($arg1)
{
throw new PendingException();
}
/**
* @When the visitor is on the :arg1 channel
*/
public function theVisitorIsOnTheChannel($arg1)
{
throw new PendingException();
}
/**
* @Then advertisements should be served by :provider
*/
public function advertisementsShouldBeServedBy($provider)
{
throw new PendingException();
}
}
Enter some logic
<?php
use BehatBehatTesterExceptionPendingException;
use BehatMinkExtensionContextMinkContext;
use BehatBehatContextSnippetAcceptingContext;
class WebContext extends MinkContext implements SnippetAcceptingContext
{
private $pages = array(
'default' => '/',
'home' => '/',
'game' => '/spel/donuts-saras-kookcursus'
);
private $channels = array(
'Teens' => 'http://www.agame.com',
'Girls' => 'http://www.girlsgogames.com',
'Family' => 'http://spel.nl'
);
/**
* @Given the visitor is from :country
*/
public function theVisitorIsFrom($country)
{
$this->getSession()->setCookie('country', $country);
}
/**
* @When the visitor is on the :page page
*/
public function theVisitorIsOnThePage($page)
{
$this->visitPath($this->pages[$page]);
}
/**
* @When the visitor is on the :arg1 channel
*/
public function theVisitorIsOnTheChannel($channel)
{
$this->setMinkParameter('base_url', $this->channels[$channel]);
}
/**
* @Then advertisements should be served by :provider
*/
public function advertisementsShouldBeServedBy($provider)
{
// provider check...
}
}
Run!
Run!
Run!
Tested 5 scenarios in 10 seconds.
Questions?

More Related Content

PDF
Perl Behavior Driven Development (BDD)
PDF
Behavior Driven Development with Cucumber
PPTX
So What Do Cucumbers Have To Do With Testing
PDF
BDD with JBehave
ODP
BDD with Behat
PDF
An Introduction to Behaviour Driven Development with Cucumber Java
PPTX
Behat - human-readable automated testing
PPTX
Cucumber BDD
Perl Behavior Driven Development (BDD)
Behavior Driven Development with Cucumber
So What Do Cucumbers Have To Do With Testing
BDD with JBehave
BDD with Behat
An Introduction to Behaviour Driven Development with Cucumber Java
Behat - human-readable automated testing
Cucumber BDD

What's hot (20)

PPTX
Behavior driven development - cucumber, Junit and java
PDF
BDD in PHP - Behat
PPT
Introduction to Behavior Driven Development
PPTX
Bdd – with cucumber and gherkin
PPT
Behavior Driven Development Pros and Cons
PPTX
BDD and Behave
PDF
The LAZY Developer's Guide to BDD (with Cucumber)
ODP
Behavior Driven GUI Testing
PDF
TDD with BDD in PHP and Symfony
PPTX
PHPConf.asia 2016 - BDD with Behat for Beginners
PPTX
BDD testing with cucumber
PPTX
Test Driven Development in CQ5/AEM
PDF
Behavior Driven Testing - A paradigm shift
PPTX
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
PDF
DevQA: make your testers happier with Groovy, Spock and Geb
PPTX
Cucumber From the Ground Up - Joseph Beale
PDF
BDD Testing Using Godog - Bangalore Golang Meetup # 32
PDF
[@IndeedEng] Managing Experiments and Behavior Dynamically with Proctor
PPTX
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
PPTX
vodQA(Pune) 2018 - Consumer driven contract testing using pact
Behavior driven development - cucumber, Junit and java
BDD in PHP - Behat
Introduction to Behavior Driven Development
Bdd – with cucumber and gherkin
Behavior Driven Development Pros and Cons
BDD and Behave
The LAZY Developer's Guide to BDD (with Cucumber)
Behavior Driven GUI Testing
TDD with BDD in PHP and Symfony
PHPConf.asia 2016 - BDD with Behat for Beginners
BDD testing with cucumber
Test Driven Development in CQ5/AEM
Behavior Driven Testing - A paradigm shift
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
DevQA: make your testers happier with Groovy, Spock and Geb
Cucumber From the Ground Up - Joseph Beale
BDD Testing Using Godog - Bangalore Golang Meetup # 32
[@IndeedEng] Managing Experiments and Behavior Dynamically with Proctor
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
vodQA(Pune) 2018 - Consumer driven contract testing using pact
Ad

Viewers also liked (17)

PPTX
BDD presentation
PDF
Behavior Driven Development and Automation Testing Using Cucumber
PPTX
Behavior Driven Development
PDF
Behavior Driven Development with Cucumber
PPT
Behavior Driven Development Pros and Cons
PPTX
Scrum + Behavior Driven Development (BDD) - Colombo
PDF
Introduction to TDD and BDD
PPTX
Behaviour Driven Development with SpecFlow
PPTX
Behavior driven development for Mobile apps
PPT
Behavior Driven Development by Example
PPTX
Quality Jam: BDD, TDD and ATDD for the Enterprise
PDF
The WHY behind TDD/BDD and the HOW with RSpec
PDF
Outside In - Behaviour Driven Development (BDD)
PPTX
functional testing
PDF
BDD in Action – principles, practices and real-world application
PPT
Behavior Driven Development (BDD) and Agile Testing
PDF
Behaviour-Driven Development, Ruby Style
BDD presentation
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development
Behavior Driven Development with Cucumber
Behavior Driven Development Pros and Cons
Scrum + Behavior Driven Development (BDD) - Colombo
Introduction to TDD and BDD
Behaviour Driven Development with SpecFlow
Behavior driven development for Mobile apps
Behavior Driven Development by Example
Quality Jam: BDD, TDD and ATDD for the Enterprise
The WHY behind TDD/BDD and the HOW with RSpec
Outside In - Behaviour Driven Development (BDD)
functional testing
BDD in Action – principles, practices and real-world application
Behavior Driven Development (BDD) and Agile Testing
Behaviour-Driven Development, Ruby Style
Ad

Similar to Behaviour Driven Development (20)

PDF
Moving away from legacy code with BDD
PDF
Enabling agile devliery through enabling BDD in PHP projects
PDF
Cucumber - use it to describe user stories and acceptance criterias
PDF
Taking the Hype out of Hypermedia
PDF
Drools5 Community Training Module 5 Drools BLIP Architectural Overview + Demos
PPTX
Benefits of Hypermedia API
PPTX
Designing for Holistic Cross Channel Experiences
PPTX
Behat - Beyond the Basics (2016 - SunshinePHP)
PDF
FBrink Mobile Advertisement
PDF
The Future of Omni-Channel Banking
PDF
Mobile marketerclassicguide3 beyondthebanner
PPTX
Creating Mobile Websites with Kentico CMS 7
PPTX
digital-transformation-re-defining-customer-experience
PDF
VISISEEK - Interactive Day San Diego - Intro to RTB - IDSD
PDF
Netmera_Presentation.pdf
PDF
Web fundamentals
PDF
Clicks Aren't Connections
PPTX
Double Loop
PPTX
Display & rich media planning
PDF
UX STRAT Europe 2017: David Ruiz, "Developing a Multi-Channel Banking Experie...
Moving away from legacy code with BDD
Enabling agile devliery through enabling BDD in PHP projects
Cucumber - use it to describe user stories and acceptance criterias
Taking the Hype out of Hypermedia
Drools5 Community Training Module 5 Drools BLIP Architectural Overview + Demos
Benefits of Hypermedia API
Designing for Holistic Cross Channel Experiences
Behat - Beyond the Basics (2016 - SunshinePHP)
FBrink Mobile Advertisement
The Future of Omni-Channel Banking
Mobile marketerclassicguide3 beyondthebanner
Creating Mobile Websites with Kentico CMS 7
digital-transformation-re-defining-customer-experience
VISISEEK - Interactive Day San Diego - Intro to RTB - IDSD
Netmera_Presentation.pdf
Web fundamentals
Clicks Aren't Connections
Double Loop
Display & rich media planning
UX STRAT Europe 2017: David Ruiz, "Developing a Multi-Channel Banking Experie...

Recently uploaded (20)

PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Introduction to Artificial Intelligence
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
Materi-Enum-and-Record-Data-Type (1).pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
L1 - Introduction to python Backend.pptx
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Materi_Pemrograman_Komputer-Looping.pptx
PTS Company Brochure 2025 (1).pdf.......
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Wondershare Filmora 15 Crack With Activation Key [2025
Upgrade and Innovation Strategies for SAP ERP Customers
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Introduction to Artificial Intelligence
Odoo POS Development Services by CandidRoot Solutions
Materi-Enum-and-Record-Data-Type (1).pptx
How to Migrate SBCGlobal Email to Yahoo Easily
Operating system designcfffgfgggggggvggggggggg
L1 - Introduction to python Backend.pptx
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Design an Analysis of Algorithms I-SECS-1021-03
VVF-Customer-Presentation2025-Ver1.9.pptx
Materi_Pemrograman_Komputer-Looping.pptx

Behaviour Driven Development

  • 2. Project restarts One of the major causes of both cost and time overruns is restarts. For every 100 projects that start, there are 94 restarts. This does not mean that 94 of 100 will have one restart, some projects can have several restarts. src: http://www.projectsmart.co.uk/docs/chaos-report.pdf
  • 3. What is BDD? Behavior Driven Development (BDD) is a software engineering practice designed to help teams build and deliver more valuable, higher quality software faster. It is not about programming, testing or management. It's about building together.
  • 4. Building together To do this, we need a way to describe the requirement such that everyone ● the business folks (customer) ● the product owner ● the development team have a common understanding of the scope of the work. source: http://dannorth.net/whats-in-a-story/
  • 6. Use case It would be great if we could connect multiple advertisement agents worldwide. Then visitors can see local advertisements. Feature: Local advertisements for visitors In order to see local advertisements, As a Visitor I want the website to detect my country settings, So that the right Advertising agent will serve my advertisements
  • 7. Present the story to the dev team The Visitor doesn't benefit from this feature, but the Advertising traffickers. They will have full control over country based advertisements. How about control on channels? Feature: Country Based Advertisement Serving on portals In order to be able to serve advertisements by different agents As a Advertising trafficker I want define the agent based on the country and channel
  • 8. Making the boss happy I love you guys. This will bring in even more $ money $. While you're on it please add support for pages as well.... Feature: Country Based Advertisement Serving on portals In order to be able to serve advertisements by different agents As a Advertising trafficker I want define the agent based on the country, channel and page
  • 9. Writing the story Feature: Country Based Advertisement Serving on portals In order to be able to serve advertisements by different agents As a Advertising trafficker I want define the agent based on the country, portal and page
  • 10. Refining the story Feature: Country Based Advertisement Serving on portals In order to be able to serve advertisements by different agents As a Advertising trafficker I want define the agent based on the country, portal and page Scenario Outline: Visitors on certain channel pages Given the visitor is from "<country>" When the visitor is on the "<page>" page And the visitor is on the "<channel>" channel Then advertisements should be served by <agent> Examples: ####################################################### | country | page | channel | agent | ####################################################### | default | default | default | Google | | The Netherlands | home | default | Google | | America | game | Family | AdTech | | America | home | Teens | StarMedia | | America | home | Girls | Google |
  • 11. Behat + Mink + Selenium2 = YEAH!
  • 12. Generated snippet <?php use BehatBehatTesterExceptionPendingException; use BehatMinkExtensionContextMinkContext; use BehatBehatContextSnippetAcceptingContext; class WebContext extends MinkContext implements SnippetAcceptingContext { /** * @Given the visitor is from :arg1 */ public function theVisitorIsFrom($arg1) { throw new PendingException(); } /** * @When the visitor is on the :arg1 page */ public function theVisitorIsOnThePage($arg1) { throw new PendingException(); } /** * @When the visitor is on the :arg1 channel */ public function theVisitorIsOnTheChannel($arg1) { throw new PendingException(); } /** * @Then advertisements should be served by :provider */ public function advertisementsShouldBeServedBy($provider) { throw new PendingException(); } }
  • 13. Enter some logic <?php use BehatBehatTesterExceptionPendingException; use BehatMinkExtensionContextMinkContext; use BehatBehatContextSnippetAcceptingContext; class WebContext extends MinkContext implements SnippetAcceptingContext { private $pages = array( 'default' => '/', 'home' => '/', 'game' => '/spel/donuts-saras-kookcursus' ); private $channels = array( 'Teens' => 'http://www.agame.com', 'Girls' => 'http://www.girlsgogames.com', 'Family' => 'http://spel.nl' ); /** * @Given the visitor is from :country */ public function theVisitorIsFrom($country) { $this->getSession()->setCookie('country', $country); } /** * @When the visitor is on the :page page */ public function theVisitorIsOnThePage($page) { $this->visitPath($this->pages[$page]); } /** * @When the visitor is on the :arg1 channel */ public function theVisitorIsOnTheChannel($channel) { $this->setMinkParameter('base_url', $this->channels[$channel]); } /** * @Then advertisements should be served by :provider */ public function advertisementsShouldBeServedBy($provider) { // provider check... } }
  • 15. Tested 5 scenarios in 10 seconds.