Why do you say BDD if it is
Cucumber?
Or How I Learned to Stop Worrying and Love the Behavior
Enrique Sánchez
Technical Team Lead @ Medianet Software
CUCUMBER =/= BDD
BDD is a software development process
Cucumber is a tool
“
”
All of these tools are great… but, in the end, tools are tools.
While RSpec and Cucumber are optimized for BDD, using ...
BDD is a MINDSET not a TOOL
What the f**k is BDD then?
Engineering
Product
Miscommunicationbetween stakeholders, product, devs…
“
”
56% of all bugs can be traced to errors made during the
requirement stage.
Tom deMarco
“ ”
68% failed projects
Standish Group Report 2009
How to solve this gap?
Gherkin
Define a narrative
Why?
Feature name, Actor, behavior, benefit
What?
Scenarios and steps
Feature
In	
  order	
  to	
  Value proposition
As	
  a	
  Role/actor
I	
  want	
  to feature description
Scenario
Given	
  setup
When	
  user	
  interaction/change
Then	
  outcome (assert)
How to create a narrative?
Forget the implementation
Who cares about code?
Product and Marketing don’t think in code
Define a feature
Start with expectations
Instead of setting state or user actions
Keep Scenarios simple
Split complicated ...
Declarative
Be concise
Don’t be Shakespeare
Not unnecessary steps
Remember YAGNI
Abstraction
Describe a feature, not edge cases
Think in requirements
Only BDD the happy path
There’re controller/model/vie...
Assert only once
Only assert on Then steps
No more user actions after a Then
Now you can choose your tool
Design, code, reuse
Use the right tool for the right job
What are you testing: web, mobile, service?
Think in the language...
Narratives
Examples Describe
ImplementEmergent Design
BDD Club Rules
The first rule is you have to talk
The second stories should speak with the customers terminology
The third...
Questions?
Thank you!
Enrique Sánchez | hola@enrique-sanchez.me | @EnriqueSanchezB
Upcoming SlideShare
Loading in …5
×

Why do you say BDD if it is Cucumber?

891 views

Published on

How to define good features, scenarios and steps without care about the tool you are using.

Published in: Software, Technology
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
891
On SlideShare
0
From Embeds
0
Number of Embeds
25
Actions
Shares
0
Downloads
21
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Why do you say BDD if it is Cucumber?

  1. 1. Why do you say BDD if it is Cucumber? Or How I Learned to Stop Worrying and Love the Behavior
  2. 2. Enrique Sánchez Technical Team Lead @ Medianet Software
  3. 3. CUCUMBER =/= BDD
  4. 4. BDD is a software development process Cucumber is a tool
  5. 5. “ ” All of these tools are great… but, in the end, tools are tools. While RSpec and Cucumber are optimized for BDD, using them doesn’t automatically mean you’re doing BDD.
  6. 6. BDD is a MINDSET not a TOOL
  7. 7. What the f**k is BDD then?
  8. 8. Engineering Product
  9. 9. Miscommunicationbetween stakeholders, product, devs…
  10. 10. “ ” 56% of all bugs can be traced to errors made during the requirement stage. Tom deMarco
  11. 11. “ ” 68% failed projects Standish Group Report 2009
  12. 12. How to solve this gap?
  13. 13. Gherkin
  14. 14. Define a narrative Why? Feature name, Actor, behavior, benefit What? Scenarios and steps
  15. 15. Feature In  order  to  Value proposition As  a  Role/actor I  want  to feature description
  16. 16. Scenario Given  setup When  user  interaction/change Then  outcome (assert)
  17. 17. How to create a narrative?
  18. 18. Forget the implementation Who cares about code? Product and Marketing don’t think in code
  19. 19. Define a feature Start with expectations Instead of setting state or user actions Keep Scenarios simple Split complicated workflows
  20. 20. Declarative Be concise Don’t be Shakespeare Not unnecessary steps Remember YAGNI
  21. 21. Abstraction Describe a feature, not edge cases Think in requirements Only BDD the happy path There’re controller/model/view tests
  22. 22. Assert only once Only assert on Then steps No more user actions after a Then
  23. 23. Now you can choose your tool
  24. 24. Design, code, reuse Use the right tool for the right job What are you testing: web, mobile, service? Think in the language Ruby, Python, Java…
  25. 25. Narratives Examples Describe ImplementEmergent Design
  26. 26. BDD Club Rules The first rule is you have to talk The second stories should speak with the customers terminology The third rule stories are not specs The fourth rule keep the story goals as real values for the customer The fifth rule stories should not be exhaustive The sixth rule stories should not be too low level or high level The seventh rule stories should slice through multiple layers The eighth, if it’s your first day you have to talk and ask
  27. 27. Questions? Thank you!
  28. 28. Enrique Sánchez | hola@enrique-sanchez.me | @EnriqueSanchezB

×