[Introduction]


You, the reader, impersonate a novice developer attending a class about TDD. I, the trainer, explain you the TDD process. 

1. Write a test that fails 
2. Write the simplest piece of code making the test pass – and keeping the others passing 
3. Clean the parts of the code that need some cleaning 
4. Repeat 

I propose you to go on with a simple exercise, yet non-trivial enough to make it interesting: test-driving the development of a ruby function that computes the score of a bowling game. I have hooked up a laptop to a beamer. It displays a single shell window, letters blown-up in a big font. I type in

 vi

You sigh. Your mind drifts away. You wonder how getting a program to compute bowling scores could be of any interest. Hell, you wonder how getting any program developed with vi could be of any interest. Your noticing I'm not speaking anymore brings you back to reality. The room is silent. Just the hum of the beamer's fan. I look at you intently, obviously waiting for the answer to a question you haven't heard.

Few words of caution before we move on. I'm assuming here you're already familiar with the (ten-pin) bowling scoring rules. If not, now is a good time to learn them. You are also strongly advised to have a computer at hand, ruby set up and working, so that you can write and run the code along with the trainer in the story.

Ready for the adventure?... You may go on.

Also:


Emmanuel's blog -
Words, Words, Words