Parprogrammering

Parprogrammering er en softwareudviklingsteknik, hvor to programmører arbejder sammen ved et tastatur. Den ene skriver koden ind, og den anden reviewer hver kodelinje mens den bliver skrevet. Den person der skriver kaldes Driver. Den person der reviewer koden kaldes observer eller navigator. De to programmører skifter rolle jævnligt.

Mens observeren reviewer, overvejer observeren også den strategiske retning af arbejdet, og kommer med ideer til forbedringer og overvejer hvilke sandsynlige problemer der måtte opstå. Dette frigør driveren til at fokusere al sin opmærksomhed på de "taktiske" aspekter ved at færdiggøre den aktuelle opgave, idet observeren fungerer som en slags sikkerhedsnet og guide.

Kom i gang

Generelt

Begynder – Ekspert par sammensætning

Etikette

Praktiske forhold

Fordele

Nogle fordele ved Parprogrammering:

' Færre arbejdsstationer: Eftersom to personer bruger én arbejdsstation, spares der én.

Ulemper

Videnskabelige studier

Studier har vist at efter tilvænning og optræning af de personlige kompetencer der kræves, er to programmører mere end dobbelt så produktive som én, for en given opgave. Ifølge The Economist:

"Laurie Williams of the University of Utah in Salt Lake City has shown that paired programmers are only 15% slower than two independent individual programmers, but produce 15% fewer bugs (N.B.: The original study showed that 'error-free' code went from 70 % to 85 %; it may be more intuitive to call this a 50 % decrease of errors, from 30 % to 15 %). Since testing and debugging are often many times more costly than initial programming, this is an impressive result."

Et studie af Williams et al. 2000 viste en forbedring i korrekthed på omkring 15 %, – og 20 til 40 % besparelse på tid, men mellem 15 og 60% forøgelse i indsats. Williams et al. 2000 citerer også et tidligere studie (Nosek 1998) som også havde 40% lavere tidsforbrug for en 60 % forøgelse af arbejdsindsats.

Et studie præsenterer et streng videnskabeligt eksperiment, hvor begynder-begynder par imod begynder-soloer oplever betydelig større produktivitetsstigninger end ekspert-ekspert-par imod ekspert-soloer.

Et større nyligt arbejde (Arisholm et al. 2007) viste 48% større korrekthed for komplekse systemer, uden nogen signifikant forskel i tidsforbrug, mens simple systemer havde 20 % mindre tidsforbrug, men ingen signifikant forskel i korrekthed. Der var ingen generel reduktion i tidsforbrug, eller øget kvalitet, men en generel 84 % stigning i arbejdsindsats.

Referencer

  1. ↑ Williams, Laurie (2003). Pair Programming Illuminated. Addison-Wesley. s. 25. ISBN 0-201-74576-3."When pairing is working at its best, … both share the same goal for completing the task."
  2. ↑ Williams, Laurie (2003). Pair Programming Illuminated. Addison-Wesley. s. 25. ISBN 0-201-74576-3."When pairing is working at its best, … they 'high five' each other for being so smart and kicking butt on the task. (We must admit that we found nothing in the distributed cognition literature about this last step, but we know it to be true."
  3. 1 2 3 4 5 6 Cockburn, Alistair; Williams, Laurie (2000), "The Costs and Benefits of Pair Programming" (PDF), Proceedings of the First International Conference on Extreme Programming and Flexible Processes in Software Engineering (XP2000), arkiveret fra originalen (PDF) 17. december 2016, hentet 19. februar 2008
  4. ↑ Williams, Laurie (2003). Pair Programming Illuminated. Addison-Wesley. s. 27-28. ISBN 0-201-74576-3."With pair programming, 'four eyeballs are better than two,' and a momentous number of defects are prevented, removed right from the start. These continual reviews outperform traditional, formal reviews in their defect-removal speed."
  5. 1 2 Williams, Laurie (2003). Pair Programming Illuminated. Addison-Wesley. s. 29. ISBN 0-201-74576-3."Knowledge is constantly being passed between partners, from tool usage tips to design and programming idioms. The partners take turns being the teacher and the student. Even unspoken skills and habits cross partners."
  6. ↑ Williams, Laurie (2003). Pair Programming Illuminated. Addison-Wesley. s. 112. ISBN 0-201-74576-3."[Expert-novice pairing] can even be valuable for novices who are novices only in the sense that they haven't beenwith their team for very long. … Watching and then doing with an expert by your side can greatly reduce the time it would require to learn 'the right way' of working with the team. It really helps when the newbie works with many of the experts (or with any team member) so he or she can learn about many different aspects of the system."
  7. ↑ Williams, Laurie (2003). Pair Programming Illuminated. Addison-Wesley. s. 21. ISBN 0-201-74576-3."In our recent Web survey, we asked, 'What have you found beneficial about pair programming?' The single most common response was, 'It's a lot more fun!'"
  8. ↑ Williams, Laurie (2003). Pair Programming Illuminated. Addison-Wesley. s. 23. ISBN 0-201-74576-3."Two people working in a pair treat their shared time as more valuable. They tend to cut phone calls short; they don't check e-mail messages or favorite Web pages; they don't waste each other's time." (Ward's Wiki 1999, contributed by Paul Chisholm).
  9. ↑ Beck, Kent (2000). Extreme Programming Explained. Addison-Wesley. s. 102. ISBN 201-61641-6. {{cite book}}: Tjek |isbn=: length (hjælp)"Under stress, people revert. They will skip writing tests. They will put off refactoring. They will avoid integrating. With your partner watching, though, chances are that even if you feel like blowing off one of these practices, your partner won't."
  10. ↑ Williams, Laurie (2003). Pair Programming Illuminated. Addison-Wesley. s. 24. ISBN 0-201-74576-3."With any software development process there is a constant struggle to get the software engineers to follow the prescribed process. A benefit of pair programming is improved adherence to procedures and standards."
  11. ↑ Williams, Laurie (2003). Pair Programming Illuminated. Addison-Wesley. s. 24. ISBN 0-201-74576-3."Others see us already working with someone else, and they leave us alone. The net effect is that we have bigger blocks of uninterrupted time, which is good for our mental state and our progress. It also reduces task-switching, which for some people generates a huge overhead."
  12. ↑ "Agility counts". The Economist. 20. september 2001..
  13. ↑ According to "Int J. of Human Computer Studies Vol (64) 2006