Reading 9: Debugging
First, we’re going to look at how to avoid debugging – ways to write code that either avoids debugging entirely, or at least makes it easy when we have to do it. But sometimes you have no choice but to debug – particularly when the bug is found only when you plug the whole system together or reported by a user after the system is deployed, in which case it may be hard to localize it to a particular module. For those situations, we can suggest a systematic strategy for more effective debugging. A good book about systematic debugging is Why Programs Fail by Andreas Zeller. Much of this reading is inspired by that book. Also related is “How to Debug” by John Regehr, a lecture from an embedded systems course, which is more low-level than 6.102 but with the same general principles for systematic debugging. Finally, Debugging: The Nine Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems by David Agans is a readable, eminently practical guide to debugging in a
Reading 9: Debugging > hide Snapdown help Snapdown is a language for drawing snapshot diagrams. Click on the links below to see examples of Snapdown in action! In each example, you'll see a snippet of Snapdown syntax and the corresponding diagram side-by-side. Primitives (click to expand) In this example, we have two variables: i points to the value 5 , and s points to the value "abc" . i -> 5 s -> "abc" Objects (click to expand) In this example, f points to a MyFloat object with the value 5.0 , s points to a MyString object with the value "abc" . f -> (MyFloat 5.0) s -> (MyString "abc") Field
Explore this link on the map →related reading
- Reading 9: Avoiding Debuggingweb.mit.edu
- Reading 13: Debuggingweb.mit.edu
- The Debugger's Toolkit - by Addy Osmani - Elevateaddyo.substack.com
- CSC 151 - Hypothesis-driven debuggingeikmeier.sites.grinnell.edu
- Transcript – Debugging: Techniques for Uncertain Times – Chelsea Troychelseatroy.com
- A Bunch of Programming Advice I'd Give To Myself 15 Years Ago | Marcus' Blogmbuffett.com
- Your Debugger Sucksrobert.ocallahan.org
- Computers can be understood - Made of Bugsblog.nelhage.com
- Stepping through code and inspecting variables to isolate bugs | Apple Developer Documentationdeveloper.apple.com
- Debugging Misadventures: Down the Rabbit Holejamie-wong.com
- CS106B Backtracking Warmupweb.stanford.edu
- The Grug Brained Developergrugbrain.dev