pair programming in the classroom · 2017-06-28 · pair programming definition •"pair...

48
Pair Programming in the Classroom Mark Sherriff University of Virginia June 28, 2017 Some material courtesy of Laurie Williams, NCSU Tapestry 2016

Upload: others

Post on 25-Jun-2020

25 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

PairProgrammingintheClassroom

MarkSherriffUniversityofVirginia

June28,2017

SomematerialcourtesyofLaurieWilliams,NCSU

Tapestry2016

Page 2: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

Overview• WhatexactlyisPairProgramming?• TheCaseforPairProgramming• TheCosts• Guidelinesforasuccessfulpairingexperience• MythsandLegends• Resources

2

Page 3: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairProgrammingDefinition• "Pairprogrammingisastyleofprogramminginwhichtwoprogrammersworkside-by-sideatonecomputer,continuouslycollaboratingonthesamedesign,algorithm,code,ortest."– LaurieWilliams

3

Page 4: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

SlightlyAlteredDefinition• "Pairprogrammingisastyleofprogramminginwhichtwoprogrammersworkside-by-sideatonecomputer,continuouslycollaboratingonthesamedesignoralgorithm."(emphasismine)

• Basicidea:IDE’shelpuscode– peoplehelpusdesign!

4

Page 5: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

WhyPairProgramming?• Pairprogrammingstudentstendto:

– Makeitthroughthefirstclass– Improvesretention– Increasesprogrammingconfidence– Performcomparablyorbetteronexamsandprojects

– Performjustfineinfuturesoloprogramming– Helpcreatepeergroups

5

Page 6: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

WhyPairProgramming?• Aninstantsupportsystem

– Wehavefoundthatpairingcutsdownonalargenumberofthe"trivial" questions(syntax,assignmentclarification,etc.)andafairnumberofthemorecomplexquestions(debugging,etc.)

– WehavebeenabletoreducethenumberofTAsforsomecourses

– Instructorofficehoursaremuchquieter,andtheinstructorcanspendmoretimewithstudentsthatneedmorehelp

6

Page 7: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

WhyPairProgramming?• Sometimesitis anumbersgame• Inalabof40students…

– having20pairsmakesiteasierforTAstogettoeveryone

– 20assignmentsareeasier/fastertogradethan40• OurmainCS1coursehasonaverage500studentsasemester…

7

Page 8: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

TheRoles• TheDriver

– Thepersonwith"control" ofthecomputer– Doesthebulkofthetyping

• TheNavigator– Activelyfollowsalongwiththedriverwithcomments

– Cantakeoveratanytime• Howdoesthistranslatetopairdesign?

8

Page 9: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

Partnersvs.PairProgramming• HowisPairProgrammingdifferentthanjusthavingpartnerassignments?– Mentalityofhowtoapproachtheassignment

• Partnering:– "YougodothispartandI’llgodothispartandthenwe’ll putitbacktogether."

• PairProgramming:– "Let’sfirstdothisparttogether,thenwe’lltackletherest."

9

Page 10: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

Partnersvs.PairProgramming• Thedistinctionmatters!• Itmattersto:

– Instructors– TeachingAssistants/Tutors– Students

• Callitframing,perception,spin…whatever• It’sallaboutattitude!

10

Page 11: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

It’sAllAboutAttitude• Howdoyougettheattitudegoing?• HowdoIstartusingpairprogramming?• Thingstoconsider:

– TeachingtheTechnique– Assignments– PairCreation– PairEvaluation– Assessment

11

Page 12: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

TeachingtheTechnique• Startwiththeinstructionalstaff• PairprogrammingHAStobeincorporatedintotheclass(orlab)insomestructuredway

• Studentsdonotnaturallyworkasa“pair”whengivena“partner”

• Whathappenswhenyoutellstudentstheycanworkwitha“partner”?

12

Page 13: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

TeachingtheTechnique• Theenvironmentmatters!

13

Page 14: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

TeachingtheTechnique• Whatareyouactuallyteachingthemtodo?• 1.Taketurnsbeingtheonecoding(“driver”)• 2.Whoeverisnotcoding,commentactively• 3.Whoeveriscoding,talkthroughwhatyouaredoing

• 4.Switchatregularintervals• 5.Nothingisdoneindependentlyfromtheotherpartner

14

Page 15: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

TeachingtheTechnique• Switchingrolescanbeproblematics• Someideas:

– Goaroundandtappeopleontheshoulder– Haveaaudiocue– Haveavisualcue

• Trytoenforceevenrolesasmuchaspossible• Trytoenforceno“splittingupwork”asmuchaspossible

15

Page 16: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

Assignments• DoIhavetototallychangemycoursematerialtodopairprogramming?

• Answer:Probablynot,butsomechangesmightmakethingsgobetter

16

Page 17: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

Assignments• Biggestproblem:assignmentscope• Ifyouuseyourcurrentassignmentswithnomodificationatall,it’spossiblethatnoswitchingwilloccurand/orthepointofpairingwon’tbeobvious

• Example:ConvertFahrenheittoCelsius• CounterArgument:Twonoviceslearningtogetherfromtheverybeginningcouldhelpwithself-confidence

17

Page 18: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

Assignments• Iftheassignmentscopeistoolargeorifthereisanobvious“splitpoint”,divideandconquerbecomesmoretempting

• Example:WriteaStudentandCourseclassthatworktogethertokeepupwithcourseenrollment

18

Page 19: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

Assignments• AnassignmentIlikeforpairprogramming:• EmailHunt

– Givenawebsitethathasabunchofemailaddressesonit,writeaprogramthatcanreadthewebsiteandextracttheemailaddresses

– http://cs1110.cs.virginia.edu/emails.html• ThingsIlike:

– Noonewaytodoit(infact,ittakesmorethanoneideatogetalltheemailsout)

– Allowsforsomecreativity19

Page 20: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairCreation• Howdoyoucreatepartners?• Bigphilosophicquestion:

– Doyouassignpartnersordoyouletstudentspicktheirownpartners?

– Advantagesanddisadvantagestoboth

20

Page 21: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairCreation– AssignedPairs• Howcanyouassignpairs?

– Randomly– Basedonprogrammingexperience/confidence– Personality/friendships– Otherinterests/surveyresults

21

Page 22: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairCreation– AssignedPairs• Randomly

– Easiesttosetup– Goodifyouhavenootherinformationtoworkfrom

– Haspotentialtoleadtoproblems(butnotasmanyasyoumightthink)

– Consider“randomwithreplacement”forsubsequentassignments(noonecanworkwithsamepersontwice)

22

Page 23: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairCreation– AssignedPairs• Basedonprogrammingexperience/confidence– Researchindicatesthishasthehighestlikelihoodofproducinggoodpartnerships

– Hardtosetupuntilyouhavedata– Eventhen,itcanbedifficultbecauseresearchshowsthatperception ofpartner’sability(notactualability)isahigherindicatorofagoodmatch

23

Page 24: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairCreation– AssignedPairs• Personality/Friendships

– Mostlikelytohavethefewestpersonalityconflicts– Enforcingcliques

• Othersurveyresults– Ihaven’tusedanythingelse,butcouldimagineusingthingslike:• Schedule• Outsideinterests• Commonfriends

24

Page 25: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairCreation– Self-SelectedPairs• Self-selectedpairsoftenhaveelementsoftheassignedpairingswithsimilarexperienceandfriendships

• Soithassimilarbenefitsanddrawbacks• However,youHAVEtomonitorcloselyforthe“laststudentpicked”problem

• Probablyshouldenforcereplacementforlaterassignments

25

Page 26: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairReplacement• Reassignseveraltimespersemester• Goodforstudents

– Gettomeetnewpeople,learnaboutworkingwithnewpeople

– Iftheydon’tliketheirpartner,theyknowtheywillgetanewonesoon

• Goodforinstructor– Multipleformsoffeedback– Naturalhandlingofdysfunctionalpairs

26

Page 27: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairManagementandEvaluation• Auto-AssignPairCreation

– CATME– http://www.catme.org– Dataneededtoauto-createpairsvaries

• Self-ReportedPairs– GoogleForms

27

Page 28: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairEval

28

Page 29: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairEval

29

Page 30: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairEvaluation• Withorwithoutatool,itboilsdowntoafewquestions:– Didthepairgetalong?– Didyougettheworkdone?– Doyoufeellikeyou“didyourfairshare?”

• Moredataisnice/interesting,butthisisallyoureallyneed

• Reliablefeedbacksystemisneeded(bothforyouandthestudents)

30

Page 31: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairEvaluation• NCWITresourceshavesurveysyoucanuse!• Exampleinyourpacket• http://www.ncwit.org/pairprogramming

31

Page 32: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

PairEvaluationandAssessment• Ifthere’snoproblem…thengreat!• Ifthereis…

– Ifpossible,askthestudentsoneatatime:“If100%effortisyoudoingexactlywhatyoushouldhavebeendoing,whatpercentagedidyouactuallydo?”

– 95%ofthetime,thisworks!– Fortheother5%,youhavetouseyourbestjudgement

32

Page 33: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

Assessment• Forotherclassassessments,Idonotadjustanything

• Alltests/exams,popquizzes,etc.allstaythesameasifitwereasoloprogrammingonlycourse

33

Page 34: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

TheBiggestCost• Training!• Instructors,TAs,andstudents needtobetaughthowtodoeffectivepairprogramminginacontrolledenvironment!

• Thecontrolledenvironmentcouldbeaclosedlaborlecture-labsystem

34

Page 35: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

Butwedon’thaveaclosedlab?• CS1:

– Assignedpairsnotadvisableiftheydon’tknowthepartnersTrytointroduceinguidedlabs/in-classactivitiesfirst

• CS2:– Proceedwithcautionforassignedpairsforfirstassignment– Worksbetterafterfirstmonthorso– Atleastbondinlab+someoutsidework

• CS2+:– Afteratleastonepairedclass– Bondingstillbeneficial,outsideworkfine

35

Page 36: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

GettingInvolved• InstructorsandTeachingAssistantshavetotakeanactiveroleinlab– Mustmonitorandapproachpairsiftheyseemtobedysfunctional

– Should"stronglyencourage" driversandnavigatorstoswitch

• Instructorsalsomustunderstandthatsomepairingsarejustnotgoingtowork– Don’tletitdiscourageyou!

36

Page 37: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

HowManyPairingsFail?

37

Class Verycompatible

OK Notcompatible

CS1 64% 32% 4%

SE-P1 60% 33% 7%

SE-P2 56% 35% 9%

OO 76% 15% 9%

Total 60% 33% 7%

Page 38: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

ProblemPairs• Willproblempairshappen?Yes.• Particularcases:

– The“Idon’tcare”student– Thespecialneedsstudent– Theabsentstudent– The“liberalartsvs.engineering”student

• Theseproblemsarenotpairprogrammingrelated,butpairprogrammingcanmakethesecometothesurfacemoreoften

38

Page 39: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

GuidelinesToFollow• Stricttardiness/absencepolicymustbefollowedforpairactivitiestoguardagainstlazypartners.– Lossofpartner,points,andbadevaluation

• Theremust beareportingmechanismforstudentstoprovidefeedbackonpartners– CATMEorasimpleGoogleForm– "Ifyoucouldrateyoureffortbasedon100%.."

39

Page 40: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

GuidelinesToFollow• Assignmentsshouldbeabitmorechallenging

– "Softball" assignmentstendtobefinishedbyasinglepersonwithoutconsultingtheirpartner

• Theenvironmentforpairingmustbeconducivetopairing

40

Page 41: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

GuidelinesToFollow• Don’tgooverboard!

– EverythinginmoderationJ– Pairingisn’tforeveryassignment– Theremustbeabalance(inworkandingrade)

41

Page 42: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

MythsandLegends• Myth:Halfthestudentswilllearn

– "Inthefirstcourse,studentsneedsometimetoabsorbtheideasthemselves."

– "Myinclinationistoallowmoregroupworkstartinginthesecondcourse."

– "Wewanttobesurethateachstudentwritesenoughcodehim/herselftolearntheintroductoryconcepts."

– "Iamagainstpair-programminginintroductorycourses,wherestudentsneedtodevelopstrongprogrammingskillsthemselves."

42

Page 43: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

MythsandLegends• Infact,allthestudentslearnprettywell…

– StudiesatNCSUandSDSUshowedthatexamscoreswerecomparableorimprovedforallstudentsinintroductoryclasses

– Also,thepercentageofstudentswhosegradeinCS2wentdownbyover1/3ofagradedroppedoncepairingwasusedinCS1

Williams,L.,Layman,L.,LabPartners:IfThey’reGoodEnoughfortheSciences,WhyAren’tTheyGoodEnoughforUs?,ConferenceonSoftwareEngineeringEducationandTraining(CSEE&T’07)

43

Page 44: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

MythsandLegends• Byfallingforthismyth,you’reperpetuatinganotherone– “Allcomputerscientistworkbythemselvesincubiclesstrugglingtocode.”

• WeallknowthatcreatingsoftwareisHIGHLYcollaborative!

• Whygivethewrongimpressioninthefirstclasstheytake!?

44

Page 45: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

MythsandLegends• Myth:Cheatingwillincrease

– "Withlooserulesaboutwhopartnersare,peoplewilljustpasscodearound.Therehastobestructure!"

– "Oldpartnersmayfeelobligedtohelptheirformerteammates."

45

Page 46: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

MythsandLegends• Thinkaboutitalittledifferently…• Whenweprovidepartners,studentsnowhaveasupportsystemtheycanturnto– Anecdotalevidencefromstudentsindicatedthatthestressoffeelingaloneandisolatedmadethemconsidercheating

• Twopeoplenowhavetoagreeoncheating!– Well…thereareexceptionstothisone…– Mossandetector arevaluabletools

46 Tapestry2011

Page 47: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

OtherGuidelinesandMyths• Anyotherstoadd?

47 Tapestry2011

Page 48: Pair Programming in the Classroom · 2017-06-28 · Pair Programming Definition •"Pair programming is a style of programming in which two programmers work side-by-side at one computer,

Tapestry2017

Resources• http://www.realsearchgroup.org/pairlearning• http://www.ncwit.org/pairprogramming

• Mypersonalwebsite:http://marksherriff.com

• Myemail:[email protected]

48 Tapestry2011