I usually flow chart as I go...that way you can see potential bugs before they bite