ݺߣ

ݺߣShare a Scribd company logo
Intro.toBDD
(BehaviorDrivenDevelopment)
WhatisBDD?
BDDisasecond-generation,outside-in,pull-based,multiple-stakeholder,multiple-scale,
high-automation,agilemethodology.Itdescribesacycleofinteractionswithwell-defined
outputs,resultinginthedeliveryofworking,testedsoftwarethatmatters.
--DANNORTH
(CREATOROFJBEHAVETESTFRAMEWORKANDMANYBDDCONCEPTS)
WhatisBDD?
BDDisasecond-generation,outside-in,pull-based,multiple-stakeholder,multiple-scale,
high-automation,agilemethodology.Itdescribesacycleofinteractionswithwell-defined
outputs,resultinginthedeliveryofworking,testedsoftwarethatmatters.
--DANNORTH
(CREATOROFJBEHAVETESTFRAMEWORKANDMANYBDDCONCEPTS)
WhatBDDISNOT?
TESTFRAMEWORK
AUTOMATION
CUCUMBER
GHERKINSYNTAX
TheonlywaytoTest
WhatBDDISNOT?
TESTFRAMEWORK
AUTOMATION
CUCUMBER
GHERKINSYNTAX
TheonlywaytoTest
BEHAVIORDRIVENDEVELOPMENT
BDDisaboutDEVELOPMENT
NotCODING
THEDEVELOPMENTPROCESS
1. Customerwantsafeature.
2. Definethefeature.
3. Buildthefeature.
4. TesttheFeature.
TAUTOLOGICALDEFINITIONOFBDD
BDDis
Anagileprocess
ForDescribingBEHAVIORS
ThatDRIVEStheway
SoftwareisDEVELOPED.
WT?
Itsawaytowriterequirements
Thatcanbeunderstoodbyeveryone (SEEDOMAINDRIVENDESIGN,byERICEVANS-norelation)
AndExecutedDirectly.
ITsEXECUTABLEDOCUMENTATION.
BDD&TDD
BEHAVIORDRIVENDEVELOPMENT
CamefromTESTDRIVENDEVELOPMENT. (SEEEXTREMEPROGRAMMINGEXPLAINEDbyKENTBECK -alsono
relation)
ITREcognizesthat CommunicatingwithNon-ProgrammersisIMPORTANT
ButthatDOCUMENTATIONcanbecomeoutdated
WHYDOBDD
(multiplechoiceQuiz)
A. Managementsaysso.
B. Itmakestestingeasier.
C. TocommunicateBETTER.
D. ALLoftheAbove.
TWO(main)STYLESOFBDD
CUCUMBER
GIVEN/WHEN/THEN
MOREDETAILED
MOREORGANIZED
MORERIGID
DOCSINDEPENDENTOFCODE
SPEC
DESCRIBE/ITSHOULD
MORECONCISE
LESSSTRUCTURE
MOREFREEFORM
DOCSGENERATEDBYCODE
CUCUMBER
(1of3)Feature:[TITLE]
Asa[ROLE]
Iwant[FEATURE]
SOTHAT[BENEFIT]
Focusonthereasonfordevelopingafeature.
CUCUMBER
(2of3)SCENARIO:[DESCRIPTION]
GIVEN[INITIALCONTEXT]
WHEN[ACTION]
THEN[EXPECTEDRESULT]
Describeeachscenariowithpreconditions,steps,andexpectedresults.
CUCUMBER
(3of3)EXAMPLES:
Provideconcreteexamples.
USER PASSWORD COMMAND MESSAGE
aaron SECRET Openpodbaydoors ACCESSDENIED
dave DAISY Openpodbaydoors ImSORRYDAVE,ImafraidIcantdothat
SPEC(RSPEC,MOCHA)
DESCRIBE([FEATURE])
It([BEHAVIOR])
...implementation
Documentation&implementationlivetogether
WHENTOUSECUCUMBER/GHERKIN
Typicallyusedforuserstorieswhereproductownerisinvolved
andshouldwrite,(oratleastapproveof),theSPEC.
Thespecisamechanism forcommunication,notawaytodictatefeatures.
WHENTOUSEMOCHA/RSPEC
Typicallyusedfordeveloperorientedtests.
DOcumentationisgeneratedfromcode.
Goodforreportingcoverage,butnotsomuchforcollaboration.
Thespecisusedprimarily forgenerating DOCUMENTATION.
THEEND
Thanks.
Aaron.evans@hart.com
https://linkedin.com/in/aaronevans
@fijiaaron

More Related Content

Intro. to BDD