Why Do You Say BDD If It Is Cucumber

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

Why do you say BDD if it is

Cucumber?
Or How I Learned to Stop Worrying and Love the Behavior

Enrique Snchez
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 them
doesnt automatically mean youre doing BDD.

BDD is a MINDSET not a TOOL

What the f**k is BDD then?

Engineering

Product

Miscommunication
between 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 dont think in code

Define a feature
Start with expectations
Instead of setting state or user actions
Keep Scenarios simple
Split complicated workflows

Declarative
Be concise
Dont be Shakespeare
Not unnecessary steps
Remember YAGNI

Abstraction
Describe a feature, not edge cases
Think in requirements
Only BDD the happy path
Therere controller/model/view tests

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
Ruby, Python, Java

Narratives

Examples

Emergent Design

Describe

Implement

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 its your first day you have to talk and ask

Questions?
Thank you!

Enrique Snchez | hola@enrique-sanchez.me | @EnriqueSanchezB

You might also like