Peter Norvig
314
Norvig: Yeah, I think so. Look at all the software bugs on your computer.
There are millions of them. But most of the time it doesn’t crash.
Seibel: Yet you hear about how the shuttle flight software costs $1,500 a
line or something because of the care with which they write it and which is
allegedly bug-free. Is that just a lie?
Norvig: No, that’s probably true. But I don’t know if it’s optimal. I think
they might be better off with buggy software.
Seibel: With cheaper software and better operations?
Norvig: Yeah, because of the amount of training they have to give to these
astronauts to be able to deal with the things the software just can’t do. They
put these astronauts in simulators and give them all these situations and
when things go bad you’ve got this screen and stuff is scrolling through it
and you can’t pause the screen, you can’t go back, you can’t get a summary
of what the important things are. The astronauts just have to be trained to
know, “When I see this happening, here’s what’s really going on.” There are
a hundred messages in a row saying, “This electrical thing has faulted,” and
you train them to say, “OK, that must be because this one original one
faulted and then there was a cascade downstream and all the other ones are
reported.” Why can’t you do that in software rather than train the
astronaut? They don’t try because they don’t want to mess with it.
Seibel: On a different topic, what are your preferred debugging techniques
and tools? Print statements? Formal proofs? Symbolic debuggers?
Norvig: I think it’s a mix and it depends on where I am. Sometimes I’m
using an IDE that has good tracing capability and sometimes I’m just using
Emacs and don’t have all that. Certainly tracing and printing. And thinking.
Writing smaller test cases and watching them go, and breaking the
functionality down to see where the test case failed. And I’ve got to admit, I
often end up rewriting. Sometimes I do that without ever finding the bug. I
get to the point where I can just feel that it’s in this part here. I’m just not
very comfortable about this part. It’s a mess. It really shouldn’t be that way.
Rather than tweak it a little bit at a time, I’ll just throw away a couple
hundred lines of code, rewrite it from scratch, and often then the bug is
gone.