33
Pair Programming Testing 2, October 14, 2004

Pair Programming Testing 2, October 14, 2004. Administration Project due Monday 2PM SHARP Remember all parts of documentation (list of tests, project

Embed Size (px)

Citation preview

Page 1: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Pair ProgrammingTesting 2, October 14, 2004

Page 2: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Administration Project due Monday 2PM SHARP Remember all parts of documentation (list of

tests, project retrospective, etc.) Zip everything into one file EasyMock matcher

Page 3: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

EasyMock Matcher Easymock by default uses Object.equals()

type comparison For arrays, this doesn’t look at content Solution: the first time you call a method that

takes an array as a parameter, set the matcher before setting return value

Page 4: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

EasyMock ExampleString [] cards = [“card 1”, “card 2”, “card 3”];

mock.addCards(cards);

control.setMatcher(MockControl.ARRAY_MATCHER);

control.setVoidCallable;

Page 5: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Pair Programming Driver and Navigator working together on

one task Roles changing often Collective responsibility for outcome Bringing together of multiple perspectives,

experiences, abilities, and expertise

Page 6: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Why pair? Higher quality code Faster cycle time Enhanced trust/teamwork Knowledge transfer Enhanced learning More fun

Page 7: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Higher quality code Immediate reviews of all code written Multiple perspectives on how code should

work People from different areas (UI/database,

development/testing) working together – no (incorrect) assumptions

Each person learns from the other – increased skills

Page 8: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Faster cycle time Less temptation/ability to get distracted on

non-work things Less rework due to bad assumptions Fewer defects slip through, so less rework for

defect repair Less interruption for pair More communication

Page 9: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Enhanced Trust/Teamwork People in pairs get to know each other better

than people working solo Better understanding of people’s skills Shared events = common ground

Page 10: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Knowledge Transfer Rotation of pairs means lots of combinations Lots of combinations make knowledge

transfer exponential No one person is indispensible Fewer assumptions

Page 11: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Enhanced Learning Each member of a pair has ongoing

opportunities to learn from their partner

Page 12: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

More Fun Social interactions while still accomplishing

work Shared events Studies show high numbers of people trying

pair programming prefer it

Page 13: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Why Pair Programming Works Pair Pressure Pair Negotiation Pair Courage Pair Reviews Pair Debugging Pair Learning Pair Trust

Page 14: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Pair Pressure Each member doesn’t want to let the other

down Improved adherence to procedures and

standards Motivation to get a task done in a session

while partner is available

Page 15: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Pair Negotiation Working together to get the best solution Distributed Cognition Each pair member has

Own set of skills, abilities, outlook. Shared goal of accomplishing task Suggested means of means of goal

Brainstorming (building on ideas of others)

Page 16: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Pair Courage Having a partner agree with a fix or a solution

adds confidence to the solution Two people expressing confusion are more

confident to go get the help they need

Page 17: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Pair Reviews Members of pairs are immediately reviewing

code as it is written Two heads better than one

Page 18: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Pair Debugging Effective debugging technique is to explain

problem to someone else Talking about problem in a pair can lead to a

solution becoming obvious

Page 19: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Pair Learning Apprenticeship model (beginner acquires

learning from observing expert) No two people are at exact same levels of

knowledge on software development Exposure to different approaches

Page 20: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Pair Trust See enhanced trust/teamwork slide

Page 21: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Problems in Pair Programming Unavailability of partners Scheduling Experts/Skill Imbalances Concentration Disagreements Overconfidence Rushing Not for everyone

Page 22: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Enabling Pair Programming Accessible workspace Communication Standards Knowledge of people’s specialties Pair rotation Group appraisal Smaller groups

Page 23: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Workspace accessible to both Display visible to both people Side by side, not one in front of the other Keyboard/mouse available to either person

Page 24: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Expectation of communication Ask to drive Ask questions Explain actions taken

Page 25: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Standards Standard tools reduce learning curve time in

pairs Coding standards assist in both members

following the code being written and avoid disagreements on how to write something

Page 26: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Knowledge of people’s specialties Know who to pair with to achieve benefit in a

given situation If a task overlaps two areas (e.g., UI and

database) pair one person from each area

Page 27: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Pair Rotation No given pair of programmers is the right pair

for every situation Rotation enables knowledge transfer

Page 28: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Group Appraisal Tasks are now completed by more than one

person Recognizing one person generally ignores

contribution from other team members who paired for part or all of the task

Page 29: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Smaller Groups Large groups benefit from pairing, but lose

some of the trust and knowledge transfer effects

Page 30: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Roles Driver

Actually types or writes down Explains actions taken Participates in brainstorming/planning

Navigator Watches for tactical and strategic defects Questions Participates in brainstorming/planning

Page 31: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Navigator Tips Delay a little to let driver find and correct their own mistakes

(particularly typo-level) If you’re getting bored/falling asleep, ask for the keyboard If the driver is getting frustrated, ask for the keyboard If you couldn’t take over at any point, ask questions or ask

for the keyboard Use active listening Talk Ask questions

Page 32: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Driver Tips If navigator bored/falling asleep, give them the

keyboard If you’re tired, pass the keyboard If you’re frustrated with something, pass the

keyboard Acknowledge navigator Explain what & why Talk Answer questions Don’t just dictate – brainstorm/design together

Page 33: Pair Programming Testing 2, October 14, 2004. Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project

Discussion What’s working in Project 1 pairs? What’s not working?