Pair Programming - Be the best pair you can be.

Download Pair Programming - Be the best pair you can be.

Post on 15-Jul-2015

79 views

Category:

Software

2 download

TRANSCRIPT

Pair ProgrammingBe The Best Pair You Can Be!David Morgantinidavidmorgantini.blogspot.co.uk dmorgantini@gmail.comWho Am I?David MorgantiniIndependent consultantPreviously worked for:ThoughtWorksGovernment Digital ServicesPaid to write code for 9 yearsFocus on Tech Leadership, Agile Coaching & pragmatic deliveryWhy are we here?In ScopeBetter understanding of the practice of pair programmingConcrete tips on how to be more effective while pair programmingOut of scopeA discussion on whether pairing is a good practiceTips on how to convince your team to try/use pair programmingAn overview of all the research on pair programming OverviewSome DefinitionsPairing patternsIntended benefitsAvoiding disengagementSome DefinitionsCommon DefinitionLets solve this problem!Ok!More definitionsLets use the bits class to get some bobsThat sounds good.DriverNavigatorPairing SessionDisengagementI am such a good developer!I havent a clue whats going on. Whats for dinner?Players in a pairing sessionIve worked on the milking functionality before.ExpertNoviceGlad he knows this code, Ive never seen it before.Players in a pairing sessionBut Ive never had to work the DevOps*ExpertNovice* DevOps is not a thingAh I know all about the DevOps*!Players in a pairing sessionBut Ive never had to work the DevOps*NoviceExpert* DevOps is not a thingAh I know all about the DevOps*!Pairing PatternsThere can only be one and we add an implementation here You missed a semi-colon.There can only be oneJerk. Keeps hogging the keyboard. And my neck hurts. and now watch as I type these seven new classes Two keyboards let me explain by driving for a bit!Ah, now I understand what youre trying to say!Two keyboardsSTOP TYPING DAMNIT!WE DO THIS!A LaptopI dont understand, I cant see. Pair programming is stupid. the gubbins go with the bits and bobsMirrored laptopI still dont understand but at least now I can see! Pair programming rocks! and then we connect the bobs to the ESB via the night service Dual station Youll be able to connect to the gubbins! We ROCK! so youre saying if I catch the night service at line 135 Dual stationThere is a problem there!La la la, looking at my monitor, dont know what youre talking aboutBenefits of pairingWhat does the research say?Based on bug count, pairing is equivalent to solo programming.Pair Programming makes a major positive difference.Pair programmingis a hindrance. Dont use it.What does the research say?Pairing has been shown to cost more with few benefits and cost less with loads of benefits.Why??24I would be more interested in looking at the patterns of interactions that can lead to the benefits or how they are lost.Pair vacation taking is AWESOME!What does the research say?Pairing has been shown to cost more with few benefits and cost less with loads of benefits.Why??25Intended benefits of pairingEconomicsDesign qualityDeveloper satisfactionLearning/Knowledge transferTeam building and communicationEconomics create loads of gubbins! use the gubbin factory to Two people doing one persons work!?Yep! Fewer bugs & better design should lead to lower long term costs!Laurie Williams of theUniversity of Utahin Salt Lake City has shown that paired programmers are 15% slower than two independent individual programmers, while "error-free" code increased from 70% to 85%. Since testing and debugging are often many times more costly than initial programming, this is an impressive result.[6]Pairs typically consider more design alternatives than programmers working alone, and arrive at simpler, more maintainable designs; they also catch design defects early.[7]27QualityBut how do we connect the gubbins without one?Maybe an ESB is a bad idea?Excellent, keep up the good work!No new bugs to report, sir!Two developers will bringDifferent view points to the problemDifferent methods to find information relevant to the problemA larger number of differing solutions than a single developerTherefore, are less likely to select a poor solution28Developer satisfactionOk, no ESB. Lets use a light-weight message queue insteadGreat idea! Today was AWESOME!WE ROCK!HIGH FIVEDevelopers are happier when they are confident in their solutionsDevelopers are more confident in their solutions when pairingDevelopers are happier when pairing29Learning/Knowledge sharingI know this code! I paired with Jill!Good thing we pair cause I dont know what a gubbin is!Constant knowledge sharing between developers in a pairEach developer on a team pairs with all other developer which helps to break down knowledge silosInstant feedback on coding style and techniques2 things team knowledge sharing 1- Personal learning30CommunicationThis would be a pain if we had to use an antiquated communication method.I hear ya!. E-mail is so 2005.Developers share problems with each otherLess likely to have hidden agendasCommunication flow is increased within the teaCommon code ownership31WE ARE BUILDING BETTER SOFTWARE!WE ARE BUILDING BETTER SOFTWARE!WE ARE BUILDING BETTER SOFTWARE!WE ARE BUILDING BETTER SOFTWARE!WE ARE BUILDING BETTER SOFTWARE!Systemic BenefitsThese benefits are systemicThey are not useful in judging a given pairing sessionThere is a degree of faith you have to put into the practice32Avoiding DisengagementDisengagementI am such a good developer!I havent a clue whats going on. Whats for dinner?BADMutually agreed disengagement and while you do that Im going to refactor the gubbin factory.GOODIm going to connect up the message queueExpert-Novice*whistling*ExpertNoviceIm so confused Have the highest incidence of bad disengagementBoth members of the pair need to be mindful of disengagement36Expert-NoviceDo you understand?ExpertNoviceNo. Can you please explain more?Pay attention to your pairUnderstand the context of the pairing sessionLearningCompleting the work quickly37Reasons for disengagementType of workUnfamiliar working environmentInterruptionsTime pressureSocial pressureType of workI dont think that this work needs a pair.Ya. Im not really able to effectively contributeNot all work needs a pairOr, more accurately, not all work is most effective in a pair:Diagnosing some bugsSimple UI fixesResearchSome parts of most stories39SuggestionsConsider tiny taskingBreak up the pairAsk yourself if the work needs a pairExpert: Ensure the novice is drivingUncomfortable dev environmentI love EMACS!1!Um I cant use this insane text editorDriving helps ensure engagementAn uncomfortable work environment leads to not drivingErgo, the more comfortable you are to drive, the more likely you are to stay engaged41SuggestionsMake each pair feel at homeDual monitors/keyboard etcTeam IDE standardizationExpert: Take the comfort hit if the goal is learningInterruptionsHa ha! Free from the old ball and chain! When the cats away, the ESB returns!Sorry, I forgot.You didnt put a new cover sheet on your TPS report!Double edged swordIts very easy to lose track of progress if one member of the pair is interruptedLosing track of progress leads to bad disengagement43Interruptions and then remember to add one to combat the naming problems I dont know whats going on anymoreDouble edged swordIts very easy to lose track of progress if one member of the pair is interruptedLosing track of progress leads to bad disengagement44SuggestionsTry not to disrupt an in progress sessionComplete any in progress discussion before acknowledging interruptionPlan for longer interruptionsRe-establish mutual context when interruption is completeTime pressureI feel the need the need for speed.ExpertNoviceOMG. I lost him 25 minutes ago.Mostly an issue in Expert-Novice constellationsThe expert will want to move faster than the novice is capable of keeping up46SuggestionsPlan novice pairing time into estimationExpert: Verbalize progress and ask for feedbackSocial pressure and finally, once we have connected the message queueI dont understand. But I dont want to look stupid by asking a questionIts hard to pair with experienced peopleDont want to seem stupidDont want to slow the pair downLess likely to ask questions required to stay engaged48SuggestionsExpert: Give novice partner some time to consider solutions alone before development startsNovice: Stop your partner when you dont know whats going onExpert: Encourage your partner to driveEstablish mutual context before starting developmentThank You!What an interesting group of research subjects.So did you learn anything today?I was busy playing candy crush.He made 5 mistakes!!!!GET BACK TO WORK! I DONT PAY YOU TO SIT AROUND AND TALK!

Recommended

View more >