PairProgramming&
MobProgrammingAnIntroduc3on
Theclassicway:thelonecoder• Coderscodeontheirown,inthezone,a
codewarriorontheedgeof3me.• Othercodersarenotawareofthecodethey
arewri3ng.• Ifthecodergetsstuckthentheymayspenda
long3metryingtosortoutanissue;theymaybeembarrassedtoaskforhelp.
• Itthereforehardtomaintainandmeasurecodequality,whichcanleadtoarequirementofcodereviews(oroughtto).
• Itcancausealackofteamownershipofcode,leadingto“well,Ididn’twritethis,so-and-sodid”.
• Knowledgesilosarecreatedwhenonlyonedeveloperknowsthecode.Ifapersonleaves,theytaketheirknowledgesilowiththem.
• Itmakesithardfornewcomerstotheteamtolearn.
PairProgramming• FromXP(eXtreme
Programming).• Partofthetechnical
implementa3onofAgile.• Two-developersworkon
thetasktogether.• Oneofthepaircanbreak
offtodosomethingelsethencomebacklater;Thisisespeciallyusefulduringanalysistasks.
Waystodoitphysically
• Co-locatedteams,sharingakeyboard,orwithtwokeyboards.
• RemotelyusingSkypesharingascreen.• RemotelyusingTeamViewer,orsimilarVNCproduct.
• Co-locatedteamsworkbestinmyexperience.• Butpairprogramminghelpskeepremoteworkersfromloosingfocusorslackingoff!
Waystodoit• Peopletakeitinturntodrive.• Thedriverhasthekeyboard,thepassengersitsontheirhands!
• Swapevery10to20minutes(15isgood).• Ifonepersonislessexperienced,thenitmaybegoodtoletthemdrivemore;mayhelpenhancetheknowledgetransfer.
• Forlongertasks,onepersonineachpaircanswap-offthetaskatthenextdayandanothercancomeontoit.Thenextday,theotherswaps-off.
Results–Benefits• Knowledgetransferbetweendevelopersiscon3nuous.
Makesiteasiertogetnewbiesuptospeed.• Greatersenseofteam-ownershipofcode.• Codequalitymosto_enimproves;bugsgodown.• Knowledgeisnot3edupinthemindofasinglecoder.• Problemsaresolvedfasterandmoreefficientlydueto
constantexchangeofideas.• Swapping-offandontotasksincreasesspreadofknowledge
inteam.• Itfeelsgood;there’smorehumaninterac3on,andpeople
o_enfeelmoreconfidentaboutthesolu3onstheycreate.
Results-Downsides• Itcanbehardtojus3fytomanagement–asitseemslikeusing
twiceasmanyresourcestoachievethesamegoal.• There’snotalotofevidenceouttheretosupportit;noprecy
graphstoshowmanagement.• Ifyourtestsuitetakesagestorun,thenitcanseemlikequitea
wasteof3metodopairtestrunnerwatching.• However,youcanmeasureinyourteamusingcycle3me,burn
downrate,andnumberofbugsfromreleasedcode.• Ihaveexperiencedsomedeveloperswhofoundit3ringtopairall
the3me;encouragesomebreakingoff,ormoreswapping.• Ihavealsoexperiencedapairwhoconspiredtodoillasneither
wereconvincedwithAgileprinciples.Oncenotedwecouldensuretheyrarelypairedtogetherandfrequentlyswapped.AlsoseeMobProgramming….
MobProgramming• DefinedbyMosesHohmanand
AndrewSlocumin“ExtremeProgrammingPerspec;ves”(2003)
• RecentlypopularisedbyWoodyZuillin“MobProgramming:AWholeTeamApproach”(2014).
• Everyonesharesasinglekeyboard!• Developerstakeitinturnstodrive.• Varia3on:thedrivercan’tcontribute• Co-loca3onisprecymuchamust.• Developers(andPOs,etc)areableto
dropinandoutfreely.
Let’swatchavideofromWoodyZuill
Results• Totalteam-ownershipofcode.Abilitytosay“wedidthis,wedecidedthat”withconvic3on.
• Enhancedcodequality,far,farfewerbugs.• Knowledgetransfertoallteammembers(toatleastsomedegree).
• Canhelpiden3fyknowledgesilos.• Inmyexperienceitdoesn’tactuallyslowateamdown,remarkably.Anyslowdowncanbejus3fiedbyresul3ngcodequality.
• Eliminatesconspiracies-to-do-bad;well,ifthewholeteamagreestotheconspiracy,thenyou’reprecymuchsunk!
Mobprogramming-downsides
• Whateveryoudo,don’ttelltheFD!(atleastnotun3lyouhaveproofitworks).
• Remoteworkersarehardtointegrate.• Notthatgoodforinves3ga3onandanalysis.• Notthatgoodfordevops/sysadmintasks;pairingworksbecerforthis.
• Willmostlikelyini3allyaffectyourthroughputasitreducesyourteam’sWIPlimittoone.
Andnotjustprogramming…
• Analysis• Backloggrooming• Tes3ng• Systemsadministra3on/DevOps• Repor3ng• Diggingholesintheroad(mobdigginghasbeenusedforthisformanyyearsalready).
Andremembertoalso…• Keepthestoriesshort.• Focusonthewhat,whyand
forwhom,notthehow.• Dotest-driven
development.• WriteCLEANcode.• Usedesignpacerns.• Refactoro_en.• Nurturerespectamongst
yourteammembers.• Sitonyourhandsifyou
can’tkeepthemoffthekeyboard.
Thankyou.07811671893
hcp://leanbytes.co.ukhcps://mbharris.co.uk
hcp://uk.linkedin.com/in/mbharrishcps://github.com/mikebharris/