Etudes
Planning Etudes
Take some blank cards, and write the letters A through J on ten of them. These cards represent ten planned features of your project.
Lay the cards in front of you, in alphabetical order, with A on the left. Left indicates that we’ll do it first, cards to the right will be done later. So now we have a plan, A, then B, then C, …, then J.
Wait! We’ve made a mistake! It turns out that vowels are less important than consonants. Rearrange the schedule. Note how long it took.
Wait again!! Letters with holes in them are more valuable than letters without holes. But consonants are still better than vowels. Arrange the schedule again. Note how long it took.
Wait! One more change! The president really likes feature G and hates C. Do the schedule over. Note how long it took.
Now go into Microsoft Project. Set up the project with ten tasks named A through J. Show them as occurring sequentially. Now do the rest of the exercise. Make each change in Project. Note how long it takes. Note how you feel about it.
Please let me know what you discover.
New Tests for Old Bugs
When you’re performing in concert and screw up a difficult passage, next week you practice the etudes that help with that kind of passage. And you practice the passage itself.
The discipline of always writing the test that was needed helps us to remember what tests are needed and how to test that kind of defect.
Most of the defects that slip through our nets are due to tests that were hard to think of, or hard to write, or seemed to be a waste of time. So we practice that kind of test writing, by writing the test we should have written, even though we don’t need it so badly now. We need the learning … and we get it by practicing what we need to learn.
Pair Programming
- Have, use, and share breath mints.
- Set a timer to about five minutes. When the timer dings, discuss the name of whatever you're working on with your partner.
- Have the pair dictate code to the driver, while the driver types and comments.
- Thank your partner sincerely for everything s/he says.
- Comment a method to make it more clear. Now try to improve the method so that it doesn't need the comments after all. Discuss as you go.
- Work alone with a timer running. When the timer dings, explain what you're doing to someone else. Discuss openly.
- Work alone with a timer running. When the timer dings, throw away the code you just wrote and do it again with a pair. Pay attention to the resulting quality and to the amount of time it takes.
- When driving, make various intentional typos and errors. Help your pair catch them and help her express them in ways that are helpful to you.
- Remember to express appreciation for good things as well as calling out errors.
- When doing test-first development, switch driver and partner after every test/code cycle.
- When doing test-first development, switch between test and code: A writes test, B codes, B writes test, A codes.
- Have one person mouse and one type.
- Two computers, eight hands. When the timer dings, swap pairs. With four people, there are six different ways to pair. Try them all.