Slide 1

Slide 1 text

Welcome to Anthony Sciamanna | @asciamanna

Slide 2

Slide 2 text

THE ORGANIZERS… Heather Blair Nick Goede Anthony Palumbi Mark Schell Anthony Sciamanna @phillyxp

Slide 3

Slide 3 text

TONIGHT’S TOPIC @phillyxp Pair Programming & TDD

Slide 4

Slide 4 text

Pair Programming Misconceptions

Slide 5

Slide 5 text

FEATURE FACTORIES @phillyxp “Two people doing the work of one?? That’s a waste of expensive resources!” An antiquated factory mindset where number of keystrokes per hour and 100% utilization of developers are the goals Image courtesy of @johncutlefish

Slide 6

Slide 6 text

FEATURE FACTORIES  If we measure the value we are delivering to customers there is a compelling argument for pairing  Pairing often reduces the time to market for features @phillyxp

Slide 7

Slide 7 text

SELECTIVE PAIR PROGRAMMING @phillyxp “Most development tasks aren’t worth pairing on. We only pair when it is appropriate.”

Slide 8

Slide 8 text

SELECTIVE PAIR PROGRAMMING  Developers only pair in very specific situations  To onboard a new developer  When someone gets stuck  Effective pair programming is deceptively challenging  The less you do it the less useful it is to you @phillyxp Sometimes pair programming doesn't "take" -- most frequently when it's framed as one programmer helping out another who's struggling. -Tim Ottinger, Agile Coach and Author

Slide 9

Slide 9 text

SELECTIVE PAIR PROGRAMMING CATCH-22 @phillyxp Developers think pairing all the time is too prescriptive Only pair for “special circumstances” Pairing occurs so infrequently developers never build pairing skills Without the skills to effectively pair developers fail to see its benefit in the day- to-day work

Slide 10

Slide 10 text

WHY SHOULD WE PAIR PROGRAM?  Encourages team collaboration and team based design and development  Improves / Creates opportunities for mentoring  Drastically reduces onboarding time  Flattens learning curves  Knowledge travels through team quickly  Builds trust / Team building  Reinforces collective code ownership  Eliminates Towers of Knowlege  When paired with TDD creates a powerful workflow  Results in higher quality code  Limits WIP  Encourages Swarming  JIT code reviews (non-blocking code reviews)  Interruption blocker  Social pressure not to get distracted / Pairs stay in flow longer @phillyxp

Slide 11

Slide 11 text

@phillyxp Test-Driven Development Refresher

Slide 12

Slide 12 text

2. Write only enough production code to make the test pass 1. Create a failing unit test (not compiling counts as a failing test) 3. Refactor only when all unit tests are passing Ping Pong Pair Programmi ng @phillyxp

Slide 13

Slide 13 text

Nick Anthony Writes a failing test Makes the test pass Writes the next failing test Makes the next test pass Only when all tests pass either person can refactor Continue until both people agree there are no more tests to write @phillyxp

Slide 14

Slide 14 text

WORKSHOP  Split up into pairs…  Non-developers can pair with a developer or join a pair as a third person @phillyxp [When pairing] learning happens every minute of every day while actual work is being done. -Richard Sheridan, Author of Joy, Inc. and CEO of Menlo Innovations

Slide 15

Slide 15 text

WORKSHOP REPOSITORY  SSH - [email protected]:PhillyXP/pair- programming-workshop.git  HTTPS - https://github.com/PhillyXP/pair- programming-workshop.git @phillyxp

Slide 16

Slide 16 text

WORKSHOP DEVELOPMENT TASKS  As a Bill Payer I want to pay my mortgage bill on the first business day that is on or after the due date  As a Bill Payer I want to pay my water bill on the first business day that is on or before the due date  As a Bill Payer I want to treat holidays as non-business days (external holiday service)  As a Bill Payer I want to pay my electric bill on the first business day that is closest to the due date @phillyxp HINT TO GET STARTED: Create objects with public methods that take a date and return a modified date based on business rules

Slide 17

Slide 17 text

IDEAL PAIRING WORKSTATION @phillyxp

Slide 18

Slide 18 text

RESOURCES  The Costs and Benefits of Pair Programming  https://collaboration.csc.ncsu.edu/laurie/Papers/XPSardinia.PDF  Ping Pong Pair Programming  http://anthonysciamanna.com/2015/04/18/ping-pong-pair- programming.html  These books are excellent resources on pair programming @phillyxp