Here's a preview from my zine, The Pocket Guide to Debugging! If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!
get the zine!
read the transcript!
It’s much easier to debug when your program does the exact same thing every time you run it.
Illustration of a sad stick figure with curly hair.
person (thinking): “the bug only happens 10% of the time, it’s SO HARD to figure out if my change fixed it or not.”
There are a bunch of tools for controlling your program’s inputs to reduce randomness, for example:
- many random number generators let you set the seed so you get the same results every time.
faketimefakes the current time.- libraries like ruby’s
vcrcan record http requests. - record/replay debuggers like
rrrecord everything.