BDD - Behavior Driven
Development
with Behat/Mink
Developers MeetUp Freiburg 06/2013
Developers MeetUp Freiburg
Developers MeetUp Freiburg
Steffen Müller
/gebrüderheitz GmbH
PHP Software Architect + Developer
@t3node // www.t3node.com
Developers MeetUp Freiburg
Case Study
Developers MeetUp Freiburg
“Simple” order form
Developers MeetUp Freiburg
Related functional tests (Selenium)
Developers MeetUp Freiburg
How the complexity felt like
Image by Kyle Lease CC BY-SA 2.0 http://www.flickr.com/photos/kl75...
Developers MeetUp Freiburg
Focus on requirements
instead of high coverage
Developers MeetUp Freiburg
Behavior Driven
Development
Developers MeetUp Freiburg
Behavior What?
Developers MeetUp Freiburg
Analyze
Concept
Test
Coding
Linear progress
Sketch inspired by J. B. Rainsberger:
http://www.jb...
Developers MeetUp Freiburg
Analyze Concept
Test Coding
Continuous Iteration
Short
cycles
Sketch inspired by J. B. Rainsber...
Developers MeetUp Freiburg
BDD
Building the
right things
TDD
Building the
things right
TDD or BDD?
Developers MeetUp Freiburg
Communication
Images by Alberto Sanchis (MisteryCat)
http://misterycat.deviantart.com/
Stakehol...
Developers MeetUp Freiburg
Ubiquitous Language
User
Customer
Unregistered
user
New customer
Images by Alberto Sanchis (Mis...
Developers MeetUp Freiburg
Feature Description
Developers MeetUp Freiburg
“As a [role]
I want [feature]
so that [benefit]”
Feature Description
Developers MeetUp Freiburg
“As a [role]
I want [feature]
so that [benefit]”
User Story
Feature Description
Developers MeetUp Freiburg
“As a customer
I need a shopping cart
to check my selected products”
Example Feature Description
Developers MeetUp Freiburg
Scenarios / Use cases
Developers MeetUp Freiburg
Scenario: [Use Case]
Given... [Context]
When... [Event]
Then... [Result]
Scenario
Developers MeetUp Freiburg
Scenario: See selected products in the
shopping cart
Given I visit the FooBar shop
And I add a ...
Developers MeetUp Freiburg
Scenario: Find a product in the shopping basket
Given I visit the FooBar shop
And I select a “d...
gherkin
Clearly structured language
Easy to understand
Easy to rephrase
Straightforward syntax
Executable steps
Developers...
Developers MeetUp Freiburg
Behat
A php framework for testing
business expectations
Developers MeetUp Freiburg
Mink
Acceptance test framework
for web applications, written in PHP
Behat
A php framework for t...
Developers MeetUp Freiburg
Live Demo
Resources
BDD Introduction:
http://dannorth.net/introducing-bdd/
Behat/Mink:
http://behat.org/
bInit: kickstarter package ...
Developers MeetUp Freiburg
Thank You!
If you need BDD + Behat/Mink support, send me a mail:
Steffen Müller <bdd@t3node.com>
Upcoming SlideShare
Loading in …5
×

DevsMeetUp Freiburg: Behavior Driven Development with Behat/Mink

2,330 views

Published on

Slides of my Introduction to Behavior Driven Development with Behat/Mink at DevsMeetUp Freiburg 06/2013

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,330
On SlideShare
0
From Embeds
0
Number of Embeds
65
Actions
Shares
0
Downloads
7
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

DevsMeetUp Freiburg: Behavior Driven Development with Behat/Mink

  1. 1. BDD - Behavior Driven Development with Behat/Mink Developers MeetUp Freiburg 06/2013 Developers MeetUp Freiburg
  2. 2. Developers MeetUp Freiburg Steffen Müller /gebrüderheitz GmbH PHP Software Architect + Developer @t3node // www.t3node.com
  3. 3. Developers MeetUp Freiburg Case Study
  4. 4. Developers MeetUp Freiburg “Simple” order form
  5. 5. Developers MeetUp Freiburg Related functional tests (Selenium)
  6. 6. Developers MeetUp Freiburg How the complexity felt like Image by Kyle Lease CC BY-SA 2.0 http://www.flickr.com/photos/kl75214/
  7. 7. Developers MeetUp Freiburg Focus on requirements instead of high coverage
  8. 8. Developers MeetUp Freiburg Behavior Driven Development
  9. 9. Developers MeetUp Freiburg Behavior What?
  10. 10. Developers MeetUp Freiburg Analyze Concept Test Coding Linear progress Sketch inspired by J. B. Rainsberger: http://www.jbrains.ca/permalink/how-test-driven-development-works-and-more
  11. 11. Developers MeetUp Freiburg Analyze Concept Test Coding Continuous Iteration Short cycles Sketch inspired by J. B. Rainsberger: http://www.jbrains.ca/permalink/how-test-driven-development-works-and-more
  12. 12. Developers MeetUp Freiburg BDD Building the right things TDD Building the things right TDD or BDD?
  13. 13. Developers MeetUp Freiburg Communication Images by Alberto Sanchis (MisteryCat) http://misterycat.deviantart.com/ Stakeholder Developer
  14. 14. Developers MeetUp Freiburg Ubiquitous Language User Customer Unregistered user New customer Images by Alberto Sanchis (MisteryCat) http://misterycat.deviantart.com/
  15. 15. Developers MeetUp Freiburg Feature Description
  16. 16. Developers MeetUp Freiburg “As a [role] I want [feature] so that [benefit]” Feature Description
  17. 17. Developers MeetUp Freiburg “As a [role] I want [feature] so that [benefit]” User Story Feature Description
  18. 18. Developers MeetUp Freiburg “As a customer I need a shopping cart to check my selected products” Example Feature Description
  19. 19. Developers MeetUp Freiburg Scenarios / Use cases
  20. 20. Developers MeetUp Freiburg Scenario: [Use Case] Given... [Context] When... [Event] Then... [Result] Scenario
  21. 21. Developers MeetUp Freiburg Scenario: See selected products in the shopping cart Given I visit the FooBar shop And I add a “dishwasher” to my cart When I go to the shopping cart Then I should see a “dishwasher” Example Scenario
  22. 22. Developers MeetUp Freiburg Scenario: Find a product in the shopping basket Given I visit the FooBar shop And I select a “dishwasher” When I go to the shopping basket Then I should see a “dishwasher”gherkin Example Scenario
  23. 23. gherkin Clearly structured language Easy to understand Easy to rephrase Straightforward syntax Executable steps Developers MeetUp Freiburg
  24. 24. Developers MeetUp Freiburg Behat A php framework for testing business expectations
  25. 25. Developers MeetUp Freiburg Mink Acceptance test framework for web applications, written in PHP Behat A php framework for testing business expectations
  26. 26. Developers MeetUp Freiburg Live Demo
  27. 27. Resources BDD Introduction: http://dannorth.net/introducing-bdd/ Behat/Mink: http://behat.org/ bInit: kickstarter package for Behat: https://github.com/t3node/binit Wynne + Hellesøy (2012): “The Cucumber Book” Developers MeetUp Freiburg
  28. 28. Developers MeetUp Freiburg Thank You! If you need BDD + Behat/Mink support, send me a mail: Steffen Müller <bdd@t3node.com>

×