Due to the way Center Parcs works, we didn’t get access to the lodges until 2pm on the Monday. Therefore we had a three day conference spread over four days, with Monday and Thursday being half days. Setting the “this will be different” tone nicely, the conference kicked off with a talk by Stray’s wife – Helen Rowland – on the PAC psychology model. Whilst this had absolutely nothing to do with software development, it got us thinking about how we behave and interact with the world, which would prove important for the pair-programming sessions on day 2. Equally importantly, it worked really well in getting us all talking to each other and so acted as a great ice-breaker. Since most of the conference took place in the close confines of the lounge area of a single lodge, both of these points were important to making the whole thing work so well.
Next up was a split session by Angela Relle and Stray on test-driven development (TDD). As I attended Stray’s session, I can’t comment further on Angela’s, though it was well received by those that did. Stray basically ran a testing brainstorming session in which we discussed various types of testing and why we do and don’t test in various circumstances. One take away from me was the idea of “A/B testing”, which I’d never come across before as I’ve never worked on products with a suitable delivery method for using such a technique. The session was a good eye opener as to the myriad ways of testing and I’m keen to run a similar brainstorming session at work to improve our testing strategy.
The first day was wrapped up with a highly entertaining game organised by Simon Bailey. We each took it in turns to present some code we had previously written and the teams had to try and spot design patterns and examples of clean-coder refactoring opportunities within that code. Whilst fun, there was a serious side to this too. I discovered that I am shockingly bad both at recognising design patterns and at knowing the names for refactoring techniques. Improving my skills in both areas is now high on my software “to do” list.
Day 2 departed from the usual presentations of a conference and instead become more like a workshop. The day was split into six 50 minute pair-programming sessions. Each session, the pair explored some aspect of TDD, whilst solving some part of the “Game of Life” game. The aim was not to write as much code as possible and we threw away the work at the end of each session.
Before the conference, I was unsure about this day. How would a day spent pairing with strangers work? Would I hate the whole experience? I needn’t have worried though: it turned out to be a brilliant day. The first session, I paired with Mike Cann, who was new to TDD. As a result, we started right back at the beginning of TDD and explored the whole “write failing test, write code just to make the test pass, write another failing test, refactor code to make both tests pass” cycle. Whilst Mike learned about TDD during the session, it certainly wasn’t a one-way process as he was able to teach me some useful techniques for speeding up array and vector access for example, which was a subject about which I knew very little.
Next up was a session with Alec McEachran. Taking the whole notion of exploration to heart, Alec and I explored the idea of using linked lists, rather than an array, to hold the cell data for the game. We had a great time discussing TDD ideas and came to the conclusion that no, linked lists was not a good idea in this case!
The last session of the morning was with Michał Wróblewski. For this session, we explored IntelliJ (an IDE I’m not familiar with) and how it differs from Eclipse. I don’t like Eclipse, so I was keen to learn something about IntelliJ. I came away from the session unsure: it’s definitely a more sane IDE (Eclipses workspaces are truly moronic in my view, so it’s not hard to better them), but I don’t know if it’s benefits are worth the time needed to learn a new IDE.
In the afternoon I first paired with Simon Bailey. In this session, we experimented with a new (to me at least) technique: “TDD as if you meant it”. I plan on writing a separate blog post on this topic, but in short I absolutely loved it and think it has great potential.
Next up I was with Till Schneidereit. Here we focused on writing functionality to determine if a cell should stay live or die each iteration. We used proper TDD principles for this session. We were both surprised by the fact that, by doing so, we ended with a super-clean implementation without any refactoring. Normally the true TDD approach results in lots of “silly code” that has to be rewritten and refactored. In this case though, I think the non-TDD approach would have been more likely to have resulted in code that needed refactoring. I must admit that recently I’ve started becoming somewhat anti-TDD in response to the near evangelical stance that it’s public champions – such as Robert Martin – take on the subject. This session softened my stance on the matter and reminded me that at times, it can be very useful.
The last session was with Stray herself. Here we tackled using TDD for graphics. TDD unit tests use asserts, that normally carry out precise tests, eg assert that value x precisely equals 100. Flash, in order to better support scaling, uses twips internally for its coordinate system. A twip is 1/20 of a pixel and normal x, y, width and height pixel values have to be converted to and from twips, which can result in rounding errors. We therefore explored the use of Hamcrest‘s approximation asserts, such as
closeTo() to work around graphic sizes being a pixel different to what might be expected.
That wrapped up the second – highly enjoyable – day of the conference. I’ll be posting about days 3 and 4 tomorrow.Tweet