Red Squirrel Reflections
Dave Hoover explores the psychology of software development


[Previous entry: "Relationships: Opposites"] [Main Index] [Next entry: "Switching Blog Software"]

Can Somebody Name This Practice?
Saturday, January 8, 2005

In every job that must be done, there is an element of fun. You find the fun and [SNAP], the job's a game! --Mary Poppins

I want to share a software development practice. It has evolved out of the practices of extreme programming. I have found that this practice can transform the act of developing software into a game far more explicitly than any other practice I have experienced. I'm not sure what to call this practice, but it needs to be named so that it can be more easily shared. I'm sure that I'm not the right person to name it, since I did not create this practice.

This practice is a child of two well-known XP practices: pair programming and test-driven development. These practices by themselves are a lot of fun. But this is extreme programming, and we like to push the envelope, right? So let's turn the fun dial up to eleven...

I first experienced (what I will temporarily call) Ping Pong Development when I visited Object Mentor in 2002. I was attending their Java Language Immersion with Test Driven Development and I was the only student of Micah Martin for the entire week. We had fun. As we worked through the payroll exercise, Micah would start by writing a test. I would then try to make it pass. At first, I would take giant leaps ahead of him, coding far more than it took to get to a green bar. He would patiently watch me as I stumbled around, often getting lost down rabbit holes. Periodically, he would drive for a moment, and do something absurdly simple and get the test to pass.

I started getting a feel for how easy it was to take small steps. And I started to enjoy taking as small a step as possible, which forced Micah to write more rigorous tests. One time, just as I was getting us to a green bar, Micah prompted me to write the next test. I fumbled around, trying to pick up on the direction he was driving us with the tests he had written. And I wrote a test. Red bar.

Micah got the test to pass. Green bar. Micah refactored. Green bar. Micah wrote a test. Red bar.

I got the test to pass. Green bar. I wrote a test (couldn't see anything to refactor). Red bar.

Micah was insanely lazy and got the test to pass in a couple seconds. Green bar. Micah added to the test I had just written. Red bar.

You bastard, now I have to do some thinking to get this thing to pass. 10 points for Micah...

For someone who loves games and competition, the rhythm that develops in these programming sessions feels like home. The great thing is that it is competitive and collaborative at the same time. As you compete to do the least amount of work, you are collaboratively building up a rigorously tested set of barely sufficient objects.

Since my week with Micah, I have tried Ping Pong Development with a number of people. On my last project, Aslak Hellesoy re-introduced me to it and it became the standard way we pair programmed on the project. I feel like it's time we give this practice a name. I think the XP community would benefit from it.

Update: How about Turn-Based Programming? The phrase "turned-based" has its roots in computer strategy games, which fits into the "programming is a game" idea.

"Programming is the Great Game. It consumes you, body and soul. When you're caught up in it, nothing else matters." --How Software Companies Die, Orson Scott Card

Another update: It looks like someone has already referred to this practice as ping pong programming back in 2003. That's good enough for me. That's what I'm going to call it.

Posted by Dave

Replies: 6 comments

I think Ping-Pong Programming, or even just Pong Programming sums it up really well :-)

A.

Posted by Alan Francis on 01/08/2005

Some half-baked thoughts...

What you're describing sounds similar to a conversation, but with code instead of with voices. So... Conversational Coding?

But there's something about this development style that's more specific than conversation. It's a particular kind of conversation. Each test is like a question. The new code that passes each test is like an answer. So this is a conversation of questions and answers. Question and Answer Coding? That's kinda limp as a name.

There's probably a better name than that somewhere. What kinds of conversations are made up of questions and answers? One such kind is therapy. Therapeutic Programming? Okay, no. Interrogation? Again, no.

Posted by Dale Emery on 01/08/2005

Challenge-Response. A lame name, but you are given a challenge which you respond to with a solution and a new challenge.

Posted by Thomas Eyde on 01/08/2005

Rhythm Pairing?

As an aside, I'd like to see this, as well as some of the pairing patterns I'm learning of from James Ross and Simon Harris (i.e., Vocalise, Write Code you can Listen to) published somewhere.

Posted by Jason Yip on 01/08/2005

After reading the other comments, the first word that popped to my mind was dialectic programming. But to be honest, I think Ping-Pong programming is the best suggestion so far - it's fun, it's a game and it describes very well the process that is going on, I think!

Posted by Anne Marie on 01/10/2005

How about Challenge Programming ?

By writing a test you challenge your 'opponent' to come up with code that passes that test. Switching turns seems a good way to keep balance when introducing newcomers to test-driven-developent.

Posted by Sven Gorts on 01/11/2005

Powered by Greymatter