77
pair programming twitter : @JonJagger email : [email protected] blog : http://jonjagger.blogspot.co.uk/ charity : http://cyber-dojo.org

Pair programming

Embed Size (px)

Citation preview

Page 1: Pair programming

pair programming

twitter : @JonJaggeremail : [email protected]

blog : http://jonjagger.blogspot.co.uk/charity : http://cyber-dojo.org

Page 2: Pair programming

2

a seldom questioned view of programming - a view which this book will spend a great deal of time questioning. That view is that programming is an individual activity...

Page 3: Pair programming

3

Written 1969 Published 1971

Silver Anniversary 1994 Golden Anniversary 2019

longest continuously in-print book on software

development?

Page 4: Pair programming

4

devs who say they work alone don't

Page 5: Pair programming

5

pairing and getting unstuck

Page 6: Pair programming

6

rubber-duck debugging

https://en.wikipedia.org/wiki/Rubber_duck_debugging

Page 7: Pair programming

7

silenttalking

images are representative only

Page 8: Pair programming

8

lifesize cardboard cutouts!

Page 9: Pair programming

9

pairing and perseverance

Page 10: Pair programming

10

what 's the longest lived

bug?

Page 11: Pair programming

11

queen termites can live

50 years!

Page 12: Pair programming

12

time

6-12 months0 months

RIP

Page 13: Pair programming

13

if you're going through hell, keep going

Page 14: Pair programming

14

pairing and productivity

Page 15: Pair programming

15

in my experience, pair programming is

more productive than dividing the work between

two programmers and then integrating the

results

Page 16: Pair programming

16

programmers admit to working harder and

smarter on programs because they do not want

to let their partner down

Page 17: Pair programming

17

pairs spent about 15% more time on the program than the individuals*

the resulting code has about 15% fewer defects

the pairs consistently implemented the same functionality in fewer lines of code

most of the programmers enjoyed programming

collaboratively

http://collaboration.csc.ncsu.edu/laurie/Papers/ieeeSoftware.PDF

strengthening the case for pair programming

Laurie WilliamsRobert Kessler

Ward CunninghamRon Jeffries

Page 18: Pair programming

18

An experiment by Temple University Professor Nosek studied 15 full-time, experienced programmers

working for 45 minutes on a challenging problem, important to their organization, in their own

environment, and with their own equipment. Five worked individually, ten worked collaboratively in five pairs. Conditions and materials used were the same for both the experimental (team) and control

(individual) groups.

Nosek, J. T. (1998). The Case for Collaborative Programming. Communications of the ACM. March 1998: 105-108.

Page 19: Pair programming

19

All the teams outperformed the individual programmers, enjoyed the problem-solving

process more, and had greater confidence in their solutions... producing better algorithms

and code in less time (40%)

Results statistically significant using two-sidedt-test.

Page 20: Pair programming

20

if pairing increases productivity

why is it rare?

Page 21: Pair programming

21

pairing is rare because working solo is common!

Page 22: Pair programming

22

"locking" occurs whenever a situation

creates an environment favorable for

maintaining that situation...

locking occurs in all sorts of systems...

especially... social

Page 23: Pair programming

23

? different keyboards ? different editors ? table design ? room layout ? number of computers ? tools ? individual assessments ? languages ? expertise

Page 24: Pair programming

24

most people resist transitioning to pair programming – it involves breaking old habits and being more communicative and collaborative than we’ve been conditioned to be

Page 25: Pair programming

25

pairs spent about 15% more time on the program than the individuals*

the resulting code has about 15% fewer defects

the pairs consistently implemented the same functionality in fewer lines of code

most of the programmers enjoyed programming

collaboratively

for the first assignment pairs took 60% more programmer hours to complete the assignment

*

Page 26: Pair programming

26

transitioning to pairing is not easy

give it at least 3 weeks

it gets worse before it gets better

Page 27: Pair programming

27

XP

Page 28: Pair programming

28

name the XP values

4 in edition 1 5 in edition 2

Page 29: Pair programming

29

Simplicity Communication Feedback Courage! Trust

Page 30: Pair programming

30

pairing and communication

Page 31: Pair programming

31

pair programming works for XP because it encourages communication

XP is a communal software development discipline.

Page 32: Pair programming

32

we believe pair programming is an integral part

of XP

Page 33: Pair programming

33

pairing doesn't really work if you don't talk!

Page 34: Pair programming

34

"at first I found it hard

to verbalize my thoughts"

Page 35: Pair programming

35

pairing and courage

Page 36: Pair programming

36

if people program solo they are more likely to make mistakes, more likely to

overdesign, more likely to blow off the other practises, particularly under pressure

Page 37: Pair programming

37

under stress, people revert to earlier behaviour, no matter how badly that behaviour has worked in the past

Page 38: Pair programming

38

programmers admit to working harder and

smarter on programs because they do not want

to let their partner down

Page 39: Pair programming

39

Studies of Independence and Submission to Group Pressure.

A Minority of One Against a Unanimous Majority

Solomon Asch

Psychological Monographs, 7, Series No. 416, 1956.

Page 40: Pair programming

40

7 confederates 1 subject

https://en.wikipedia.org/wiki/Asch_conformity_experiments

Page 41: Pair programming

41

18 trialsin trial 1 and trial 2 the

7 confederates and the subject gave the obviously right answer

in the remaining 16 trials the 7 confederates gave the wrong

answer 12 times

Page 42: Pair programming

42

75% of subjects gave incorrect answer in at least 1 trial

subject conformed to the incorrect answer in all 12 trials

36% of the time

Page 43: Pair programming

43

variationpresence of 1 true confederate decreased subjects conformity

to the incorrect answer by 75%

Page 44: Pair programming

44

pairing and feedback

Page 45: Pair programming

45

it is a well-known psychological principle that in order to maximize the rate of learning, the subject must be fed back information on how well or poorly he is doing

Page 46: Pair programming

46

the average adult learns very little if

left to his own devices

Page 47: Pair programming

47

we are all lousy self evaluators

Page 48: Pair programming

48

?% of high school seniors believe their leadership skills are below average

Page 49: Pair programming

49

2% of high school seniors believe their leadership skills are below average

Page 50: Pair programming

50

Page 51: Pair programming

51

I am the World's leading expert

on the Dunning-Kruger effect!

Page 52: Pair programming

52

pairing and

learning

Page 53: Pair programming

53

the requirement to develop capability cannot be met adequately by a single person. We learn much faster and much better with the active cooperation of others

Page 54: Pair programming

54

learning from success

Page 55: Pair programming

55

learning from failure only has meaning when we know what we mean by success

Kevlin Henney

Page 56: Pair programming

56

i have not failed i've just found

1000 ways that won't work

Thomas Edison

Page 57: Pair programming

57

success == invent an incandescent light bulb that lasts

one hour

Page 58: Pair programming

58

recording pairs clock faces

Page 59: Pair programming

59

Page 60: Pair programming

60

picking pairs randomly!

helps reduce locking

Page 61: Pair programming

61

pairing and risk

helps reduce truck/bus number

Page 62: Pair programming

62

pairing and risk

also known as the lottery number

Page 63: Pair programming

63

pairing and interruptionspairs are very resistant to interruptions

Page 64: Pair programming

64

pairing and interviewing

teamwork characteristics... cannot be determined if you interview ... one at a time.

Page 65: Pair programming

65

pairing and practice

I felt it was unwise to allow players to practice by

themselves. Always I wanted them to be interacting with

their teammates.

Page 66: Pair programming

66

pairing and ping-pong

http://c2.com/cgi/wiki?PairProgrammingPingPongPattern

Page 67: Pair programming

67

pairing and refactoring

Wibble * p = new WIbble(); if (p == NULL) ....

Page 68: Pair programming

68

if driver always writes definitions before use suggest

writing use before definition

pairing and observing

Page 69: Pair programming

69

navigator reads ALPHA in code/comment but

driver says BETA when describing ALPHA

pairing and observing

Page 70: Pair programming

70

triple programming

Page 71: Pair programming

71

the pair results were also more consistent, while the individuals varied more about the mean

pairing and consistency

Page 72: Pair programming

72

pairing and scaling

having more than nine members requires too much coordination

Scrum Guide

having more than nine pairs requires too much coordination

What about...

Page 73: Pair programming

73

repairing

in http://cyber-dojo.org pairs easily cope with repairing every 5 minutes!

Page 74: Pair programming

74

pairing and becoming a

team

Page 75: Pair programming

75

if egoless programming is used, everyone in the group will have the opportunity to examine the work of everyone else at some time, thereby tending to prevent the establishment of strong hierarchy p72

Page 76: Pair programming

76

widespread use of pair programming involves a

cultural shift in values of the organization - away from

individual and toward team recognition and goals

Page 77: Pair programming

thanks for listening

twitter : @JonJaggeremail : [email protected]

blog : http://jonjagger.blogspot.co.uk/charity : http://cyber-dojo.org