Student Debugging Bloopers
Student Debugging Bloopers
Or, "How I debug student projects without leaving my office".
Computers do exactly what you tell them to do therefore logic is often
your best tool when debugging. Logic will dictate that certainly
possibilities exist. Then you look at the likelihood and predict one
of the top two or three possibilities. This file has some nice
examples that embarrass students. No matter how much you want to
believe something, let reality rule the day.
- Student comes to office saying that resin can't write to a log file.
I say "permissions issue." They look at me funny. I say "must not be
running as root". Student: "yes, it is." I say, it cannot be. Root
can write to any file. Sure enough, resin not running as root.
- Student says their program cannot find a file. I say "ok, so the
file is not there or you don't have permission to see it." They claim
it is there. I then say "well, then your program is not asking for
the file in the proper way". They swear it is and claim the code is a
copy of something that does work properly. Then I say "well, then you
must not be running the code you think you are." Sure enough, bad
CLASSPATH. Using logic, find the possibilities and then check the
most likely issues in order.