Hacker News new | past | comments | ask | show | jobs | submit login
Delta Debugging (wikipedia.org)
29 points by yters on Feb 5, 2011 | hide | past | favorite | 8 comments

"git bisect" is one of the most useful and overlooked debugging tools.


I was so happy the first time I traced down a bug with bisect, it seemed like magic.

I use a hacked/extended version of:


For all kinds of reductions, mainly code which causes compiler failures.

It is easy to burn a huge amount of CPU time with reductions (large C++ testcases can take a couple of days), it is just important to remember you are saving brain-time, and resist the urge to try to "help" it along.

Chapter 28 in Beautiful Code (http://www.amazon.com/Beautiful-Code-Leading-Programmers-Pra...) talks about delta debugging, how it was invented and developed. its really a great chapter in a great book. i can't recommend it enough.

This chapter actually has a much cooler implementation of delta debugging that what has been discussed here. We're generally thinking of delta debugging in which we take the changes to the source as the search space and use some form of binary search to find the offending change (for which git bisect is great). The chapter in beautiful code begins with this but then moves on to runtime delta debugging in which the techniques are used to compare the memory in use by two instances of the program (one buggy and one not) until a specific piece of the programs state can be isolated as the cause.

It's a fascinating technique -- lots of applications. Andreas Zeller has been doing this for almost a decade now so I'm very surprised it hasn't caught on more.

Is anybody looking at combining delta debugging with Optimizely?

The following page (indirectly linked to from the Wikipedia page) has more in-depth information:


Smalltalk's Change Log is great for this. You can actually just take the list of changes and run binary search for the error, and this will lead you directly to the bug 4 times out of 5. (You can do this with StORE as well.)

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact