Upload
njpst8
View
157
Download
0
Embed Size (px)
Citation preview
“Behaviour-driven-development is about implementing an application by describing its behaviour from the perspective of its stakeholders”
--Dan North
“BDD’s focus is on the discovery of stuff we didn’t know about, particularly around the contexts in which scenarios or examples take place. …”
--Liz Keogh
“.. It [BDD] describes a cycle of interactions with well defined outputs resulting in delivery of working, tested software that matters.”
--Dan North
“BDD practitioners explore, discover, define, and drive out desired behavior of software using conversations, concrete examples, and automated tests”
--Matt Wynne
Having conversations with domain experts
and using examples
to gain a shared understanding of the desired behavior
and discover unknowns
Having conversations with domain experts
and using examples
to gain a shared understanding of the desired behavior
and discover unknowns
Having conversations with domain experts
and using examples
to gain a shared understanding of the desired behavior
and discover unknowns
Having conversations with domain experts
and using examples
to gain a shared understanding of the desired behavior
and discover unknowns
Having conversations with domain experts
and using examples
to gain a shared understanding of the desired behavior
and discover unknowns
Given Nate purchased a shirt and the shirt cost $20
When he returns the shirtThen he should get $20 refunded
…Simply by getting the business users, the analysts, the testers and the developers to
adopt this vocabulary of “given/when/then”, they discover that a
world of ambiguity falls away.
-- Dan North
Given Nate purchased a shirt and the shirt cost $20
When he returns the shirtThen he should get $20 refunded
Given Nate purchased a shirt for $20and he does not have the receipt
When he returns the shirtThen he should be able to exchange the shirt for another shirt of the same kind
Given Nate purchased a shirt for $20and the shirt has a hole in it
and he does not have the receiptWhen he returns the shirt
Then he should be able to exchange the shirt for another shirt of the same kind
and the shirt should be processed as damaged
and the store inventory should be decremented
Given Nate has $20 in his savings accountWhen he navigates to the transfer screenand enters $20 into the transfer amount
text boxand clicks the transfer button
then the account balance should be $40
Don’t
Given Nate purchased a shirt and the shirt cost $20
When he returns the shirtThen he should get $20 refundedand the store inventory should be
incremented by 1
Don’t
Given Nate purchased a shirt and the shirt cost $20
When he returns the shirtThen he should get $20 refunded
Given the store as 10 shirts in inventoryWhen 1 shirt is returned
Then the inventory for that shirt should be 11
Do
Given Nate purchased a shirt on December 24th 2014
When he returns the shirt on April 28th 2015
Then he should be denied a refund
Given a shirt was purchasedwhen it is returned
and the purchase date is older than the allowed time frame
then it should not be refunded
Having conversations
is more important than capturing conversations
is more important than automating conversations
-- Liz Keogh
Resources
Dan North - http://dannorth.net/2011/01/31/whose-domain-is-it-anyway/Dan North - http://dannorth.net/whats-in-a-story/Dan North - http://dannorth.net/introducing-bdd/Liz Keogh - http://lizkeogh.com/behaviour-driven-development/Liz Keogh - http://www.slideshare.net/lunivore/behavior-driven-development-11754474Seb Rose - http://www.slideshare.net/sebrose/bdd-history-and-myths