Professional Development Activities

Friday, June 24, 2011

Test Driven Development Meetup

23 June 2011

TDD is a coding process where you always write the tests first, watch them fail, and then implement the code until your tests pass. I have read the book by Kent Beck, but benefitted a lot from this BYOL (Bring Your Own Laptop) meetup.

You are testing functionality, not code, so you only write tests for the public functions that your program will provide to a user. In writing the test first, you are clear that you know what the functionality is before implementing. Refactor as you go, but make sure all your tests pass before refactoring.

The way that the meetup was organized was great. We were put it groups of 3, each group sharing one computer. One person is at each keyboard, but the group must communicate about what they are doing with the code. All the groups are working on the same problem, which in our case was a Yahtzee game. After 10 minutes or so, the person at the keyboard gets up and joins another group, and someone who was not at the keyboard the last time takes over at the keyboard this time.

I am trying to find a way to require students to program in this way. Apparently all of Google sw engineers use this technique, and other local employers have said that they are overjoyed to find job candidates that program in this way.

I found the organization of this meetup to be a great pattern for an inclass exercise. Another idea is to have one person write the test and another write the implementation.

0 Comments:

Post a Comment

<< Home