SlideShare a Scribd company logo
1 of 17
Download to read offline
Alex Litvinok




BDD: WTF?                                                    @#
 Have you ever heard of BDD/Gherkin/etc.?
               true is near..




           © 1993-2012. EPAM Systems. All Rights Reserved.
Behavior Driven Development
  .. this is just behavioral specifications.
TDD
DDD




            Automation
            Testing
      BDD
Feature: Post articles

    In order to show trip photos
    A owner
    Should be abble to post article

    Scenario: Post article by owner
       Given I signed up as owner
       When I write article "About myself"
       And I post article
       Then I should see "Article is created"
This is Gherkin..
Just..
Given/ When/ And / Then
Implementation.
   Cucumber
Given /^I signed up as owner$/ do
    pending
end
– Ruby
Scenario               Step Definition                 Domain Classes




                                         Integration
           Scripting
Scenarios should be:
   Easy to understand
       Consistent
     Easy to access
Experience
Task
Check possibility of read/write for MySQL in the PHP
Feature: Check read/write for MySQL in PHP

   Scenario: Check write
      Given connection to MySQL
      When database and a table is selected
      Then some data is inserted

   Scenario: Check read
      Given connection to MySQL
      When database and a table is selected
      And some data is inserted
      Then some data is read
We've got the following steps:
1. connection to MySQL
2. database and a table is selected
3. some data is inserted
4. some data is read
…

/**
  * @Given /^ connection to MySQL$/
  */
  public function connect()
  {
     $this -> conn = mysql_connect();

      if ( ! $this -> conn ) {
          throw new Exception();
      }
  }

  …
Resume

     BDD is a software development process.
     It is based on the behavior specification.
 Gherkin is a meta language for writing scenarious.
Cucumber is tool for testing on different languages.
BDD: WTF? Behavior Driven Development Explained

More Related Content

What's hot

Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)Rajat Pratap Singh
 
MongoDB: The Ultimate Backpack for the Cloud
MongoDB: The Ultimate Backpack for the CloudMongoDB: The Ultimate Backpack for the Cloud
MongoDB: The Ultimate Backpack for the CloudJoe Brinkman
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threadsmperham
 
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupApcera
 

What's hot (6)

Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
 
MongoDB: The Ultimate Backpack for the Cloud
MongoDB: The Ultimate Backpack for the CloudMongoDB: The Ultimate Backpack for the Cloud
MongoDB: The Ultimate Backpack for the Cloud
 
Cucumber
CucumberCucumber
Cucumber
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threads
 
Selenium
SeleniumSelenium
Selenium
 
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup
 

Similar to BDD: WTF? Behavior Driven Development Explained

Object Oriented Views / Aki Salmi
Object Oriented Views / Aki SalmiObject Oriented Views / Aki Salmi
Object Oriented Views / Aki SalmiAki Salmi
 
Securing Your MongoDB Implementation
Securing Your MongoDB ImplementationSecuring Your MongoDB Implementation
Securing Your MongoDB ImplementationMongoDB
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018Berend de Boer
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...marcin_pajdzik
 
React Native: React Meetup 3
React Native: React Meetup 3React Native: React Meetup 3
React Native: React Meetup 3Rob Gietema
 
The Spring Data MongoDB Project
The Spring Data MongoDB ProjectThe Spring Data MongoDB Project
The Spring Data MongoDB ProjectMongoDB
 
Building A SaaS with CoreOS, Docker, and Etcd
Building A SaaS with CoreOS, Docker, and EtcdBuilding A SaaS with CoreOS, Docker, and Etcd
Building A SaaS with CoreOS, Docker, and EtcdRoss Kukulinski
 
Joxean Koret - Database Security Paradise [Rooted CON 2011]
Joxean Koret - Database Security Paradise [Rooted CON 2011]Joxean Koret - Database Security Paradise [Rooted CON 2011]
Joxean Koret - Database Security Paradise [Rooted CON 2011]RootedCON
 
Automation testing using Ruby with Cucumber in Docker
Automation testing using Ruby with Cucumber in DockerAutomation testing using Ruby with Cucumber in Docker
Automation testing using Ruby with Cucumber in DockerViacheslav Horbovskykh
 
Look Again at the ZCA
Look Again at the ZCALook Again at the ZCA
Look Again at the ZCAmikerhodes
 
Deploying a simple Rails application with AWS Elastic Beanstalk
Deploying a simple Rails application with AWS Elastic BeanstalkDeploying a simple Rails application with AWS Elastic Beanstalk
Deploying a simple Rails application with AWS Elastic BeanstalkJulien SIMON
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerLuong Vo
 
Buildr - build like you code
Buildr -  build like you codeBuildr -  build like you code
Buildr - build like you codeIzzet Mustafaiev
 
SD, a P2P bug tracking system
SD, a P2P bug tracking systemSD, a P2P bug tracking system
SD, a P2P bug tracking systemJesse Vincent
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...Hafez Kamal
 

Similar to BDD: WTF? Behavior Driven Development Explained (20)

Object Oriented Views / Aki Salmi
Object Oriented Views / Aki SalmiObject Oriented Views / Aki Salmi
Object Oriented Views / Aki Salmi
 
Securing Your MongoDB Implementation
Securing Your MongoDB ImplementationSecuring Your MongoDB Implementation
Securing Your MongoDB Implementation
 
Rails cantrips
Rails cantripsRails cantrips
Rails cantrips
 
Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...
 
React Native: React Meetup 3
React Native: React Meetup 3React Native: React Meetup 3
React Native: React Meetup 3
 
The Spring Data MongoDB Project
The Spring Data MongoDB ProjectThe Spring Data MongoDB Project
The Spring Data MongoDB Project
 
Cucumber
CucumberCucumber
Cucumber
 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
 
Difference between php and node
Difference between php and nodeDifference between php and node
Difference between php and node
 
Building A SaaS with CoreOS, Docker, and Etcd
Building A SaaS with CoreOS, Docker, and EtcdBuilding A SaaS with CoreOS, Docker, and Etcd
Building A SaaS with CoreOS, Docker, and Etcd
 
Joxean Koret - Database Security Paradise [Rooted CON 2011]
Joxean Koret - Database Security Paradise [Rooted CON 2011]Joxean Koret - Database Security Paradise [Rooted CON 2011]
Joxean Koret - Database Security Paradise [Rooted CON 2011]
 
Automation testing using Ruby with Cucumber in Docker
Automation testing using Ruby with Cucumber in DockerAutomation testing using Ruby with Cucumber in Docker
Automation testing using Ruby with Cucumber in Docker
 
Look Again at the ZCA
Look Again at the ZCALook Again at the ZCA
Look Again at the ZCA
 
Deploying a simple Rails application with AWS Elastic Beanstalk
Deploying a simple Rails application with AWS Elastic BeanstalkDeploying a simple Rails application with AWS Elastic Beanstalk
Deploying a simple Rails application with AWS Elastic Beanstalk
 
Ruby talk romania
Ruby talk romaniaRuby talk romania
Ruby talk romania
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Buildr - build like you code
Buildr -  build like you codeBuildr -  build like you code
Buildr - build like you code
 
SD, a P2P bug tracking system
SD, a P2P bug tracking systemSD, a P2P bug tracking system
SD, a P2P bug tracking system
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 

BDD: WTF? Behavior Driven Development Explained

  • 1. Alex Litvinok BDD: WTF? @# Have you ever heard of BDD/Gherkin/etc.? true is near.. © 1993-2012. EPAM Systems. All Rights Reserved.
  • 2. Behavior Driven Development .. this is just behavioral specifications.
  • 3. TDD DDD Automation Testing BDD
  • 4. Feature: Post articles In order to show trip photos A owner Should be abble to post article Scenario: Post article by owner Given I signed up as owner When I write article "About myself" And I post article Then I should see "Article is created"
  • 7. Implementation. Cucumber
  • 8. Given /^I signed up as owner$/ do pending end – Ruby
  • 9. Scenario Step Definition Domain Classes Integration Scripting
  • 10. Scenarios should be: Easy to understand Consistent Easy to access
  • 12. Task Check possibility of read/write for MySQL in the PHP
  • 13. Feature: Check read/write for MySQL in PHP Scenario: Check write Given connection to MySQL When database and a table is selected Then some data is inserted Scenario: Check read Given connection to MySQL When database and a table is selected And some data is inserted Then some data is read
  • 14. We've got the following steps: 1. connection to MySQL 2. database and a table is selected 3. some data is inserted 4. some data is read
  • 15. … /** * @Given /^ connection to MySQL$/ */ public function connect() { $this -> conn = mysql_connect(); if ( ! $this -> conn ) { throw new Exception(); } } …
  • 16. Resume BDD is a software development process. It is based on the behavior specification. Gherkin is a meta language for writing scenarious. Cucumber is tool for testing on different languages.