Stories about Software


Chess TDD 45: Onward with En Passant

This episode followed right on the heels of Chess TDD 44, in terms of the coding, and was basically a session extending that episode.  It wasn’t always pretty, but I made more progress on solving this edge case.  I’m in the midst of a pretty brutal stretch of travel, and then my wedding and honeymoon are coming up in early September, so I don’t know how many more episodes I can promise in the near future.  I’m home in about 2 weeks, so hopefully I’ll get a few in then.  Stay tuned!

What I accomplish in this clip:

  • Made the implementation of en passant sophisticated enough that a pawn can be made aware of an en passant target.
  • Got black capture of white pawn en passant working for moves to the right and left, both.

Here are some lessons to take away:

  • Never forget that if you have a failing test you can’t figure out, it’s always possible that you didn’t write the test well.
  • It’s okay to try changing pluses to minuses or tweaking off by one situations to get a test green, as long as you go back and understand what worked and why afterward.
  • It’s often the dumbest mistakes you make that take the most time to track down and are hardest to spot.