How we use binary search to find compiler bugs
bernsteinbear.com
bernsteinbear.com
Here's the citation, abstract and link to a PDF copy:
Simplifying and isolating failure-inducing input Andreas Zeller, Ralf Hildebrandt IEEE Transactions on Software Engineering 28 (2), 183-200, 2002
Given some test case, a program fails. Which circumstances of the test case are responsible for the particular failure? The delta debugging algorithm generalizes and simplifies the failing test case to a minimal test case that still produces the failure. It also isolates the difference between a passing and a failing test case. In a case study, the Mozilla Web browser crashed after 95 user actions. Our prototype implementation automatically simplified the input to three relevant user actions. Likewise, it simplified 896 lines of HTML to the single line that caused the failure. The case study required 139 automated test runs or 35 minutes on a 500 MHz PC.
http://cs.purdue.edu/homes/xyzhang/fall07/Papers/delta-debug...
Edit: adjusted tone
http://blog.ezyang.com/2011/06/debugging-compilers-with-opti...
Dustmite (say thank you to cybershadow) is the D community's beloved test case reduction tool
The problem is we don't know if compiling with these functions follows the monotonicity of binary searching: what if a problem is caused by a special combination of two functions? You have to arrange these two functions in the right order in order to find the problem.
I heard of it from when I first started programming and I cut the code in half (maybe 3rds or other units, close enough) until I found which part was breaking the program.
What if the bad outcome only happens when two or more elements are enabled?
Is there a generalization of binary search for powersets?
Can this be done efficiently?
Assuming this works, it should be optimal: if you’re only getting a binary outcome at each step, you’ll never do better than lg(2^n) = n.