Get certified - Transform your world of work today

Doing Agile with Pairing

07/11/2012 by Prashant Kumar

One of the most important and commonly ignored practices of Agile is pair programming. Under the exciting cloud of planning, Scrums, sprints, backlogs, and demos, organizations tend to ignore the importance of the pair-programming principle.

Pair programming is one of the 12 Extreme Programming (XP) Agile framework principles. The main purpose behind this technique is to produce high-quality artifacts. In pair programming, two people work collaboratively on the same task on a single computer. This encourages better communication, better clarification of the problem, and better understanding of its solution. The person who controls the mouse and keyboard is called the "driver." The other person, who sits beside the driver and makes sure that solution is implemented in an effective and efficient manner, is called the "navigator." The members of the pair can switch with other members within the team to take on a different task in another iteration.

This technique helps avoid the situation of a developer seeing his or her own code after a few months or years and wondering what was in their mind while writing that piece of code. It could have been written so much better! An alert and active navigator can point out the flaws while the driver is writing the piece of code. This collaboration leads to cleaner design and implementation, and this use of resources for a common task results in a higher-quality product with fewer defects.


Pair-programming benefits

  • No separate code reviews required
  • Better code quality
  • Effective communication
  • Higher team spirit
  • Better coding practice adherence
  • Less dependence on particular individuals
  • More effective inclusion of new team members
  • Greater knowledge sharing among members

Pair programming eliminates the need for separate code reviews and thus helps produce higher-quality code. By avoiding rework in subsequent iterations, the time to market is tremendously reduced.

Closer communication encourages highly bonded teams, who share tasks among themselves rather than assigning them to a specific member.

Better communication and shared responsibility bring trust and create an environment with I and me replaced by us. Completion of tasks or stories becomes a shared responsibility, and thus a reason for team success rather individual success. Members share required knowledge and everything they gained during a story execution, thus creating a broader knowledge base within the team.

Pair programming also leads to better adherence to the organization's coding practices, as either member of the pair can identify and correct any breach of a coding guideline or standard best practice that might otherwise be missed. This practice also helps establish a creative environment and promotes better design principles based on the shared knowledge and experience of the paired members.

In my experience with teams using pair programming, team bonding, accountability, work ownership, product knowledge, and quality was always high. The team dynamics and overall product quality appeared to show high maturity levels. In some cases, we paired new members of the team with existing members; the knowledge-sharing process was effective and enabled the new team members to contribute more quickly and effectively toward product improvement. Pair programming was extremely useful in enabling both teams and organizations to provide business value to end users more quickly and efficiently.

Pair programming is part of the essence of the Agile mind-set, and I recommend its use whenever possible in Agile projects.

Let's go, pair up!