top | item 22855633

DustMite: A General-Purpose Data Reduction Tool

66 points| aldacron | 5 years ago |dlang.org

6 comments

order
[+] nn3|5 years ago|reply
Seems like a relatively standard test case reduction tool aimed for D.

The tool reduces test cases to make them easier to debug. It removes pieces from input data and testing each variant to see if it still reproduces the bug.

In the end you have a much smaller reproducer which is easier to debug. Here's a tutorial for gcc [2].

Most serious compilers use one in some shape or form, e.g. delta[1] (which probably was the first widely used one) or creduce[3] (which hugely improved the state of the art for C), and also various descendants reducing on something different (like LLVM bugpoint [4]). A lot of the original ideas go back to Andreas Zeller's delta debugging [5]

Somehow the blog author forgets to mention this rich history.

[1] http://delta.tigris.org/

[2] https://gcc.gnu.org/wiki/A_guide_to_testcase_reduction

[3] http://embed.cs.utah.edu/creduce/

[4] https://llvm.org/docs/Bugpoint.html

[5] https://en.wikipedia.org/wiki/Delta_debugging

[+] abathur|5 years ago|reply
This is cool, in any case.

TL;DR: DustMite feeds reductions/variations of a data set (like your source code) into an oracle which tests if it satisfies some property. The primary example is reducing your source code to a local minimum that still exhibits some compiler failure.

The article's conclusion notes some other cool uses; my favorites were:

- "reducing a large commit to a minimal diff"

- "reducing a commit list, when git bisect is insufficient due to the problem being introduced across more than any single commit;"

- "reducing a large data set to a minimal one, resulting in the same code coverage, with the purpose of creating a test suite;"

- "if you have complete test coverage, it can be used for reducing the source tree to a minimal tree which includes support for only enabled unittests. This can be used to create a version of a program or library with a test-defined subset of features."

[+] InfiniteRand|5 years ago|reply
I would be interested in a performance comparison of delta debugging tools, in my experience the performance of this type of tool has not been great (to be fair I have only tried creduce, delta, and my own coding experiments), although I might give dustmite a try