Skip to content
/ ddmin Public

POC implementation of the ddmin algorithm by Ralf Hildebrandt and Andreas Zeller

License

Notifications You must be signed in to change notification settings

br0ns/ddmin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Failing test case minimizer

This is a POC implementation of the delta debugging algorithm for generating 1-minimal failing test cases. The algorithm is described in:

Simplifying Failure-Inducing Input, Ralf Hildebrandt and Andreas Zeller, 2000.

PDF download.

Demo

Consider bad.py:

#!/usr/bin/env python2

print 'hello there, how are you'

import sys
import os

os.system('ls')

sys.exit(42)

Running this code will result in a non-zero exit code:

$ python bad.py
hello there, how are you
bad.py  ddmin  LICENSE
$ echo $?
42

Let's try to minimize this test case:

$ ddmin -i bad.py -o bad0.py python
...
$ cat bad0.py
v

That was not very helpful. The problem is that ddmin regards any non-zero exit code as a failure, and running the "program" consisting of a single v will make python fail. So let's only regard an exit code of 42 as an error:

$ ddmin -i bad.py -o bad1.py --status 42 python
...
$ cat bad1.py
import sys
sys.exit(42)

Much better. We can also consider the presence of the string "hello there" in the output as an error and get this minimal test case:

$ ddmin -i bad.py -o bad2.py --writes "hello there" python
...
$ cat bad2.py
print'hello there'

About

POC implementation of the ddmin algorithm by Ralf Hildebrandt and Andreas Zeller

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages