Session 3

Pair Programming, Testing, and Ruby

Agile Software Development

Opening Discussion

... about the The Test-First Stoplight

No comments.

Agile Theme: Continuous Feedback

Most mornings, I want to control the pace I am running. Maybe I am doing a tempo run, on which I want to average my 10K pace for a few miles. Maybe I'm doing a speed work-out and need to run several repetitions of a particular shorter distance at a faster pace. I have to be careful when trying to run fast, because it's easy for me to overdo it. Then I run out of gas and can't finish comfortably, or at all. (This is what we'll soon call sustainable pace.) And it's even easier to run too slowly and not get the full benefit of the workout.

Or maybe I want to run slower than usual, as a way to recover from faster work-outs or as a way bump my mileage up. On days like this, I have to be careful not to run too fast, because my body needs the break.

So I need a way to pace myself. I'm not very good at doing that naturally, so I like to use landmarks to monitor my pace.

One place I can do that is on the George Wyth recreation trail near my home. This trail contains a 6.2-mile loop and has four 1-mile segments labeled. When I try to run a steady pace on this route, I used to find that my miles varied by anywhere between 10 and 20 seconds. These days I do better, but sometimes I can't seem to get into a groove that keeps me steady enough.

I used to do all of my weekly speed workouts on the indoor track at the Wellness Center. Running the middle lane of that track requires a bit over 9 laps per mile, and it has signs marking 200m, 400m, 800m, and 1200m splits. Running there I get feedback every 1/9th of a mile, and I can synchronize myself at the longer splits, too. Not too surprisingly, I pace myself much better on the track than on the trail. And more frequent feedback is the reason. When I get off by a second or two for a lap, I make can make a small adjustment to get back on pace -- and I can tell if the adjustment was successful within a 1/9th of a mile.

Doing my Yasso 800s on the small track has been invaluable in helping me get faster. Even better, they have helped me learn to pace myself naturally. Now when I run mile repeats on the trail, I find that my pace rarely varies more than 10 seconds per mile, and sometimes I can clip off several miles in a row all within 3-7 seconds of each other. Getting continuous feedback as I've learned has helped me to develop better "instincts".

I recently took my speed workouts outside to the 1/4-mile track at Price Lab, to enjoy the summer weather more and to lengthen my repeats. Running consistent 1200m repeats on the longer track is tougher, because I don't yet have the instincts for racing fast at a desired pace and because the track gives me feedback less frequently. But I hope that a few weeks of practice will remedy that...

My goal is eventually to be able to find a groove where my pace is steady, comfortable, and right on the mark for a particular marathon time. Continuous feedback plays an important role in training by body and mind to do that.

(Note: I originally posted this on my blog back in June 2004. For a reminder of what happens when one goes too fast, check out what happens when I run too fast.)

... continuous feedback in TDD, pair programming, continuous integration, short iterations, on-site customer. Everywhere!

Quick Discussion of Ruby

Comments? Questions?

... look at irb and files.

    macbook > irb
    irb(main):001:0> "Hello, world"
    => "Hello, world"
    irb(main):002:0> puts "Hello, world"
    Hello, world
    => nil
    irb(main):003:0> load "hello-world.rb"      # 'require' for once
    Hello, World
    => true

Look at...

Create a file with tests. Create a file with app.

Here is the code I demoed today, in case you find it useful.

Pair Programming in Ruby

Pair for 30 minutes. Then swap driver and navigator and do it again.

... do the The Test-First Challenge. Remember: implement code for each test one at a time!

Wrap Up

Eugene Wallingford ..... ..... May 12, 2010