Question

What reading would you recommend on general debugging techniques? I am more interested in principles and best practices than in specific platform solutions. For the record I mainly work with .NET (F#, C#), and dabble in Haskell and Ocaml.

One of these Friday evenings we talked about debugging with my colleague on our walk home. I was surprised to learn that one can view and modify the state of live objects from the VisualStudio debugger. He also mentioned that another developer he knew, a "Java guru," had once shown him some debugging magic and given an article or booklet on debugging, which challenged my colleague's initial "there's nothing to it" attitude. Having spent more time than I wished hunting bugs, I am ready to be challenged as well. Are there any links you would recommend?

Was it helpful?

Solution

I've studied a lot of debugging books and thoughts. Probably the best one is Debugging By Thinking. I think it covers everything that needs to be said, in a logical fashion, in an easy-to-read package.

OTHER TIPS

I'd recommend reading everything you can find on Test-driven development (TDD). From the Wikipedia article:

Programmers using pure TDD on new ("greenfield") projects report they only rarely feel the need to invoke a debugger.

From a personal standpoint, it's been my experience that the more unit tests I write, the less time I spend in the debugger.

Specifically for .NET, here's a nice article on Easier Debugging with Attributes.

I highly recommend the excellent book Debugging by David Agans.

While not specifically about programming, the principles are universal. One of the techniques in here provided the biggest quantum leap in my diagnostic capabilities, namely, backing out your fix to prove that just your fix has corrected the problem.

It takes a native approach (win32) but Advanced Windows Debugging is a great book.

I like Ian Taylor's.

Tess Ferrandez's blog If broken it is, fix it you should is both directly relevant to specific real-life scenarios you're likely to encounter in .Net debugging, (typically involving ASP.Net), and more generally thought provoking.

John Robbins' debugging books and blog are similarly worth reading.

Mike Stall's .Net Debugging Blog likewise.

Mark Russinovich's blog is remarkable - his knowledge of Windows internals combined with great forensic skill is impressive.

My first introduction to debugging was this tutorial. It uses GDB to debug a sample C++ code, but the principles are generally applicable. The thing I really like is the way the author explains his train of thought about what might be wrong, and then the specific commands needed to test the possibilities. It's pretty fun! If you're new to debugging, it's a great insight into the process.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top