0% found this document useful (0 votes)
12 views36 pages

Pair Programming

Uploaded by

toshitgaba11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views36 pages

Pair Programming

Uploaded by

toshitgaba11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Pair Programming

By Hanchao Wu
Outline

� What is Pair Programming


� History
� Motivation
� Techniques
� Why it works
� Poblems
� Challenges
� When it is not working
� Conclusion

Page � 2
What is Pair Programming

� Two programmers code together


at one workstatition
� Driver types codes, and observer
review and critques it.
� Two switch roles periodically
� Note pair programming is not
mentoring, even if one is
significantly more experienced

Page � 3
Outline

� What is Pair Programming


� History
� Motivation
� Techniques
� Why it works
� Poblems
� Challenges
� When it is not working
� Conclusion

Page � 4
History 1

� People have started pair programming long before it is


called so.
� Fred Brooks announced "Fellow graduate student Bill
Wright and I first tried pair programming when I was a
grad student (1953-1956). We produced 1500 lines of
defect-free code; it ran correctly first try."
� In the early 1980s, Larry Constantine reported observing
"Dynamic Duos", producing code fater and more bug
free.

Page � 5
History 2

� In 1998, Temple University professor John Nosek was


the first to run an empirical study on the efficacy of pair
programmers.
� In the late 1990s/early 2000s, pair programming practice
is brought to forefront

Page � 6
Outline

� What is Pair Programming


� History
� Motivation
� Techniques
� Why it works
� Poblems
� Challenges
� When it is not working
� Conclusion

Page � 7
Why Pair Programming (1)

� Back up each other


� Agile will put one's sick or leave into consideration
� Pair progrmming is a good solution to people's sick or leave
� It could reduce the risk of project failure due to one person's
leave
� When one is sick or out of office, the other guy could continue
working. It will reduce that influence to project.

Page � 8
Why Pair Programming(2)

� Improve the code quality


� It is one kind of code review; maybe we could call it continuous
review.
� When one feel tired, the other guy could drive. The it is also one
kind of work-relax cycle. It could give someone a breath.
� Two people could argue and find the best algorithm for one
problem, or function.
� During paring, observer could challenge the coder, and find
some small errors online.

Page � 9
Why Pair Programming (3)

� Knowledge Trasfer
� It is an good option to use pair programming to reduce learning
curve for new people.
� With some different skill set and experience, people could learn
from each other.
� Everyone could become expert with shuffling pairs.

Page � 10
Why Pair Programming (4)

� Share responsibilities and Share Pressure


� Pairing Programming will allow pressure to be shared by
partners, instead of just one.
� They could also encourage each other during pairing
� Enhance Trust of Team Members
� Successfully pairing could help team members believe each
other
� Partners will also learn each other's skill set

Page � 11
Outline

� What is Pair Programming


� History
� Motivation
� Techniques
� Why it works
� Poblems
� Challenges
� When it is not working
� Conclusion

Page � 12
Techniques: Ping-Pong Pair Programming

� A writes a test, and make sure it fails.


� B works on the productions codes, and make sure it will
pass the tests.
� B write another test, and see it fails.
� A starts working on the codes, and it will pass the test.

Page � 13
Techniques: Cross-Functional Pairing

� Only for embeded system development


� Instead of two software engineer, one software engineer
works with one hardware engineer.
� Include more time to work alone
� If the platform is well known, it may not apply to the
Cross Functional Pairing,because my problems have
been resolved.
� If the platform is new and unused previously, that is the
ideal scenario where we apply the Cross Functional
Pairing.

Page � 14
Techniques: Distributed Pairing

� Only work when teams are geographically distributed,


e.g someone works from home
� A good network is essential
� if the lag time is over 1 second, what the observer says does not
make sense.
� More tiring than traditional pair programming
� do not plan to work 8 hours per day
� Tools:
� Yuuguu, Mikogo, Trellis, ICICLE, gIBIS,...

Page � 15
Techniques: Others

� Selective Pairing
� Keyboard n Mice Pairing
� ...

Page � 16
Outline

� What is Pair Programming


� History
� Motivation
� Techniques
� Why it works
� Poblems
� Challenges
� When it is not working
� Conclusion

Page � 17
Why Pair Programming Works

� Continuous Code Review


� Fewer blockages
� Masking distractions
� Guaranteed focus
� Multiple points of view
� Reduced training cost and
time

Page � 18
Continuous Code Review

� Code Review is good, so continuous code review is


great.
� Code reviewer could surface the code, and continuous
code review could help observer understand why it is
coded so, and review code line by line.
� Feedback is online and quicker.

Page � 19
Fewer Blockages

� Blind spots are rarely shared.


� Blind of one person may not be a problem to the other guy.
� People with different skill set and experiences could
learn from each other, so more experts will come out
from a company.
� Pairing could put up with a better solution than one
person does.

Page � 20
Masking distractions

� "White noise" could keep your brain from background


noise.
� when you pair programming, you will find out the noise from
other cube is not a problem any more
� The conversation will keep you focus on what you are
coding.

Page � 21
Guaranteed focus

� Pairing programming could let people really focus on


prouductive coding, instead of just surfing the web,
checking the email, or reading blogs.

Page � 22
Multiple points of view

� Explaining codes to someone could help people find


potential bugs.
� Explaining could help people really really understand the
codes, and avoid inconsistency between thoughts and
codes.
� Explaining could also avoid some stupid errors in the
first place.

Page � 23
Reduced training cost and time

� Developers are also trainers.


� Instead of learning in class, people could learn from job.
� Developing time is also the training time.
� Better that just 5-day training in class, and it also
increase the productivity.

Page � 24
Outline

� What is Pair Programming


� History
� Motivation
� Techniques
� Why it works
� Poblems
� Challenges
� When it is not working
� Conclusion

Page � 25
Problems

Page � 26
Problems

� Disagreements
� Scheduling Conflicts between partners
� Absence of partners
� Rushing
� Over-confidence
� ...

Page � 27
Outline

� What is Pair Programming


� History
� Motivation
� Techniques
� Why it works
� Poblems
� Challenges
� When it is not working
� Conclusion

Page � 28
Challenges (1)

� It is hard to convince managments to believe in pair


programming.
� It is easy for managers to think that pairing programming will do
nothing but simply to reduce or even to halve the productivity;
therefore, it is hard to convince them.
� Management teams needs some agile training to believe that
pairing programming will work.

Page � 29
Challenges (2)

� If the skills and experiences between partners are huge


different, it may reduce productivity.
� If the background and experiences of two partners are very
different, it is possible that they could not understand each other.
� It may takes too much time for one guy to explain codes to the
other.
� Even worse, when one drives, the other one may fall asleep.

Page � 30
Outline

� What is Pair Programming


� History
� Motivation
� Techniques
� Why it works
� Poblems
� Challenges
� When it is not working
� Conclusion

Page � 31
When Pairing is NOT Working (1)

� Research work
� Pairing should not start until coding.
� If still in research part, it is prefered to be seperated.
� Both have no idea how to impelement project
� Two inexperienced people, working together, may reduce the
productive
� An inexperienced people need to pair with an exprienced people.

Page � 32
When Pairing is NOT Working (2)

� Trival work
� We use pairing to increase productivity. If the work itself is trival,
pairing is a waste of resource.
� People hate each other
� If partners hate each other, pairing will become a disaster.
� We want paring to build relationship, not to hate each other more.
� One person is not around
� When one person is sick, or have to deal with some person
affairs, the other guy may need to work alone.
� We do not need a temporary pairing.

Page � 33
Conclusions

� Pair Programming could increase productivity


� It could also reduce bugs, and give feedback more
quickly.
� It is one kind of continuous code review.
� It does not apply to every situation. For some scenario,
pair programming is not necessary.

Page � 34
References

� Distributed Pair Programming: Empirical Studies and


Supporting Environments
� Pair Programming
� - Laurie Williams
� The costs and Benefits of Pair Programming
� -Laurie Williams

Page � 35
Resources

� http://collaboration.csc.ncsu.edu/laurie/publications.html
� http://en.wikipedia.org/wiki/Pair_programming
� http://c2.com/cgi/wiki?PairProgramming
� http://www.youtube.com/watch?v=rG_U12uqRhE

Page � 36

You might also like