Skip to main content
Engineering LibreTexts

8.3.1: Debugging Theorems

  • Page ID
    97137
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

      Here are the Theorems of Debugging all in one place:

       

      The First Theorem of Debugging: (Section 1.2)

      Readable code is debuggable code.

      The Second Theorem of Debugging: (Section 1.4)

      The only thing worse than getting an error message is not getting an error message.

      The Third Theorem of Debugging: (Section 2.5)

      Be sure that the code you are running is the code you think you are running.

      The Fourth Theorem of Debugging: (Section 2.6)

      Error messages tell you where the problem was discovered, not where it was caused.

      The Fifth Theorem of Debugging: (Section 3.1)

      The best way to avoid a bug is to make it impossible.

      The Sixth Theorem of Debugging: (Section 3.9)

      The best kind of debugging is the kind you don’t have to do.

      The Seventh Theorem of Debugging: (Section 10.2)

      The worst bugs aren’t in your code; they’re in your head.

      The Eighth Theorem of Debugging: (Section 8.3)

      Finding a hard bug requires reading, running, ruminating, and sometimes retreating.

      If you get stuck on one of these activities, try the others.

       


      This page titled 8.3.1: Debugging Theorems is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Allen B. Downey (Green Tea Press) .

      • Was this article helpful?