Today I spent most of the most of my morning and afternoon honing my TDD skills with Rob Cooper. Whilst none of the work we did was particularly earth-shattering it was great to delve in code and discuss at length. We tackled a TDD Kata in depth rather than discussing the 'form' elements we concentrated on discussing how the design emerged and the different approaches to testing. We had a few technical issues and ironed most of them out but I wanted to outline the setup as it seemed fairly easy to arrange.
Remote Pair Recipe
- IDE of choice - (helps if these match)
- Git - (or other DVCS)
- GitHub Account - (or other hosted service)
- Skype/GTalk/Live Messenger - for Audio Comms
- MS SharedView - see what the other pair is doing
MS SharedView deserves a special mention here as it worked extremely well for screen sharing.
Guidelines
Check your setup
Before starting make sure you can both access and commit to Github. This is the place where you are both going to be passing your code back forth to. Make sure your equipment works (someone in this pair had a crappy mic in his headset - no names mentioned (*cough* - me)). This slowed us down and upset flow a little. Thankfully the other pair was not blameless. If you are going to use other tools agree what they are, including version, before the event so you don't have to spend time scrabbling around the internet for requisite software.Have a plan
Do not go into a session unprepared. Without a plan a session will lose direction. I think we were over-prepared with things to do but its better to have more than less.Don't be scared
Having someone watching your every keystroke may seem like a daunting thing butDon't be offensive either
There are many ways to convey that your pair has not removed the duplication in that class other than by comparing his intellect to that of an amoeba. Pick a nicer one.Swap driver-navigator often
Rob and I swapped mid-scenario in our TDD session. I would red-green (to the simplest possible case) then Rob would grab the session add a further test and refactor. We thought this was a nice way of doing things as we both had our input in creating the feature. I would make the fixture and pass it over to Rob as tested. Rob double checks with a further scenario and makes the call to refactor.Embrace your differences
Rob and I had a slight difference in our approach to testing. We stopped and talked about it afterwards but it was not a problem in this case as the code was 'throw away'. The issue may have been more pressed if we wanted to keep the code.Take breaks
I'm ashamed to say that even though Rob and I are both Pomodoro Technique practitioners we took 1 break in the multi-hour session. This was wrong. I found that towards the end of the session I was losing concentration. With pairs I think this especially important due to the intense focus you have with two of you.Workflow
We approached the exercise like so:- Driver picks feature
- Driver writes test.
- Driver passes test.
- Driver commits and pushes to GitHub
- Navigator pulls from github
- Navigator becomes Driver
- Driver adds 'confidence' test and refactors.
- Go to 1.
2 comments:
Hey John,
Nice post - will be keen to see any comments people leave, especially thoughts on the format we ended up doing (with the red > green > refactor > change > confidence test > red > green > refactor).
I've got mine sat in drafts, will get that posted tonight.
Thanks again for the great session - I really enjoyed it!
Go To Statement Considered Harmful ...
but seriously, interesting stuff, I had been wondering how I could pair program kata's with people not in Amsterdam, as I did not want to blindly follow someone else's execution, but my TDD skills are too shiny and new to trust that what I do is the best way.
Post a Comment