SlideShare a Scribd company logo
tekst
BDD vs Behat
Paweł Skotnicki
About me
PHP developer @ The Software House
PHPers Silesia co-organizer
BDD/DDD enthusiast
BDD
Behaviour Driven Development
Dan North, 2003
BDD is like TDD without world „test”
examples in ubiquitous language
using those examples as the basis of automated tests
BDD main parts
Scenarios
writing down is NOT most important part
conversation
Behat
an open source BDD framework for PHP
Gherkin language
Given, When, Then
Behat !== BDD
BDD = scenarios + automation
Behat = automation tool
Better scenarios?
Imperative vs Declarative
Imperative
reusable granular steps
binds to UI
Declarative
business language
Mink Extension example
BDD vs Behat
BDD vs Behat
Imperative
Feature: Search
In order to see a word definition
As a website user
I need to be able to search for a word
Scenario: Searching for a page that does exist
Given I am on "/wiki/Main_Page"
When I fill in "search" with "Behavior Driven Development"
And I press "searchButton"
Then I should see "agile software development"
Feature: Search
In order to see a word definition
As a website user
I need to be able to search for a word
Scenario: Searching for a page that does exist
Given there is „Behavior Driven Development” article
And there is „agile software development” article
When I search for "Behavior Driven Development"
Then there should be "agile software development” reference
Declarative
Imperative
Scenario: Registering with already used e-mail
Given there are following users:
| username | password | email | active |
| testuser1 | test1 | test@test.pl | 1 |
When I am on „/register” page
And I fill in „username” with „newuser”
And I fill in „password” with „123456”
And I fill in „email” with „test@test.pl”
And I press „register”
Then I should see „e-mail is already used”
Declarative
Scenario: Registering with already used e-mail
Given there is registered user with „test@test.pl” e-mail
When I try to register with „test@test.pl” e-mail
Then I should be notified that e-mail is already used
Scenario: Purchasing a product
Given there is „Lightsaber” which costs $5
When I add „Lightsaber” to basket
Then there should be „Lightsaber” in my basket
When I check out my basket
Then I should be charged for $5
Many activities
Scenario: Adding product to basket
Given there is „Lightsaber”
When I add „Lightsaber” to basket
Then there should be „Lightsaber” in my basket
Scenario: Checking out basket
Given there is „Lightsaber” which costs $5 in my basket
When I check out my basket
Then I should be charged for $5
One activity
Tips
avoid implementation details
use ubiquitous language
ask for examples
describe one activity
Questions?
Thank you

More Related Content

PPTX
Web development basics
PPT
Lesson 2: Getting To Know HTML
POTX
Introduction to PHP - Slide 1
PPTX
Html part 2
KEY
DM 250 Week 1 - The Internet, XHTML, & CSS
PPTX
Very basic intro to HTML
PPT
1. html introduction
PPTX
How To Become A Web Page Master Builder
Web development basics
Lesson 2: Getting To Know HTML
Introduction to PHP - Slide 1
Html part 2
DM 250 Week 1 - The Internet, XHTML, & CSS
Very basic intro to HTML
1. html introduction
How To Become A Web Page Master Builder

What's hot (20)

PPTX
Html.ppt
PDF
Teaching Web Frontend Technologies To A Toddler
PDF
Php workshop L02 php basics
PDF
Introduction to HTML
PDF
Php workshop L0 Introduction
PPTX
Html
PPT
PPTX
How to Write a Clean HTML Blog Post for your CMS
PPTX
HTML BASIC BY SHASHI KANT SINGH HAJIPUR
PPTX
Introducing HTML
PDF
Introduction to HTML5
PPT
PPTX
Lesson 3
PDF
Php workshop L01 CSS
PPTX
Khoa dang (kay)
PPT
Introduction to Html
PDF
Web Development Workshop (Front End)
PPTX
Htmlcss1
PPT
Html.ppt
Teaching Web Frontend Technologies To A Toddler
Php workshop L02 php basics
Introduction to HTML
Php workshop L0 Introduction
Html
How to Write a Clean HTML Blog Post for your CMS
HTML BASIC BY SHASHI KANT SINGH HAJIPUR
Introducing HTML
Introduction to HTML5
Lesson 3
Php workshop L01 CSS
Khoa dang (kay)
Introduction to Html
Web Development Workshop (Front End)
Htmlcss1
Ad

Viewers also liked (20)

PDF
Red Green Hotfix – złudne poczucie bezpieczeństwa w testach
PDF
ReactPHP – reaktor jądrowy w PHP
PDF
Wprowadzenie do języka Swift, czyli nowe podejście do programowania aplikacji...
PDF
Developer mode on, czyli słów kilka o rbenv, rvm i ruby-ng
PDF
Nie wszystko, co ubite, w ziemi zostaje. Wprowadzenie do Event Sourcing
PDF
REvolution, czyli o bardziej obiektowym podejściu w Railsach
PDF
Jak ugryźć Ruby, żeby nie połamać zębów?
PDF
Pierwsza aplikacja na iOS, czyli z czym można się spotkać, co jest trudne i c...
PDF
O wyprawie królika przez maszynkę do gniazdka, czyli EventMachine w praktyce
PDF
Znaki mocy dla laików – Programowanie funkcyjne w JavaScript
PDF
Bestiariusza wpisy wybrane
PDF
Praktyczne porady na temat optymalizacji wydajności aplikacji tworzonych z u...
PDF
Gulp.js - alternatywa do Grunta
PDF
Pi razy drzwi - o szacowaniu projektów
PDF
O Electronie słów kilka
PDF
PDF
Bitcoin - (nie)udany eksperyment?
PDF
Wielkie protokoły wielkich ludzi
PDF
Angular 2.0 – Kochaj albo rzuć!
Red Green Hotfix – złudne poczucie bezpieczeństwa w testach
ReactPHP – reaktor jądrowy w PHP
Wprowadzenie do języka Swift, czyli nowe podejście do programowania aplikacji...
Developer mode on, czyli słów kilka o rbenv, rvm i ruby-ng
Nie wszystko, co ubite, w ziemi zostaje. Wprowadzenie do Event Sourcing
REvolution, czyli o bardziej obiektowym podejściu w Railsach
Jak ugryźć Ruby, żeby nie połamać zębów?
Pierwsza aplikacja na iOS, czyli z czym można się spotkać, co jest trudne i c...
O wyprawie królika przez maszynkę do gniazdka, czyli EventMachine w praktyce
Znaki mocy dla laików – Programowanie funkcyjne w JavaScript
Bestiariusza wpisy wybrane
Praktyczne porady na temat optymalizacji wydajności aplikacji tworzonych z u...
Gulp.js - alternatywa do Grunta
Pi razy drzwi - o szacowaniu projektów
O Electronie słów kilka
Bitcoin - (nie)udany eksperyment?
Wielkie protokoły wielkich ludzi
Angular 2.0 – Kochaj albo rzuć!
Ad

Similar to BDD vs Behat (20)

PDF
Bridging the gap between business and technology - Behaviour Driven Developme...
PDF
DDD with Behat
PDF
Expo qa from user stories to automated acceptance tests with bdd
PDF
Webinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
PPTX
BDD in my team: how we do it
ODP
Behaviour Driven Development
PPTX
Myths and Challenges of Behaviour Driven Development
ODP
BDD with Behat
PPTX
Bdd masterclass
PDF
BDD in PHP - Behat
PDF
Behavior driven development with Behat and Gherkin
PDF
Introduction to BDD (Behavior-Driven Development)
PDF
BDD in practice based on an open source project
PPT
PDF
Behavior Driven Development - WPC 2011
PPTX
Automation testing
PDF
TDD with BDD in PHP and Symfony
PPTX
Tdd and bdd
PDF
BDD in open source projects - Is it really beneficial?
PDF
Symfony2 Specification by examples
Bridging the gap between business and technology - Behaviour Driven Developme...
DDD with Behat
Expo qa from user stories to automated acceptance tests with bdd
Webinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
BDD in my team: how we do it
Behaviour Driven Development
Myths and Challenges of Behaviour Driven Development
BDD with Behat
Bdd masterclass
BDD in PHP - Behat
Behavior driven development with Behat and Gherkin
Introduction to BDD (Behavior-Driven Development)
BDD in practice based on an open source project
Behavior Driven Development - WPC 2011
Automation testing
TDD with BDD in PHP and Symfony
Tdd and bdd
BDD in open source projects - Is it really beneficial?
Symfony2 Specification by examples

More from The Software House (20)

PDF
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
PDF
Uszanowanko Podsumowanko
PDF
Jak efektywnie podejść do certyfikacji w AWS?
PDF
O co chodzi z tą dostępnością cyfrową?
PDF
Chat tekstowy z użyciem Amazon Chime
PDF
Migracje danych serverless
PDF
Jak nie zwariować z architekturą Serverless?
PDF
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
PDF
Feature flags na ratunek projektu w JavaScript
PDF
Typowanie nominalne w TypeScript
PDF
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
PDF
Serverless Compose vs hurtownia danych
PDF
Testy API: połączenie z bazą danych czy implementacja w pamięci
PDF
Jak skutecznie read model. Case study
PDF
Firestore czyli ognista baza od giganta z Doliny Krzemowej
PDF
Jak utrzymać stado Lambd w ryzach
PDF
Jak poskromić AWS?
PDF
O łączeniu Storyblok i Next.js
PDF
Amazon Step Functions. Sposób na implementację procesów w chmurze
PDF
Od Figmy do gotowej aplikacji bez linijki kodu
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Uszanowanko Podsumowanko
Jak efektywnie podejść do certyfikacji w AWS?
O co chodzi z tą dostępnością cyfrową?
Chat tekstowy z użyciem Amazon Chime
Migracje danych serverless
Jak nie zwariować z architekturą Serverless?
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Feature flags na ratunek projektu w JavaScript
Typowanie nominalne w TypeScript
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Serverless Compose vs hurtownia danych
Testy API: połączenie z bazą danych czy implementacja w pamięci
Jak skutecznie read model. Case study
Firestore czyli ognista baza od giganta z Doliny Krzemowej
Jak utrzymać stado Lambd w ryzach
Jak poskromić AWS?
O łączeniu Storyblok i Next.js
Amazon Step Functions. Sposób na implementację procesów w chmurze
Od Figmy do gotowej aplikacji bez linijki kodu

Recently uploaded (20)

PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
Teaching material agriculture food technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
KodekX | Application Modernization Development
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Machine learning based COVID-19 study performance prediction
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Electronic commerce courselecture one. Pdf
PPTX
Cloud computing and distributed systems.
PDF
Network Security Unit 5.pdf for BCA BBA.
GamePlan Trading System Review: Professional Trader's Honest Take
20250228 LYD VKU AI Blended-Learning.pptx
Teaching material agriculture food technology
Reach Out and Touch Someone: Haptics and Empathic Computing
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Empathic Computing: Creating Shared Understanding
KodekX | Application Modernization Development
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Weekly Chronicles - August'25 Week I
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Machine learning based COVID-19 study performance prediction
Diabetes mellitus diagnosis method based random forest with bat algorithm
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Electronic commerce courselecture one. Pdf
Cloud computing and distributed systems.
Network Security Unit 5.pdf for BCA BBA.

BDD vs Behat

  • 2. About me PHP developer @ The Software House PHPers Silesia co-organizer BDD/DDD enthusiast
  • 3. BDD Behaviour Driven Development Dan North, 2003 BDD is like TDD without world „test”
  • 4. examples in ubiquitous language using those examples as the basis of automated tests BDD main parts
  • 5. Scenarios writing down is NOT most important part conversation
  • 6. Behat an open source BDD framework for PHP Gherkin language Given, When, Then
  • 7. Behat !== BDD BDD = scenarios + automation Behat = automation tool
  • 9. Imperative vs Declarative Imperative reusable granular steps binds to UI Declarative business language
  • 13. Imperative Feature: Search In order to see a word definition As a website user I need to be able to search for a word Scenario: Searching for a page that does exist Given I am on "/wiki/Main_Page" When I fill in "search" with "Behavior Driven Development" And I press "searchButton" Then I should see "agile software development"
  • 14. Feature: Search In order to see a word definition As a website user I need to be able to search for a word Scenario: Searching for a page that does exist Given there is „Behavior Driven Development” article And there is „agile software development” article When I search for "Behavior Driven Development" Then there should be "agile software development” reference Declarative
  • 15. Imperative Scenario: Registering with already used e-mail Given there are following users: | username | password | email | active | | testuser1 | test1 | test@test.pl | 1 | When I am on „/register” page And I fill in „username” with „newuser” And I fill in „password” with „123456” And I fill in „email” with „test@test.pl” And I press „register” Then I should see „e-mail is already used”
  • 16. Declarative Scenario: Registering with already used e-mail Given there is registered user with „test@test.pl” e-mail When I try to register with „test@test.pl” e-mail Then I should be notified that e-mail is already used
  • 17. Scenario: Purchasing a product Given there is „Lightsaber” which costs $5 When I add „Lightsaber” to basket Then there should be „Lightsaber” in my basket When I check out my basket Then I should be charged for $5 Many activities
  • 18. Scenario: Adding product to basket Given there is „Lightsaber” When I add „Lightsaber” to basket Then there should be „Lightsaber” in my basket Scenario: Checking out basket Given there is „Lightsaber” which costs $5 in my basket When I check out my basket Then I should be charged for $5 One activity
  • 19. Tips avoid implementation details use ubiquitous language ask for examples describe one activity