Wednesday, August 11, 2010

“Pair Programming”

Pair programming is an agile software development technique in which two programmers work together at one work station.
• One types incode while the other reviews each line of code as it is typed in. The person typing is called the driver.
• The person reviewing the code is called the observer (or navigator) The two programmers switch roles frequently.
• While reviewing, the observer also considers the strategic direction of the work, coming up with ideas for improvements and likely future problems to address. This frees the driver to focus all of his or her attention on the "tactical" aspects of completing the current task, using the observer as a safety net and guide.

Key Points:

• Programmers working in pairs produce shorter programs, with better designs and fewer bugs, than programmers working alone.
• Studies have found reduction in defect rates of 15% to 50%, varying depending on programmer experience and task complexity.[
• Pairs typically consider more design alternatives than programmers working solo, and arrive at simpler, more-maintainable designs, as well as catch design defects early.
• Pairs usually complete work faster than one programmer assigned to the same task Pairs often find that seemingly "impossible" problems become easy or even quick, or at least possible, to solve when they work together.

Types of Pair Programming
Emote pair programming, also known as virtual pair programming or distributed pair programming, is pair programming where the two programmers are in different locations[19], working via a collaborative real-time editor, shared desktop, or a remote pair programming IDE plugin. Remote pairing introduces difficulties not present in face-to-face pairing, such as extra delays for coordination, depending more on "heavyweight" task-tracking tools instead of "lightweight" ones like index cards, and loss of non-verbal communication resulting in confusion and conflicts over such things as who "has the keyboard".[20]
Numerous tools, such as Eclipse plug-ins are available to support remote pairing. Some teams have tried VNC and RealVNC with each programmer using their own computer.[21][22][23]Others use the multi-display mode (-x) of the text-based GNU screen. Apple Inc. OSX has a built-in Screen Sharing application.
Ping pong pair programming
In ping pong pair programming, the observer writes a failing unit test, the driver modifies the code to pass the test, the observer writes a new unit test, and so on. This loop continues as long as the observer is able to write failing unit tests.[2

Why pair

• Higher quality code
• Faster cycle time
• Enhanced trust/teamwork
• Knowledge transfer
• Enhanced learning

Disadvantages

• Unavailability of partners
• Scheduling
• Experts/Skill Imbalances
• Concentration
• Disagreements
• Overconfidence
• Rushing
• Not for everyone

No comments:

Post a Comment