What to Expect from Pair Programming

April 30, 2014

When you hear the term pair programming, what thoughts come to mind? As a programmer, are you concerned that you won’t be able to concentrate? As a manager, does pair programming conjure up thoughts of paying two people to perform one job?

I certainly understand that knowledge workers such as programmers need concentration time. I just don’t believe (any more) that programming should be considered to be a solitary activity. Sure, we all need time to gets things clear in our own heads, and sometimes the best way to accomplish this is with a little quiet time. There are other times, however, when it is faster more productive to work with others.

I’m sure that you’ve had the same experience that I’ve had in working through a difficult problem, where the ability to talk through a problem with someone else, to share perspectives and bounce ideas off of one another yielded a much better outcome. And there are those times when the act of verbalizing a problem is all that you need to generate that little spark of insight. All in all, I’ve had plenty of times where I’ve been grateful that others were willing to collaborate with me in dealing with complex problems.

And that is what pair programming brings to the table. And it’s also why a manager shouldn’t walk around worried that he or she is losing productivity because programmers – or testers automating test code – are paired up. Knowledge workers aren’t a part of a typing pool. They are engaging their collective intellect on solving difficult problems.

What is the practice of pair programming? The classic definition of pair programming involves two programmers collaborating at one computer to develop software, using two distinct roles:

The Driver: The programmer who is actively writing code by typing it into the computer. The driver is tactically focused on the current code.

The Navigator: The programmer who observes the work of the driver, making notes on how to improve the code, considering what to work on next, or how the current code fits into the overall design.

Using this model the driver is free to work exclusively on creating rigorous code without worrying about the big picture, and the navigator is free to consider strategic issues without worrying about the immediate code that is being produced. A conversation precedes any driving and helps to synchronize the pair on the direction that the code as a whole is taking.

In practice, a more common approach is a highly collaborative session where two programmers are dealing with design and coding interchangeably. Programmers take turns at the keyboard, swapping roles, working closely together and talking the whole time. (Wray, 2010) I’ve seen this approach used much more often than the classic definition.

What if you have a manager who still dislikes pair programming because they can’t get past seeing two people doing the work of one? In that case, don’t call it pair programming. Call it a “meeting.” People of this ilk typically don’t think twice about filling up a day with business meetings and demanding that all of the real work still be accomplished, so stick to what they’re comfortable with.

What we’re looking for with pair programming is clear thinking to solve the problem at hand, and we want that clear thinking represented in well-designed, clean code. The design and expression of the code should allow for others to easily add to modify or add to it later.

In fact, part of what may be going on with pair programming is a discussion about how the code should be refactored – another good technical practice – in order to make room for a new feature being added. Instead of shoe-horning a new feature into the existing code and making the code more complex and more difficult to update in the future, good programmers who are given the time to properly manage the code base are striving to keep the code base clean through refactoring.

Note that I qualified the statement above with “given the time.” We can’t be agile in the future if the code base is allowed to become difficult and unwieldy because we are rushing to add new features today. Pair programming is one step that we need to take to support one of the principles of the Agile Manifesto: “Continuous attention to technical excellence and good design enhances agility.”

The key benefits of pair programming can be summarized as follows:
  1. To maintain or improve the overall quality of the code. This includes the design of the code as well as preventing defects from finding their way into the code in the first place.
  2. To increase productivity by reducing the time it takes to implement complex features.
  3. To broaden the understanding of the code base, helping to move towards collective code ownership.
I’m sure that as you consider pair programming as a practice, you can readily see how people working together can not only improve the design of the code, but prevent defects from finding their way into the code in the first place – mistakes are caught almost immediately. This immediacy leads into discussing why pair programming works well as an agile practice. It should sound familiar: feedback loops.

Pair programming provides programmers with feedback in real-time. This is the shortest feedback loop possible! With pair programming there is no need to schedule and wait for design and code reviews, they are done in the moment, without delay. Yes, there is an up-front cost that comes with pairing, but one study pegged this to be about a fifteen percent increase in development costs – with the corresponding reduction in defects more than offsetting this investment. (Cockburn & Williams, 2000)

Building on the productivity theme, another study found that pairs could complete complex assignments 40-50% more rapidly than their solitary counterparts. (Wlliams, Kessler, Cunningham, & Jeffeies, 2000) Having said that, make note that we’re talking about complex assignments. For simpler tasks, it can be more productive for programmers to work independently.

As programmers pair, you eliminate a common problem where programmers are highly specialized and knowledgeable in only one area of the code base. This specialization creates more than one problem.

While it is great for job security on an individual basis, the company is at risk should this individual leave the company. There is also the problem that in order to keep this individual “productive” in some cases – occupied might be a better word – you will need to create more work than is truly necessary. At other times this person can become a bottleneck because you can have more work than one person can possibly deliver on in the desired time frame.

There are some other benefits that emerge as side effects of pair programming. First, there is a little “pair pressure” that helps maintain coding standards. Another is that while some programmers are resistant to the concept of pair programming at first, many also find greater job satisfaction once they get some positive experiences under their belt.

On a more cautionary note, keep in mind that as an activity, pairing requires greater mental effort on the part of both individuals because they will naturally work at higher concentration levels. This means that people will be tired at the end of a work day, so keep another principle of the Agile Manifesto in mind: “Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely.”

In closing, my final advice is to keep pair programming differentiated from mentoring. Pair programming should involve individuals who are reasonably close in knowledge and skill. Mentoring is a different type of pairing activity geared towards transferring knowledge and experience, with a greater investment of time required of the individual transferring his or her knowledge and experience to someone else.


This post is a draft of content intended for an upcoming ebook: Agile Expectations: What to Expect from Agile Development, and Why. Blog posts will be organized under the “Agile Expectations” content on the left-hand side for easy reference. I welcome your comments and feedback! – Dave Moran

Bibliography
Cockburn, A., & Williams, L. (2000). The Cost and Benefits of Pair Programming. Proceedings of the First International Conference on Extreme Programming and Flexible Processes in Software Engineering (XP2000).

Wlliams, L., Kessler, R. R., Cunningham, W., & Jeffeies, R. (2000, July/August). Strengthening the Case for Pair Programming. IEEE Software.

Wray, S. (2010, January/February). How Pair Programming Really Works. IEEE Software.

131 comments

As we get older, your chances of suffering from high blood pressure and high cholesterol increases. Especially if emergence is triggered by stress, will further worsen your health. obat herbal darah tinggi dan kolesterol

February 18, 2016 at 9:31 PM

Love Games? But, don't wanna waste time downloading it? Why don't browse us and Play Best Online Games for Free.

Arcade Games, Action Games, Puzzle Games, Quiz Games, Girls Games, Kids Games, Sports Games, Mahjong Games, Card Games & Racing Games.

April 3, 2016 at 5:09 AM
Anonymous said...
Amlon Terence said...

Florida Personal Injury Attorney Sinclair Law - Leading Florida Law Firm Attorney Brad Sinclair Represents Personal Injury, Car Accident, Motorcycle Accident Victims in Melbourne.

June 8, 2016 at 3:42 AM
Euis Lisnawati said...

Obat Ayan Untuk Anak Obat Ayan Untuk Anak Dan Dewasa Ampuh, aman dan tanpa efek samping dengan QnC Jelly Gamat bisa Anda dapatkan dengan memesan kepada kami sekarang juga

June 18, 2016 at 1:50 AM
Euis Lisnawati said...

Obat Ayan Untuk Anak
Obat ayan untuk anak QnC Jelly Gamat merupakan produk obat herbal ternama dan paling unggul saat ini yang terbuat dari bahan herbal alami, terbukti aman dan tanpa efek samping. Obat Ayan Epilepsi QnC Jelly Gamat terbuat dari bahan-bahan herbal dan alami yang mengutamakan keunggulan ekstrak teripang emas/gamat emas asli Indonesia.

June 18, 2016 at 1:51 AM
Euis Lisnawati said...

Obat Bronkitis Kronis
Obat herbal untuk mengobati bronkitis kronis adalah dengan mengkonsumsi QnC Jelly Gamat sesuai aturan maka dalam jangka waktu yang efektif akan menyembuhkan penyakit bronkitis kronis Anda.

June 18, 2016 at 1:51 AM

The article you write is very helpful, thank you very much for helping me Slimming kapsul

June 18, 2016 at 4:40 AM
Elis Lisnawati said...

Bile is a fluid in the gallbladder that play a role in the digestion of fats. and if this liquid hardens then be formed into gallstones. 2016/05/31/gejala-awal-penyakit-batu-empedu

June 21, 2016 at 11:36 PM
BLOG BAHASA said...

Pair programming provides programmers with feedback in real-time. This is the shortest feedback loop possible! With pair programming there is no need to schedule and wait for design and code reviews

June 22, 2016 at 12:03 AM

The article you write is very helpful, thank you very much for helping me Pilose Antler Capsule

June 22, 2016 at 2:28 AM

The size of your success is determined by how strong your desire, determined by how much of your dreams, and is determined by your skill in overcoming the disappointment you experienced
cara mudah menjaga kesehatan tulang.
Macam-Macam Penyakit Menular
Nutrisi Penting Untuk Kesehayan Tulang
gejala dan penanganan penyakit hepatitis.
obat penghilang nyeri sendi.
obat radang sendi.
obat sakit persendian.

June 27, 2016 at 11:46 PM

The article you write is very helpful, thank you very much for helping me QnC Jelly Gamat Tasik

June 28, 2016 at 12:39 AM

Dengue is caused by the mosquito Aedes aegypti. Dengue is a disease that can threaten many lives according severity. Therefore, it is terrible. For those of you who have never felt the pain of joint pain due to dengue virus infection, always keep your house clean and continue to take steps to prevent mosquito breeding and nesting in the house. Dengue

June 28, 2016 at 4:49 AM

Not only for digestion and bowel movement, but the papaya fruit store thousands of other benefits. Seribu Manfaat

June 28, 2016 at 9:06 PM

Women need to suspect when it should not experience vaginal discharge, but instead whiteness. Whitish also can be caused by dietary factors. Keputihan

June 29, 2016 at 12:18 AM

Ovarian cancer is cancer that grows in the ovary or ovaries of the call itself. Among other types of cancer most common, ovarian cancer occupying a position to the 7th. The disease can attack the to all women of all ages. However, most ovarian cancer is in women who have undergone menopause or are generally aged 50 years and over. Kanker Ovarium

June 29, 2016 at 2:06 AM

Bleeding is a common name used to describe the loss of blood. It can refer to the loss of blood in the body (internal bleeding) or loss of blood outside the body (external bleeding). Pendarahan

June 29, 2016 at 3:00 AM

What's acne? Surely among teens, said acne is not foreign. Yes, acne is very disturbing once it is therefore necessary to eliminate it.More info refer to the article on this one Jerawat

June 29, 2016 at 3:48 AM

Slimming body according to blood type diet is one that is popular among the modern society as it is today, not a few who recognize that the slimming program appropriate blood type is very effective for the rules regardless. More info read in articles Meal Body Slimming accordance Blood Menu Makan Melangsingkan Tubuh Sesuai Golongan Darah

June 29, 2016 at 4:58 AM

With thighs were too big to be very annoying and reduce the confidence of the person. Here are tips to eliminate fat thighs. Tips Menghilangkan Lemak Pada Bagian Paha

June 29, 2016 at 9:15 PM

Benefits for slimming lemon lime which can help gastric emptying as lemon contains non-starch polysaccharides known as dietary fiber. Meal, lime can maintain satiety longer and lowering cholesterol levels in the blood. Manfaat dan Cara Membuat Jus Jeruk Nipis untuk Melangsingkan Tubuh

June 29, 2016 at 10:00 PM

By choosing a healthy breakfast menu and practical, you'll get a healthy body and can be slimming if you do it the right way. Sarapan Pagi untuk Melangsingkan Tubuh

June 29, 2016 at 10:48 PM

You can do some exercise to restore your posture to the ideal, or slimming your body right now. Try to do some kinds of sports such as in one of my articles this time. Olahraga untuk Melangsingkan Tubuh

June 30, 2016 at 2:25 AM

Banana fruit is certainly not one that is familiar to us. Bananas are very easily be encountered and we get, as in traditional markets and in the yard of the house residents. Bananas also has many kinds in our country. One of them is the banana is one of the benefits for slimming. Pisang ambon untuk Melangsingkan Tubuh

June 30, 2016 at 11:24 PM

The so-called slimming with apples which consumes only apples for a few days and fasting eat other foods. And for those of you who want to start slimming program for the first time, then slimming with apples could be an option as it can cleanse the internal organs well. Melangsingkan Tubuh dengan Buah Apel

July 1, 2016 at 2:33 AM
Ali Reade said...

All is educational, if you think “write my essay” it’s educational. I will say you don’t have experience on about this topic.

July 10, 2016 at 1:05 PM

Streamline the body during the week can be done by anyone. Indeed, this way is not easy and it takes perseverance and consistent in the run, but if you want to try to streamline the body in a week is not impossible to achieve. Melangsingkan Tubuh Selama Seminggu

July 11, 2016 at 3:26 AM

In general, a woman who has given birth have a desire to return to its original shape posture. Because usually form the abdomen, hips and surrounding areas will be enlarged postpartum. However, the thing to remember is do not go on a diet or exercise as soon as possible after birth. Give time for your body to restore its condition first. Natural way and without side effects, it is very effective to process refund your posture. Tips Sehat Melangsingkan Tubuh Pasca Melahirkan Agar Tetap Tampil Ideal

July 11, 2016 at 4:26 AM

Stroke is a condition whereby when the blood supply to the brain is cut off due to the rupture of blood vessels, resulting in the death of cells in some areas of the brain. When the blood supply that carries oxygen and nutrients to the brain is cut off or broken, then the brain cells start to die. That is why the sooner patients are handled and damages tend to be smaller and even death could have been avoided. Penyakit Stroke
Gejala Stroke
Pengobatan Stroke
Penyebab Stroke

July 12, 2016 at 12:38 AM

Ginkgo Biloba has a long history of use in traditional medicine to treat blood disorders and enhance memory, and it is known as the most likely way to keep your memory to stay sharp. There is some scientific evidence that has been proven to support it. Laboratory research has shown that Ginkgo Biloba can improve blood circulation by opening blood vessels. Ginkgo Biloba Capsule

July 12, 2016 at 3:19 AM

Cancer is not a single disease, but consists of several kinds of diseases as a result of the malignant cells. There are 28 types of cancer that you should know and treatment. 28 Macam Kanker dan Pengobatannya

July 15, 2016 at 2:10 AM

Your article is very helpful. Please also visit my post about the types of acne and how to naturally remove acne.
What's acne? Surely among adolescents, said acne is not foreign. Yes, acne is very disturbing. Therefore, it is necessary to eliminate it. Jenis-jenis Jerawat dan Cara Alami Menghilangkan Jerawat

July 16, 2016 at 12:19 AM

Never despair when faced with difficulties, because every drop of rain that comes clear out of a dark cloud.
Obat Kolesterol Tradisional
.

July 17, 2016 at 9:39 PM

Hull is one of the sectors of the digestive organs of the body and has a hollow muscular organ and has two holes absolute, namely: One hole in the shape of the entrance of the esophagus and other holes, namely a door out to the small intestine. More info about: rising stomach acid, causing stomach acid is high, and the characteristics of gastric acid diseases visit my posting. Gejala Asam Lambung Tinggi

August 2, 2016 at 10:04 PM
Amlon Terence said...

Accident Attorney Cocoa Beach Sinclair Law - Leading Florida Law Firm Attorney Brad Sinclair Represents Personal Injury, Car Accident, Motorcycle Accident Victims in Melbourne, Palm Bay, Cocoa Beach, Titusville, Rockledge, Merritt Island, Cape Canaveral and Brevard County.

August 5, 2016 at 7:04 AM

Obat Herbal Kista Bartholin Tanpa Operasi

Khawatir Kista Bartholin semakin membesar?

Takut operasi atau tidak memiliki uang yang cukup untuk operasi?

Jangan khawatir!

Kini hadir Obat Herbal Kista Bartholin Tanpa Operasi yang benar-benar ampuh..

Obat Herbal Kista Bartholin Tanpa Operasi

Produk Masker Spirulina Terbaik

August 19, 2016 at 12:19 AM

Kalian sok halusinasi teu mun keur nungguan loading, terus lila cicing di tengah, tetempoan maju saeutik2, tapi henteu. Bagong yah? :(
obat gerd paling ampuh

August 19, 2016 at 3:43 AM
Elis Lisnawati said...

QNC Jelly Gamat able to treat bronchitis in children is safe and without side effects, QNC jelly gamat give herbal treatment for children suffering from bronchitis.Obat Herbal Bronkitis Pada Anak

August 26, 2016 at 9:46 PM
Elis Lisnawati said...

Constipation and bowel movements are hard BAB irregular and difficult, stomach feel uncomfortable and even BAB accompanied by blood.Obat Sembelit dan BAB Keras

August 31, 2016 at 3:19 AM
Elis Lisnawati said...

Eye Care Softgel is the best eye herbal medicinal products world class. Eye Care Safe softgel consumed by children, adults or the elderly because it uses natural ingredients. Obat Herbal Mata Kering

September 2, 2016 at 3:25 AM
Elis Lisnawati said...

Inadequate intake of foods containing fiber, prolonged sitting, heavy lifting or straining during defecation is a factor that can cause hemorrhoid disease. Khasiat daun sirih merah

September 7, 2016 at 2:10 AM
Elis Lisnawati said...

Diseases Epilepsy is a chronic neurological disease that causes seizures periodically. Seizures will occur when the electrical impulses in the brain blast past the normal limit. Obat Epilepsi Anak

September 7, 2016 at 8:31 PM
Elis Lisnawati said...

One solution to launch BAB is by eating high-fiber foods such as fruits and vegetables. 5 Jenis Buah Melancarkan BAB

September 8, 2016 at 3:33 AM
Elis Lisnawati said...

Hemorrhoids are swellings that occur on the lips anus. If the already severe swelling can menimbuklan bleeding, and if this continues konsidi hemorrhoid sufferers will be a lot of blood loss that can lead to anemia.
Mengobati Wasir dengan Bawang Putih

September 9, 2016 at 10:56 PM
Elis Lisnawati said...

Chitosan Plus Capsule has many benefits and rewards that can be used for your health and your family. 100% made from natural without side effects, and be an excellent product that is very good for health.
Obat Herbal Kanker

September 14, 2016 at 3:40 AM
Elis Lisnawati said...

Piles or hemorrhoids is one type of disease that is often experienced by many people. There are several ways to avoid hemorrhoid or hemorrhoids.

9 Jenis sayuran untuk ambeien
3 jenis olahraga menghindari ambeien

September 18, 2016 at 8:38 PM
Elis Lisnawati said...

Constipation is often considered mediocre, but if allowed to continue will cause a negative effect on health, including cancer-causing.
Makanan pemicu sembelit
Mengatasi sembelit

September 19, 2016 at 12:27 AM
Gilbas Baba said...

Obat Hipertensi Bisa Menyebabkan Ginjal Rusak

Obat Hipertensi Bisa Menyebabkan Ginjal Rusak, karena penderita hipertensi diharuskan mengkonsumsi obat hipertensi terlebih jika obat yang mereka makan setiap harinya merupakan obat yang mengandung bahan kimia

September 28, 2016 at 9:50 PM
Gilbas Baba said...

Obat Hipertensi Bisa Menyebabkan Ginjal Rusak

Obat Hipertensi Bisa Menyebabkan Ginjal Rusak, karena penderita hipertensi diharuskan mengkonsumsi obat hipertensi terlebih jika obat yang mereka makan setiap harinya merupakan obat yang mengandung bahan kimia

September 28, 2016 at 11:12 PM
zayn malik said...

This is to inform you that ISL Live Streaming is going on in HD Quality . You way watch here.
www.indiansuperleaguelive.org
indiansuperleaguelive.org

October 8, 2016 at 9:56 AM
Anonymous said...

Hemorrhoids / piles in The English called the Hemorrhoid is a state where the bearing anus decline caused by many things, these bearings consists of mucosa, smooth muscle jarinag anus, loose connective tissue and vascular tissue. Tips Mengatasi Wasir
Pengobatan Wasir

October 13, 2016 at 10:50 PM
Elis Lisnawati said...

You're looking for blepharitis Eye medicine? Now it is already present blepharitis Herbal Medicine Eye Eye Care softgel. Obat Mata

October 28, 2016 at 2:29 AM
Elis Lisnawati said...

You're looking for presbiopi Eye medicine? Now it is already present presbiopi Herbal Medicine Eye Eye Care softgel. Obat Presbiopi

October 28, 2016 at 11:50 PM
Elis Lisnawati said...

You're looking for pterygium Eye medicine? Now it is already present pterygium Herbal Medicine Eye Eye Care softgel. Obat Pterygium

November 4, 2016 at 9:27 PM
Elis Lisnawati said...

You're looking for Retinoblastoma Eye medicine? Now it is already present Retinoblastoma Herbal Medicine Eye Eye Care softgel. Obat Retinoblastoma

November 10, 2016 at 10:43 PM

Post a Comment