Saturday, May 02, 2009

Making reproducible bugs

I got some bugs lurking around related with collision detection. So the first rule when debugging is to make the bugs reproducible. I'm currently trying to record the user interactions and frame number at which they occurred, into an NSMutableArray, and then dumping it to NSDefaults when exiting the application (should be enough for now). Then I will load them back up when the application is relaunched. At the frame number at which the user interactions (basically lines) were originally made, I recreate the lines. Also I had to remove any randomness if I want that each time I play the recorded actions, I get the same outcomes (i.e. bugs). So the ball(s) will always start from the same position.

Will try to finish this interactions playback later on. Have to prepare for next week's lectures.

No comments: