BDD, using Behat
from Use Case to implementation
Herman Peeren
8 mei 2014, 010PHP
Developing software not easy
improved a bit over the years:
Waterfall
Waterfall vs Agile
iterations (sprints)
Waterfall vs Agile
DDD
TDD
BDD
Sapir–Whorf hypothesis
Linguistic relativity:
Structure of a language affects the ways in which its
respective speakers conceptualize their world.
голубой
Wilhelm von Humboldt Franz Boas Edward Sapir
Nelleke Verhoeff, Red Cheeks Factory,
Nelleke Verhoeff, Red Cheeks Factory,
DDD
ubiquitous language:
using the language of the domain you are modeling
TDD
Tests afterwards are boring, I like to create new things!
TDD
Tests first!
Some recent TDD critics
•	architecture destroyed by unit-level-tests
•	easy to measure doesn’t mean it’s important
David Heinemeier Hansson (‘DHH’)
http://www.confreaks.com/videos/3315-railsconf-keynote
James Coplien (‘Cope’)
www.rbcs-us.com/documents/Why-Most-Unit-Testing-is-Waste.pdf
BDD
Dan North
http://dannorth.net/introducing-bdd/
Functional testing
Selenium
http://docs.seleniumhq.org/
Selenium in PHPUnit
http://phpunit.de/manual/current/en/selenium.html
Acceptence testing
Behat
http://behat.org/
Behat
•	based on Cucumber (Gherkin language)
•	given - when - then
Behat: define features
steps suggestions
define steps
Mink
http://mink.behat.org/
Codeception
http://codeception.com/
No Gherkin-language, but PHP (new WebGuy)
Behat, Behavioral Driven Development (BDD) in PHP

Behat, Behavioral Driven Development (BDD) in PHP