TDD - MD ColdFusion User's Group

Download Report

Transcript TDD - MD ColdFusion User's Group

Pair Programming
Jonathan Cogley
3/13/2007
© Copyright 2006, thycotic.
Jonathan Cogley
• CEO and Founder of Thycotic
– Focus on .NET, ASP.NET, Microsoft SQL Server
•
•
•
•
•
Microsoft MVP for C#
ASPInsider
Speaker at UGs and Conferences
Board Member of IAMCP
TDD Evangelist
© Copyright 2006, thycotic.
What is Pair Programming and
how does it work?
• Two developers at one workstation
working on the same programming
task
• Driver and Observer
• Different perspectives
– BasketBallMetaphor
© Copyright 2006, thycotic.
What are the benefits?
•
•
•
•
•
•
•
•
Improved quality
Greater problem solving abilities
Developer satisfaction
Continuous reviews
Design quality
Learning
Team building
Spreading system knowledge
© Copyright 2006, thycotic.
What are the benefits?
•
•
•
•
•
•
•
•
Economics
Satisfaction
Problem Solving
Design quality
Continuous Reviews
Team building
Learning
Spreading system knowledge
© Copyright 2006, thycotic.
Social Benefits
• Jointly celebrate successes
• More likely to take regular breaks
• Distractions seldom affect both
• Conversation helps in boring tasks
• Swapping drivers breaks monotony
• Ensures at least one conversation
in your work day! 
© Copyright 2006, thycotic.
What does it cost?
• Usually the BIGGEST concern
• Not much proof either way
• One commonly noted study
– 15% more time
– 15% less defects
– Used an initial a “jelling” time
© Copyright 2006, thycotic.
Problem Solving
© Copyright 2006, thycotic.
Challenges to adopting PP
•
•
•
•
•
Overcoming perception of cost
Discouraging non-pairing
Personalities / Anti-social
Differences in ability levels
Developing a schedule for pair swaps
and balancing the workload (less
tracks)
• More involved than you might think
© Copyright 2006, thycotic.
Pair Programming Setups
© Copyright 2006, thycotic.
Pair Programming Setups
© Copyright 2006, thycotic.
Pair Programming Setups
© Copyright 2006, thycotic.
Pair Programming Setups
© Copyright 2006, thycotic.
Pair Programming Setups
© Copyright 2006, thycotic.
Pair Programming Setups
© Copyright 2006, thycotic.
Pair Programming Setups
© Copyright 2006, thycotic.
Is Pairing enough?
• No
• Research paper from Alabama
University
• Experiments in PP are costly
• Lots of support needed
© Copyright 2006, thycotic.
Pair Swapping
• Pairs can get stale!
• Optimal time to swap pairs?
• Always keep a person on task
© Copyright 2006, thycotic.
Remote Pairing
• VNC – TightVNC – video hook
• Microsoft Virtual Server (see Peter
Provost’s blog)
• MSN Messenger or other live
service sharing
• Conference line or VOIP
© Copyright 2006, thycotic.
Disadvantages to Pair Programming
•
•
•
•
•
Less ownership
Can be less responsibility
Loss of personal development space
Requires even number of developers
Can mean projects get put down for
periods of time with small teams
• Difficult for telecommuting
• Work schedules must coincide
© Copyright 2006, thycotic.
Complimentary Practices
• Test Driven Development
– Provides a defined method
• Collective Code Ownership
– Coding standards
– Process standards
• Open workspace
– Allows for easy communication and pair
swapping
• Stand up meetings (short meeting
every morning)
© Copyright 2006, thycotic.
Pairing might help a late project
• Beat Brooks’ Law
(Mythical Man Month)
• Group from NC University analyzed
30 survey responses
• Pairing reduces disruption and
quickly assimilates new resources
© Copyright 2006, thycotic.
Pairing in Education
• Reduces costs on institution
• Students help each other
• Future programmers may be more
familiar with pair programming on
day one!
© Copyright 2006, thycotic.
HowToPissOffYourPair (Humor)
• Taken from c2 wiki page of the
same name
• Some gems:
– Once you wrestle the keyboard away, delete your partner's last edit
immediately. Then do what you were thinking of instead.
– Never miss an opportunity to lecture your partner about good [OOdesign|database-normalization|refactorings|math|linguistic-legalism]. Keep
arguing and lecturing even after your partner agrees with you. Establish
dominance.
– Complain before your partner does something wrong. Create elaborate
theories about their failings. Never forgive, never forget.
– Drink massive amounts of coffee to get that extra rich, textured dragon
breath going. Add the smell of cigarette smoke to your breath and clothing
if possible.
– Pair with headphones on.
© Copyright 2006, thycotic.
Pair Programming for interviews
• Thycotic does one day pairing
interviews
• Work with your future team!
• Kick the tires from both sides!
• Less trick questions, more context
© Copyright 2006, thycotic.
Conclusion
• Pairing is definitely worth a try
• It is designed for people not computers
• Many benefits such as quality, problem
solving, mentoring and team building
• Social aspect can make day to day
coding more fun and more interesting
© Copyright 2006, thycotic.
•
•
•
•
•
•
•
•
Further Reading
The Costs and Benefits of Pair Programming
http://collaboration.csc.ncsu.edu/laurie/Papers/XPSardinia.PDF
Conversant Pairing
http://www.pairprogramming.com/conversantpairing.htm
The Collaborative Software Process
http://collaboration.csc.ncsu.edu/laurie/Papers/dissertation.pdf
(Long read … PhD paper)
Paired Programming in the Software Factory
http://www.menloinstitute.com/freestuff/whitepapers/pairedprogram
ming_qanda.htm
Pairing alone is not enough
http://cs.ua.edu/research/TechnicalReports/TR-2003-03.pdf
Relationship between Pair Programming and Brooks’ Law
http://www.agiledevelopmentconference.com/files/RP1-1.pdf
BasketBallMetaphor
http://c2.com/cgi/wiki?BasketballMetaphor
Strengthening the Case for Pair Programming
http://www.cs.utah.edu/%7Elwilliam/Papers/ieeeSoftware
© Copyright 2006, thycotic.
Further Reading
Pair Programming Illuminated
by Laurie Williams and Robert Kessler
© Copyright 2006, thycotic.
Slides and Code
• http://www.thycotic.com/presentations.html
My Blog
• http://weblogs.asp.net/jcogley
© Copyright 2006, thycotic.