7 § Best programs and designs are done in pairs because you can criticize each other, find each other’s errors, and use the best ideas. - Jean Bartik (one of the very first programmers) § Write all production programs with two people sitting at one machine. - Kent Beck (Agile, JUnit) Pair Programming
8 § The process starts with the developers receiving a well-defined task. § They agree on one small goal at a time. § They take turns to code or review each other's work. § Rotating roles regularly helps keep both developers alert and engaged. § Enable senior developers to share their knowledge and working habits § Help new team members get up to speed on a project. Process
9 § Driver (the person on the keyboard). Focused on completing the tiny goal at hand, ignoring larger issues for the moment. A driver should always talk through what they are doing while doing it. § Navigator (the person observing). They review the code on the go, gives directions, and shares thoughts. They have an eye on the larger issues, and bugs, and make notes of potential next steps or obstacles. They are in control of the strategic or architectural elements. As a navigator, leave the details of the coding to the driver – your job is to take a step back and complement the driver’s tactical mode with medium-term thinking. Roles
10 • Equally engaging pairs. If both developers do not equally engage in the project, then there is less chance that knowledge will be shared • Social and interactive process. It is hard for those who work better alone. Problem
12 • Consistent communication • Switch roles • Pair up carefully (select your pair). • A familiar development environment • Work at a pace that fits both developers. So, best practices
Winter 2023 Copyright. These slides can only be used as study material for the class CSC308 at Cal Poly. They cannot be distributed or used for another purpose.