Archive for the ‘Experience Report’ Category

pairing final
The “Programming with the Stars” final was almost the last event of the whole agile2008 conference, and Michael Feathers and I were up against Lasse Koskela pairing with Noah Jacobson. Our brief from Joshua and Jeff was “you have 8 minutes on stage. Impress us”. This seemed a little vague to me, but when pressed, all they said was “you have 8 minutes. Impress us with your skills at Pairing, TDD, Refactoring and IDE expertise.” So there.

Yesterday (Thursday) was very intense, and I am exhausted. Geoff and I presented a 90 minute slot on TextTest first thing in the morning. We get better every time we do it, and this was definitely the best yet. I ended the session with an extended demonstration of KataBankOCR which I had been practicing loads, and went off without a hitch. Then at lunchtime we did “Programming with the stars” demonstrating JUseCase and TextTest (see my previous post) and directly after lunch Geoff did a 45 minute presentation of xUseCase. The room was packed and lots of people seemed interested. Afterwards Geoff and I spent some time chatting to important people from various agile tools companies.

On top of all that it was the conference banquet yesterday evening. Good company, good food, generally a great evening. Today Michael was running a session first thing, I wanted to go to the keynote, and the upshot was we didn’t manage to get together to plan what to do in the “Programming with the Stars” final until an hour before it started. For some inexplicable reason the python installation on my Vista machine stopped working and I couldn’t get anything to run, so we decided to use Michael’s machine, (a mac)….

ok ok enough with the excuses. It was a disaster. Eight minutes on stage isn’t long enough to achieve much, especially when you are dog tired, unprepared, and nervous. They had warned us it would happen, but when after 4 minutes Jeff stopped us and asked the judges to give us some interim advice, I totally lost my train of thought. All I remember of the advice was Bob Martin telling us to act “perky”, so the fatigue must have been showing. When we restarted for the remaining four minutes, the audience began calling out more or less helpful directives. By the end we had written about five lines of code and still had no tests running.

The judges were surprisingly understanding and did give us a few points for our pairing skills (they can’t have been for our coding, let’s face it). Then Lasse and Noah came on stage and did a really slick, thoroughly prepared demonstration including testing with stubs, and a funny video clip. It was well done, and they deserved good marks.

So Michael and I didn’t win “Programming with the Stars”, but it was good fun, and we got to show off a little along the way. Now I just have to go back to being a normal programmer, pairing with other normal programmers, and Michael, well, I guess he continues to be a star…

final scores

Today in “Programming with the Stars” our task was to do “Story Test Driven Development” (aka Acceptance Test Driven Development). With just 6 minutes on stage, this was a pretty tall order.

Jeff and Joshua had suggested that we use tools like FIT or Fitnesse to create the story tests, but I thought it might be an idea to try using TextTest. I have an ancient Java application that I have used before to demonstrate how TextTest works together with JUseCase, and I thought I might be able to do something with that.

Michael was really cool about all this, which was great, because I thought it was quite a risk to move away from the well-known acceptance testing tools.

The most important part about JUseCase is the way it helps you to interact with the customer (domain expert). So we thought it might be cool to bring in someone to act as the customer in the middle of our 6 minute slot. Geoff was the obvious choice since he wrote the tools, and knows how to write tests in them already.

So in the middle of our performance, Geoff came up onto the stage for a couple of minutes. He helped us write a failing story test in JUseCase/TextTest, and then Micheal and I made the use case part of it work by adding a new widget. We didn’t get the whole test passing, but it was a start.
judges
The judges apparently loved this, we got the highest marks of the whole competition so far. Wahey! Now for the final tomorrow!
scores day 3
(It has taken me some time to write this post. It feels like every time I sit down in the lobby to write it someone I have never seen before comes up to me and congratulates me or asks me if I’ve planned what to do in the final… this pleb-to-overnight-celebrity business is weird)

stars day 2
We were up last this time, rather than first, and I was so impressed with the three pairs who went before us, they all paired really well and seemed to achieve what they set out to do. Joshua (one of the hosts) also decided to interview each pair just before they started coding (“so do you think you’ve got what it takes to go all the way?”) and I had no idea what to say. On the TV shows I’m sure they coach the contestants on how to respond to that kind of question, but I was too busy worried about how I was going to remember to type enough semi-colons to say anything coherent…

So, Michael produced some horrible looking C++ and led me through setting up a test so we could do “extract method” on a small portion of a hairy looking monster method. He introduced me to a technique called “sensing variable”. Basically you write a test that calls the long hairy method, and in the middle of the method just after the part you want to extract, you introduce a “sensing variable” – you assign the result of what will be your extracted method to this global. Then from your test you can check what the global contains, and write an assertion for it. The next step is to do the extract method, and the test then checks that the “sensed” variable is still the same. This should ensure that you didn’t make a mistake with the extract method, it is called, and returns the same as before.

It’s fairly simple really, but it’s the kind of thing you wouldn’t think of if it wasn’t shown to you. In a language like C++, you need all the help you can get.

Well, the judges had already awarded some very high marks to the other contestants, and our score was joint bottom, I think. Anyway, it went to audience vote between us and J.B. and Todd. They had done a teacher/pupil act similar to ours, on Eclipse wizardry rather than C++, and had raised considerably more laughs than we had. So I was a little surprised when we clearly got a louder cheer from the punters, and Jeff (the other host) announced we were through to the next round tomorrow!

pairing fizzbuzz

Michael Feathers and I competed in the “Programming with the Stars” competition today, which was fun, if rather nerve racking. Our category was “TDD from scratch” and we chose to perform the FizzBuzz Kata in python. We chose that because we thought it was simple enough we could do the whole thing in the time limit, just four minutes (!).

It seemed to go smoothly, ping-pong programming, and this is the code we ended up with:

def fizzbuzz(max):
return ["FizzBuzz" if i % 15 == 0
    else "Buzz" if i % 5 == 0
    else "Fizz" if i % 3 == 0
    else i
    for i in range(1, max+1)]

assert fizzbuzz(1) == [1]
assert fizzbuzz(2) == [1,2]
assert fizzbuzz(3) == [1,2,"Fizz"]
assert fizzbuzz(5) == [1,2,"Fizz", 4, "Buzz"]
assert fizzbuzz(15)[-1:] == ["FizzBuzz"]

print "\n".join(map(str, fizzbuzz(15)))

As you can see we didn’t bother with a testing framework of any kind, just a few assert statements, and the code that does the work is all one line, (although we put in some line breaks to make it readable). I was pretty pleased we managed to do it without mishap.

The judges turned out to be Bob Martin, Rachel Davies and Mike Hill, and they weren’t actually as nasty to us as I feared. We got good marks from Rachel and Mike, (8/10 from both), and since Bob was mean to nearly everyone, his 5/10 was actually ok. Only one other pair scored more than us, which puts us through to the next round tomorrow. Our category is going to be “Refactoring”, which is basically Michael’s specialist subject, so hopefully we’ll be able to come up with something good.
first round scores

I’ve just got to Toronto in advance of the agile2008 conference which starts on Monday, and I’m looking forward to it with great excitement and some trepidation. Until now it was the session that Geoff and I are running on Thursday that was claiming all my attention but now my head is also buzzing with another potential conference highlight.

I’ve signed up as a contestant for the “Programming with the Stars” competition, and I got a mail today explaining that I will be performing live on stage with Micheal Feathers on Tuesday! We will have exactly four minutes to impress the audience and the panel of judges with our impressive collaboration skills and amazing feats of coding. I’ve seen “Idol”, I know what “panel of judges” means… we’re going to be eaten alive! I just hope I can remember how to code after nearly a year at home with baby. Thankfully I am very confident that Michael Feathers not only knows how to code, but if I do manage to produce anything really dodgy, who better to sort me out than the author of “Working effectively with legacy code”?

We are competing with five other pairs, it’s a knockout competition, and the winners will be declared on Friday. Wish me luck!

Note: my experiences are written up in the following posts: