Pair Programming By Hanchao Wu Outline What is Pair Programming - - PowerPoint PPT Presentation

pair programming
SMART_READER_LITE
LIVE PREVIEW

Pair Programming By Hanchao Wu Outline What is Pair Programming - - PowerPoint PPT Presentation

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 Page Page Page 2 2 2


slide-1
SLIDE 1

Pair Programming

By Hanchao Wu

slide-2
SLIDE 2

Page Page Page Page

  • 2

2 2 2

Outline

What is Pair Programming History Motivation Techniques Why it works Poblems Challenges When it is not working Conclusion

slide-3
SLIDE 3

Page Page Page Page

  • 3

3 3 3

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

slide-4
SLIDE 4

Page Page Page Page

  • 4

4 4 4

Outline

What is Pair Programming History Motivation Techniques Why it works Poblems Challenges When it is not working Conclusion

slide-5
SLIDE 5

Page Page Page Page

  • 5

5 5 5

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.

slide-6
SLIDE 6

Page Page Page Page

  • 6

6 6 6

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

slide-7
SLIDE 7

Page Page Page Page

  • 7

7 7 7

Outline

What is Pair Programming History Motivation Techniques Why it works Poblems Challenges When it is not working Conclusion

slide-8
SLIDE 8

Page Page Page Page

  • 8

8 8 8

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.
slide-9
SLIDE 9

Page Page Page Page

  • 9

9 9 9

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.

slide-10
SLIDE 10

Page Page Page Page

  • 10

10 10 10

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.

slide-11
SLIDE 11

Page Page Page Page

  • 11

11 11 11

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

  • ther

Partners will also learn each other's skill set

slide-12
SLIDE 12

Page Page Page Page

  • 12

12 12 12

Outline

What is Pair Programming History Motivation Techniques Why it works Poblems Challenges When it is not working Conclusion

slide-13
SLIDE 13

Page Page Page Page

  • 13

13 13 13

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.

slide-14
SLIDE 14

Page Page Page Page

  • 14

14 14 14

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.

slide-15
SLIDE 15

Page Page Page Page

  • 15

15 15 15

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,...

slide-16
SLIDE 16

Page Page Page Page

  • 16

16 16 16

Techniques: Others

Selective Pairing Keyboard n Mice Pairing ...

slide-17
SLIDE 17

Page Page Page Page

  • 17

17 17 17

Outline

What is Pair Programming History Motivation Techniques Why it works Poblems Challenges When it is not working Conclusion

slide-18
SLIDE 18

Page Page Page Page

  • 18

18 18 18

Why Pair Programming Works

Continuous Code Review Fewer blockages Masking distractions Guaranteed focus Multiple points of view Reduced training cost and time

slide-19
SLIDE 19

Page Page Page Page

  • 19

19 19 19

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.

slide-20
SLIDE 20

Page Page Page Page

  • 20

20 20 20

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.

slide-21
SLIDE 21

Page Page Page Page

  • 21

21 21 21

Masking distractions

"White noise" could keep your brain from background noise.

when you pair programming, you will find out the noise from

  • ther cube is not a problem any more

The conversation will keep you focus on what you are coding.

slide-22
SLIDE 22

Page Page Page Page

  • 22

22 22 22

Guaranteed focus

Pairing programming could let people really focus on prouductive coding, instead of just surfing the web, checking the email, or reading blogs.

slide-23
SLIDE 23

Page Page Page Page

  • 23

23 23 23

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.

slide-24
SLIDE 24

Page Page Page Page

  • 24

24 24 24

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.

slide-25
SLIDE 25

Page Page Page Page

  • 25

25 25 25

Outline

What is Pair Programming History Motivation Techniques Why it works Poblems Challenges When it is not working Conclusion

slide-26
SLIDE 26

Page Page Page Page

  • 26

26 26 26

Problems

slide-27
SLIDE 27

Page Page Page Page

  • 27

27 27 27

Problems

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

slide-28
SLIDE 28

Page Page Page Page

  • 28

28 28 28

Outline

What is Pair Programming History Motivation Techniques Why it works Poblems Challenges When it is not working Conclusion

slide-29
SLIDE 29

Page Page Page Page

  • 29

29 29 29

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.

slide-30
SLIDE 30

Page Page Page Page

  • 30

30 30 30

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

  • ther.

Even worse, when one drives, the other one may fall asleep.

slide-31
SLIDE 31

Page Page Page Page

  • 31

31 31 31

Outline

What is Pair Programming History Motivation Techniques Why it works Poblems Challenges When it is not working Conclusion

slide-32
SLIDE 32

Page Page Page Page

  • 32

32 32 32

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.

slide-33
SLIDE 33

Page Page Page Page

  • 33

33 33 33

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.

slide-34
SLIDE 34

Page Page Page Page

  • 34

34 34 34

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.

slide-35
SLIDE 35

Page Page Page Page

  • 35

35 35 35

References

Distributed Pair Programming: Empirical Studies and Supporting Environments Pair Programming

  • Laurie Williams

The costs and Benefits of Pair Programming

  • Laurie Williams
slide-36
SLIDE 36

Page Page Page Page

  • 36

36 36 36

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