BDD in PHP - Behat

4,773 views
4,384 views

Published on

Published in: Technology, Health & Medicine
1 Comment
11 Likes
Statistics
Notes
  • This is the best presentation I have seen online and has certainly persuaded me to try out behat. Thanks.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
4,773
On SlideShare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
55
Comments
1
Likes
11
Embeds 0
No embeds

No notes for slide

BDD in PHP - Behat

  1. 1. BDD + PHP = BehatŁukasz Kużyński – wookieb@wookiebplhttp://wookieb.pl
  2. 2. What is BDD● BDD = Behavior Driven Development● technique for testing and develop software● agile software development technique● variant of TDD● bridge between programmer and client
  3. 3. What is BDD Is a state of mind ** http://blog.robustsoftware.co.uk/2009/11/what-is-bdd-behaviour-driven-design.html
  4. 4. BDD in PHP
  5. 5. How Behats tests looks like
  6. 6. Behat scenario schema
  7. 7. Behat scenario - example
  8. 8. Behat - FeatureContext
  9. 9. Behat – First run (with our code)
  10. 10. Same scenario with new values
  11. 11. Scenario Outline
  12. 12. Feature BackgroundExecuted before each scenario
  13. 13. Hooks
  14. 14. Mooore hooksBeforeSuite BeforeFeature BeforeaScenario BeforeStepAfterSuite AfterFeature AfterScenario AfterStep
  15. 15. Given, When, Then● No special meaning in code● Just a possibility to mark steps● Increase readability of FeatureContext
  16. 16. Extend FeatureContextSubstitute for „horizontal inheritance”
  17. 17. Useful contextshttps://github.com/Behat/CommonContexts
  18. 18. PitfallsFeature should be written for humans,not programmers http://elabs.se/blog/15-you-re-cuking-it-wrong
  19. 19. Can i write „unit tests” in BDD? It is possible but ... inefficient
  20. 20. Does BDD is a replacement for my standard tests Questions?
  21. 21. Łukasz Kużyński – wookieb@wookiebplhttp://wookieb.pl

×