why you want to practice bdd - idia computingidiacomputing.com/pub/why you want to practice...
TRANSCRIPT
WhyYouWanttoPrac.ceBehaviorDrivenDevelopment
EvenThoughYouMightNotKnowitYet!
GeorgeDinwiddie—@gdinwiddie
GeorgeDinwiddie—@gdinwiddie
What?
BDDis…
• Aprac.cethathasmanyfacets• Aprac.cethatiswidelymisunderstoodormisconceivedwithhalf-truths.
hDps://en.wikipedia.org/wiki/File:Blind_men_and_elephant3.jpg
GeorgeDinwiddie—@gdinwiddie
BDDis…• Aconversa)onabouthowyouwantthesystemtoact,illustratedwithexamples
• Amee)ngofthemindsamongthestakeholdersandimplementers
ThesestakeholdersandimplementersareoPencalledtheThreeAmigosbecausetheyinclude• Abusinessrepresenta.ve• Aprogrammer• Atester
GeorgeDinwiddie—@gdinwiddie
BDDOutcomes
• CommonUnderstanding• Automa.cVerifica.on• DurableDocumenta.on
CommonUnderstanding
Automa)cVerifica)on
DurableDocumenta)on
BDD
GeorgeDinwiddie—@gdinwiddie
Feature:~~~~~~~~~~~~~~~~~~~~~~~~~Scenario:~~~~~~Given~~~~~~When~~~~~~Then~~~~~~~
Itstartswithanidea
DeliberateDiscovery
BytheThreeAmigos
UsingExampleMapping
Ask:“Isthiswhatyoumeant?”
Detailscenariosfortheexamples
GeorgeDinwiddie—@gdinwiddie
ExecutableDescrip.on
Documenttheintent
Guardagainstregressions
Modifybehaviorinten)onally
Remember,asLizKeoghsays…
Havingconversa.ons
ismoreimportantthancapturingconversa.ons
ismoreimportantthan
automa.ngconversa.ons
GeorgeDinwiddie—@gdinwiddie
GeorgeDinwiddie—@gdinwiddie
Why?
You’reprogrammingandyoudiscoverthat
youdon’tknowhowthesystemshouldbehave
forsomesitua.on
GeorgeDinwiddie—@gdinwiddie
Planningmee.ngrunlongaspeoplediscuss
what’sinandwhat’snotinastorybeingconsidered
GeorgeDinwiddie—@gdinwiddie
You’reprogrammingandsomethingintherequirements
doesn’tmakesense
GeorgeDinwiddie—@gdinwiddie
You’reprogrammingandyoucaninterpret
somethingintherequirementstwoways,
butyoucan’tdoboth
GeorgeDinwiddie—@gdinwiddie
Youcodeafeatureandthetestersays
“That’snothowthisshouldwork!”
GeorgeDinwiddie—@gdinwiddie
Theprogrammerandtestergotalktothebusinessanalyst
tofindoutwhichoneisrightAndthey’reBOTHwrong.
GeorgeDinwiddie—@gdinwiddie
Youbuildsomefunc.onalityandthenfindoutthe
requirementswerewrong
GeorgeDinwiddie—@gdinwiddie
Yourrequirementsdocumentasksforfunc.onality
that’simpossibletocreate
GeorgeDinwiddie—@gdinwiddie
Someofthefunc.onalitythebusinesswanted
wasn’tspecifiedintherequirementsdocument
GeorgeDinwiddie—@gdinwiddie
You’retes.ngsomenewfunc.onality
withusersanddiscover
it’snotdoingwhatyouintendedtotest
GeorgeDinwiddie—@gdinwiddie
Finishedcodewashandedtotestersand
camebackforbugfixes
GeorgeDinwiddie—@gdinwiddie
Func.onalityyouwroteandcheckedthatitworked
isnowbroken
GeorgeDinwiddie—@gdinwiddie
Func.onalitythatwasdeliveredinapreviousreleasenowdoesn’twork
GeorgeDinwiddie—@gdinwiddie
Youupgradedalibraryorframeworkand
don’tknowwhateffectsthathasonyourapplica.on’sfunc.ons
GeorgeDinwiddie—@gdinwiddie
Tes.ngtakestoolongwhenyouneedtoshiparelease
GeorgeDinwiddie—@gdinwiddie
Youcan’ttellhowfaralongyouare
indevelopingthefunc.onalitythebusinesswants
GeorgeDinwiddie—@gdinwiddie
You’vefixedthesamebugmorethanonce
GeorgeDinwiddie—@gdinwiddie
You’veforgoDenhowafunc.onwriDenlastyear
works
GeorgeDinwiddie—@gdinwiddie
Thebusinessaskedyouwhatarethebusinessrules
foraspecificsitua.on
GeorgeDinwiddie—@gdinwiddie
Youthinkit’sgoingtobehard
togetstarteddoingBDD
GeorgeDinwiddie—@gdinwiddie
BasicBDDResources
• IntroducingBDD,byDanNorthhDp://dannorth.net/introducing-bdd/• Adescrip9onfrom2006ofthebeginningsand
essen9alsofBDD• ATDDvs.BDD,andapoDedhistoryofsome
relatedstuff,byLizKeoghhDp://lizkeogh.com/2011/06/27/atdd-vs-bdd-and-a-poDed-history-of-some-related-stuff/• BDDdescribedinthecontextofsomerelated
ideas
GeorgeDinwiddie—@gdinwiddie
GeorgeDinwiddie—@gdinwiddie
AvailableonLeanPubCodeonGitHub