Unleashing the Power of Behavior Driven Development Jeffrey Davidson e: [email protected] t: @JeffreyGoodReq b: goodrequirements.com BusinessAnalystWorld Toronto May 14, 2012
Unleashing the Power of Behavior Driven Development
Jeffrey Davidson e: [email protected] t: @JeffreyGoodReq b: goodrequirements.com BusinessAnalystWorld Toronto May 14, 2012
© Jeffrey Davidson, 2012
Today’s Agenda
! Thinking like an investor
! Communicating through examples
! Bridging understanding
© Jeffrey Davidson, 2012
© Jeffrey Davidson, 2012
What matters
If you want to add . . . Value
. . . argue about features . . . ask about why
Value
© Jeffrey Davidson, 2012
Simple?
! “We can only hope to make reliable those things that we can understand.
! We can only consider a few things at a time.
! Intertwined things must be considered together.
! Complexity undermines understanding.”
“Simple Made Easy” by Rich Hickey @ StrangeLoop 2011
© Jeffrey Davidson, 2012
© Jeffrey Davidson, 2012
Stories
© Jeffrey Davidson, 2012
Do you mean User Stories?
As a . . . , I want . . . So . . . .
© Jeffrey Davidson, 2012
User Stories are Statements
! User Stories do not give all the preconditions or all the actors actions or all the system responses
! “Promise of a future conversation”
© Jeffrey Davidson, 2012
In order to . . . ,
Do you mean User Stories?
As a . . . , I want . . .
© Jeffrey Davidson, 2012
Let’s practice
! I want you to build my online reservation system
© Jeffrey Davidson, 2012
Let’s practice: User Stories
© Jeffrey Davidson, 2012
Let’s practice: User Stories
! In order to ____________
! As a _____,
! I want to ____________.
© Jeffrey Davidson, 2012
What is BDD?
“BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software
that matters.”
Dan North @ Agile Specifications, 2009
© Jeffrey Davidson, 2012
What is BDD?
! Fine grained, focused bits of behavior
! Told in a story format
No, really, what is it?
© Jeffrey Davidson, 2012
– – context You & You
r condition
What you do
What you
see
Simple Structure
event response
© Jeffrey Davidson, 2012
– – Given
You & Your conditi
on
What you do
What you
see
Simple Structure
When Then
© Jeffrey Davidson, 2012
What is it?
! It’s a bunch of tiny stories, using a particular grammatical structure.
! It’s finding places of misunderstanding, and filling it with understanding.
! It’s a conversation, captured.
© Jeffrey Davidson, 2012
Generic over Specific
! Generic behavior (no design)
Imagine performing the
same actions on a
telephone interface!
© Jeffrey Davidson, 2012
Generic over Specific
! Amplify with examples
Using Business Terms
in Natural Language
© Jeffrey Davidson, 2012
Let’s practice: Acceptance Criteria
!
© Jeffrey Davidson, 2012
Let’s practice: Acceptance Criteria
Were you design
agnostic?
Did you use natural language? Was everything in business terms?
© Jeffrey Davidson, 2012
Let’s practice: Examples
© Jeffrey Davidson, 2012
Let’s practice: Examples
! Given:
! When:
! Then:
© Jeffrey Davidson, 2012
Built right or Right product?
Gojko Adzic in Specification by Example, 2011
Built Right
Focu
s
Right Product
Spec by example
© Jeffrey Davidson, 2012
Built right or Right product?
Built Right
Right Product
Business Failure
Useless Crap
Success
Maintenance Nightmare
Gojko Adzic in Specification by Example, 2011
© Jeffrey Davidson, 2012
Benefits
To build the right product effectively, software dev practices need: ! Assurance all stakeholders & delivery
team members understand what needs to be delivered in the same way.
Gojko Adzic in Specification by Example, 2011
© Jeffrey Davidson, 2012
Benefits
To build the right product effectively, software dev practices need: ! Precise specifications so delivery teams
avoid wasteful rework caused by ambiguities and functional gaps.
Gojko Adzic in Specification by Example, 2011
© Jeffrey Davidson, 2012
Benefits
To build the right product effectively, software dev practices need: ! An objective means to measure when a
piece of work is complete.
Gojko Adzic in Specification by Example, 2011
© Jeffrey Davidson, 2012
Who Benefits?
! Everyone!
! Seriously, it helps everyone. • Business • Users • Testers • Developers • Analysts
© Jeffrey Davidson, 2012
It’s not about tools
“These tools are intended for use by programmers to guide coding, but they can also be used to express business facing tests that drive development, involving customers more closely in the process.”
Lisa Crispin in Agile Testing, 2009
© Jeffrey Davidson, 2012
Downsides
! May not help velocity
! New (to you)
! Tools (and all that jazz) may cause clutter, slow-down, new learning, other stuff
© Jeffrey Davidson, 2012
Recap
! Find the value
! Model the output
! Put what’s important first
! Communicate with scenarios
! Build a bridge!
© Jeffrey Davidson, 2012
– – Given
You & Your conditi
on
What you do
What you
see
When Then
© Jeffrey Davidson, 2012
My Primary Sources
! Gojko Adzic BDD / Specification by Example gojko.net
! Martin Fowler Crevasse of Doom (ferry boats & bridges)
martinfowler.com ! Liz Keogh BDD lunivore.com ! Chris Matts Invented: Feature Injection theitriskmanager.wordpress.com ! Dan North Crevasse of Doom & Invented: BDD dannorth.net
© Jeffrey Davidson, 2012
Share & Tell
This is licensed under Creative Commons Sharealike [CC BY 3.0] ! Please use it ! Please share it ! Please improve it ! As long as you credit me somewhere
Unleashing the Power of Behavior Driven Development
Jeffrey Davidson e: [email protected] t: @JeffreyGoodReq b: goodrequirements.com BusinessAnalystWorld Toronto May 14, 2012