Fundamentals of Software Development 1Slide 1 Pair Programming: What is it? What is it?What is it? Two programmers working side-by-side, collaborating on the same design, algorithm, code or testTwo programmers working side-by-side, collaborating on the same design, algorithm, code or test –One programmer, the driver, has control of the keyboard/mouse and actively implements the program –The other programmer, the observer, continuously observes the work of the driver to identify tactical (syntactic, spelling, etc.) defects and also thinks strategically about the direction of the work –On demand, the two programmers can brainstorm any challenging problem –Because the two programmers periodically switch roles, they work together as equals to develop software -- Laurie Williams, North Carolina State University Computer Science
Fundamentals of Software Development 1Slide 2 Pair Programming: Why do it? You learn faster when a partner is helping double checkYou learn faster when a partner is helping double check –Two sets of eyes are more likely to notice errors than one set You learn better whenYou learn better when –a partner is helping you understand –you are challenging your partner to master the material Pair programming is a real-life technique, part of the disciplined methods called Extreme ProgrammingPair programming is a real-life technique, part of the disciplined methods called Extreme ProgrammingExtreme ProgrammingExtreme Programming –One study: One studyOne study Paired programmers are only 15% slower than two independent individual programmersPaired programmers are only 15% slower than two independent individual programmers But produce 15% fewer bugsBut produce 15% fewer bugs –Since testing and debugging are often many times more costly than initial programming, this is an impressive result
Fundamentals of Software Development 1Slide 3 Challenges of Pair Programming What are some problems that partners (let's call them Ye and Seema) may experience?What are some problems that partners (let's call them Ye and Seema) may experience? –Seema dominates the project and does not let Ye do half the work –Seema decides that Ye cannot write code and so assigns everything else besides the code to him –Ye is passive and plays a "keep the other person company" role –Ye misses class without alerting Seema or the professor –Seema is unavailable outside of class –Seema believes that Ye's performance will hurt Seema’s grade
Fundamentals of Software Development 1Slide 4 Do’s of Pair Programing Both partners sit behind a single computerBoth partners sit behind a single computer –Exception: Use the second computer effectively for reading the instructions and responding However, both partners must be looking at the same computer screen at any given timeHowever, both partners must be looking at the same computer screen at any given time Share the typing dutiesShare the typing duties –Both partners think! Both partners solve the problem! When not typing, validate what your partner should be typingWhen not typing, validate what your partner should be typing Both partners: understand each step completely before continuingBoth partners: understand each step completely before continuing It is:It is: –good to take time to teach your partner some things –not good to spend the entire session teaching your partner Try to choose a partner with similar skill and comfort-levelTry to choose a partner with similar skill and comfort-level
Fundamentals of Software Development 1Slide 5 Continuing work outside class When you are in class:When you are in class: –Identify and schedule (exact) times to meet face to face –Identify ways to contact your partner ( , phone, etc) Do not waste your partner's timeDo not waste your partner's time –Show up on time and stay focused for scheduled meetings –Do not work on the project without your partner Pair programming is not team programmingPair programming is not team programming You will do most of your projects using Pair Programming – we insist that you do it effectively!