My method is more mundane(and direct) than the others. After I add a few lines of code, or even make a few small changes, I see if the script runs well (as I would expect). As I code, I make many,many test runs of incomplete code. In your case, I would have noticed my system bogging down pretty quickly, killed off the script, and zeroed in on the fork bomb.