SlideShare a Scribd company logo
1
WHY YOU SHOULD BE
DOING BDD
MATEUSZ ZALEWSKI
@mpzalewski
https://github.com/Zales0123
BDD is a process designed to aid the management and the delivery of software
development projects by improving communication between engineers and
business professionals.
BEHAVIOR DRIVEN
DEVELOPMENT
2
http://inviqa.com/insights/bdd-guide
3
TEST BEHAVIOR
https://worldviewofjesus.files.wordpress.com/2015/02/evolution.jpg
4
✦ “There is no time”
✦ “It’s unnecessary extra code”
✦ “I know what I’m writing”
✦ “Client wants visible effect”
✦ and many more…
BENEFITS
5
COMMUNICATION
6
REQUIREMENTS CODE
7
कोड байт
MONEY CODE BYTE
8
कोड байт
MONEY CODE BYTE
UBIQUITOUS LANGUAGE
Value
Time
9
NOEFFICIENCY
Value
Time
10
EFFICIENCY
HOW?
11
FAILING
PASSEDREFACTOR
12
NO TESTS
NO REFACTORING
13
14
GOAL
We are going to
increase sale by
selling more
products
We are going to
increase sale by
selling more
products
GOAL
We are planning to
achieve a 10% increase
in sale in our web store
in 4 months
15
EXAMPLES
Given "PHP T-Shirt" is priced at €100.00
And the store has "VAT" tax rate of 23%
When I add product "PHP T-Shirt" to the cart
Then my cart taxes should be €23.00
16
LESS AMBIGUITY
=
LESS MISUNDERSTANDINGS
17
18
SPECIFICATION
STORY
How class should work
Application business logic
DON’T TEST, DESCRIBE
19
20
✦ it adds two numbers
✦ it multiplies two numbers
✦ it subtracts two numbers
✦ it divides two numbers
✦ it not allows to divide by 0
WHAT DOES
CALCULATOR DO?
21
HOW HARD CAN IT BE?
class CalculatorSpec extends ObjectBehavior
{
function it_adds_two_numbers()
{
$this->add(4, 5)->shouldReturn(9);
}
function it_multiplies_two_numbers()
{
$this->multiply(3, 8)->shouldReturn(24);
}
function it_does_not_allow_to_divide_by_0()
{
$this
->shouldThrow(‘InvalidArgumentException’)
->during(‘divide’, [10, 0])
;
}
}
22
class ValidationMessageProviderSpec extends ObjectBehavior
{
function it_provides_happy_message_if_validation_passed(
Validator $validator,
ValidatedObject $object
) {
$validator->validate($object)->willReturn(true);
$this->provide($object)->shouldReturn(‘Great! Everything is fine!’);
}
}
HAVING FUN WITH MOCKS
THINK IN CODE
CODE IS GOOD
23
http://phpsrbija.rs/tday2014/img/portfolio/phpspec.png
STORY
24
It is an ancient need to be told stories. But the
story needs a great storyteller.
~ Alan Rickman
FEATURE
25
WHY? (BUSINESS VALUE)
WHO? (BENEFICIARY)
WHAT? (FEATURE DESCRIPTION)
FEATURE
26
In order to pay less while buying goods
As a Customer
I want to receive discount for my purchase
Receiving percentage discount promotion on order
SCENARIO
27
Given "PHP T-Shirt" is priced at €100.00
And the store has "VAT" tax rate of 23%
When I add product "PHP T-Shirt" to the cart
Then my cart taxes should be €23.00
BEHAT
28
https://github.com/Behat/Behat
✦ uses Gherkin structured
language
✦ used to describe application
business logic
✦ really impressive
29
✦ Behat (PHP)
✦ PHPSpec (PHP)
✦ Cucumber (Ruby)
✦ JBehave (Java)
✦ Spock (Groovy)
✦ SpecFlow (.NET)
TOOLS
30
Have no fear of perfection - you’ll never reach it.
~ Salvador Dali
THANK YOU
31
@mpzalewskihttps://github.com/Zales0123

More Related Content

DOC
Over 5 Yrs Exp in Material Handling & Construction Machineries
PPT
PresentacióN2
PPTX
Día de la familia
PDF
SAFE Final Report_12-07_Final
PPS
Survival po polsku
DOCX
srikanth Curriculamvitae analyticx
PPS
vida y obra de michael jackson
PDF
Stack Open Source para desenvolvimento do AoMercado
Over 5 Yrs Exp in Material Handling & Construction Machineries
PresentacióN2
Día de la familia
SAFE Final Report_12-07_Final
Survival po polsku
srikanth Curriculamvitae analyticx
vida y obra de michael jackson
Stack Open Source para desenvolvimento do AoMercado

Viewers also liked (6)

PDF
管理職のための「リーダーシップ実践」体験会【講演資料抜粋】
PPTX
Open World of #OSS and #HealthTech
PDF
Talk to MOE educators@Singapore Science Centre for Animate@South Zone
管理職のための「リーダーシップ実践」体験会【講演資料抜粋】
Open World of #OSS and #HealthTech
Talk to MOE educators@Singapore Science Centre for Animate@South Zone
Ad

Similar to Why you should be doing BDD (20)

PPTX
Continously delivering
PDF
Becoming a better WordPress Developer
PPTX
[MongoDB.local Bengaluru 2018] Just in Time Validation with JSON Schema
PDF
Write bulletproof trigger code
PPTX
Bdd with Cucumber and Mocha
PDF
Сергей Больщиков "Protractor Tips & Tricks"
PDF
Jakość dostarczanego oprogramowania oparta o testy
PDF
Front End Development for Back End Developers - Denver Startup Week 2017
PDF
DevSecOpsNess: Adding the business dimension to DevOps by Tanusree McCabe
PDF
From framework coupled code to #microservices through #DDD /by @codelytv
PDF
Behavioural Driven Development in Zf2
PDF
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
PDF
The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014
PDF
PPTX
IndexedDB and Push Notifications in Progressive Web Apps
PPTX
The SharePoint & jQuery Guide - Updated 1/14/14
PPTX
Introduction to modern front-end with Vue.js
PDF
Customer Success 2020
PPTX
Agile methodologies based on BDD and CI by Nikolai Shevchenko
PDF
實戰Facebook Marketing API
Continously delivering
Becoming a better WordPress Developer
[MongoDB.local Bengaluru 2018] Just in Time Validation with JSON Schema
Write bulletproof trigger code
Bdd with Cucumber and Mocha
Сергей Больщиков "Protractor Tips & Tricks"
Jakość dostarczanego oprogramowania oparta o testy
Front End Development for Back End Developers - Denver Startup Week 2017
DevSecOpsNess: Adding the business dimension to DevOps by Tanusree McCabe
From framework coupled code to #microservices through #DDD /by @codelytv
Behavioural Driven Development in Zf2
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014
IndexedDB and Push Notifications in Progressive Web Apps
The SharePoint & jQuery Guide - Updated 1/14/14
Introduction to modern front-end with Vue.js
Customer Success 2020
Agile methodologies based on BDD and CI by Nikolai Shevchenko
實戰Facebook Marketing API
Ad

More from Mateusz Zalewski (10)

PDF
[PHPCon 2023] Blaski i cienie BDD
PDF
[PHPCon 2023] “Kto to pisał?!... a, to ja.”, czyli sposoby żeby znienawidzić ...
PDF
[ForumPHP 2023] Lights and shadows of BDD in Sylius (and probably other compa...
PDF
[PHPers Summit 2023] Business logic testing
PDF
"Kto to pisał?!... A, to ja.", czyli sposoby, żeby znienawidzić siebie z prze...
PDF
Confoo 2023 - BDD revolution, or how we came back from hell
PDF
Confoo 2023 - Business logic testing with Behat, Twig and Api Platform
PDF
What is Sylius and why should you know it?
PDF
BDD Revolution - or how we came back from hell
PDF
BDD revolution - or how we came back from hell
[PHPCon 2023] Blaski i cienie BDD
[PHPCon 2023] “Kto to pisał?!... a, to ja.”, czyli sposoby żeby znienawidzić ...
[ForumPHP 2023] Lights and shadows of BDD in Sylius (and probably other compa...
[PHPers Summit 2023] Business logic testing
"Kto to pisał?!... A, to ja.", czyli sposoby, żeby znienawidzić siebie z prze...
Confoo 2023 - BDD revolution, or how we came back from hell
Confoo 2023 - Business logic testing with Behat, Twig and Api Platform
What is Sylius and why should you know it?
BDD Revolution - or how we came back from hell
BDD revolution - or how we came back from hell

Recently uploaded (20)

PDF
Cost to Outsource Software Development in 2025
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
Nekopoi APK 2025 free lastest update
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
assetexplorer- product-overview - presentation
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Complete Guide to Website Development in Malaysia for SMEs
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Cost to Outsource Software Development in 2025
Salesforce Agentforce AI Implementation.pdf
Oracle Fusion HCM Cloud Demo for Beginners
Design an Analysis of Algorithms II-SECS-1021-03
Autodesk AutoCAD Crack Free Download 2025
Nekopoi APK 2025 free lastest update
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
assetexplorer- product-overview - presentation
CHAPTER 2 - PM Management and IT Context
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Complete Guide to Website Development in Malaysia for SMEs
Why Generative AI is the Future of Content, Code & Creativity?
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Digital Systems & Binary Numbers (comprehensive )
Weekly report ppt - harsh dattuprasad patel.pptx
wealthsignaloriginal-com-DS-text-... (1).pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx

Why you should be doing BDD