1 / 14

Pair Programming

Pair Programming. XP Rule of Thumb. “When something is difficult or painful, do it more often until it becomes easier .”. Roles. Driver Controls mouse and keyboard Navigator/Observer Actively reads and reviews code while it is being written Thinks about the bigger picture

brady-key
Télécharger la présentation

Pair Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pair Programming

  2. XP Rule of Thumb “When something is difficult or painful, do it more often until it becomes easier.”

  3. Roles • Driver • Controls mouse and keyboard • Navigator/Observer • Actively reads and reviews code while it is being written • Thinks about the bigger picture • Provides strategic direction • Help ensure quality and minimise defects • Switch frequently

  4. Rules • All production code must be developed by a pair • Conversely, this means that are plenty of other activities that you can undertake in the absence of a pair. • It's not one person doing all the work and another watching • Keyboard should be moving back and forth between the two participants several times an hour • Don’t pair for more than 75% of the day • Switch pairs frequently • At least daily

  5. Guidelines

  6. Start with a defined task • The task should be something you are confident that you can complete in an hour or two

  7. Agree on one tiny goal at a time • Something you can complete in minutes • Ping pong with red, green, refactor works well

  8. Talk lots! • When people are pairing well, they are talking back and forth almost non-stop. • Stating the problem in words to another person helps focus your mind and helps engage your partner's mind. It also ensures that you both know what you are working on right now. • Here are some common things to say while pairing: • Do you think this is a valid test? • Does that look correct to you? • What’s next? • Trust me (when writing code to illustrate your point rather than trying to explain)

  9. Rely on and support your partner • Driver • Complete current goal (tiny task) as quickly as possible • Trust the observer to notice larger issues • Observer • Pay attention • Think about possible bugs, larger issues, and ways to simplify or improve the design. • Bring up errors and code that you find unreadable right away. • Bring up larger issues and ideas for design improvement after the driver is done. • Jot later tasks down so that driver can stay focused.

  10. Sync frequently • It is normal to get out of sync • Be unsure of what your partner is doing • Be unclear on the current (tiny) task • When it happens, TALK and sync up again

  11. Celebrate • Celebrate completed tasks and overcome problems, e.g. • High five when a test passes • High five when you write failing test

  12. Switch roles often • At least every half an hour

  13. Red, Green, Refactor

  14. Suggested: Driver writes failing test Switch roles New driver writes code to help test pass Chat about what can be refactored and make changes together Driver writes next failing test Switch roles Loop

More Related