10. Delta debugging Flashcards
General Delta Debugging Algorithm
Divides input into larger blocks and tests all subsets for failures.
smaller and smaller if still failing, remove the passing ones
R
set of possible inputs
rp E R
corresponds to an input that passes
rf E R
corresponds to an input that fails
Change (represented by a backwards 6)
is a mapping R->R which takes one input and changes it to another input
test:Powerset(cf)->
either P, F or ?
Goal of delta debugging
find the smallest test case c such that test(c) = F
global minimum
a failing test case c of cf if every other smaller size test from cf does not cause the test to output F
smallest set of changes which will make the program fail
can require an exponential number of tests
1-minimal
Find a set of changes that cause the failure but removing any change causes the failure to go away
local minimum: failing test case c in cf
if for all c’ in c, test(c’) != F
c’ is all things not c
n-minimal: failing test case c in cf
if for all c’ in c, |c|-|c’| <= n –> test(c’) != F
if the difference in size between c and c’ is less than n then the test function applied to c’ does not return false
1-minimal: failing test case c in cf
if for all changes in c, test(c-{change}) != F
if we remove a change from c and it doesn’t = false
Naive Algorithm for 1 minimal subset
if for all changesI in c, test(c-{changesI}) != F, then c is 1-minimal
else recurse on c-{change} for some change in c, test(c-{change}) = F
Naive Algorithm for 1 minimal worst case runtime
O(N^2)
work is potentially N+ (n-1) + (n-2)…
Minimization algorithms
Start with n=2
partition the set cf into delta1, delta2, …, deltan
define the complement of deltai as updsidedownDeltai=cf - deltai
test each test case defined by each partition and it complement
reduce the test case if a smaller failure inducing set is found, otherwise it refines the partition by n=n*2
minimization algorithm psuedo code
- n=2 and delta as test case
- test each delta and each nambla (upsidedown delta)
- Possible outcomes:
3a. Some deltai causes failure: go to step 1 with delta =deltai and n=2
3b. some namblai causes failure: go to step 1 with delta = namblai and n=n-1
3c. no test causes failure: if granularity can be redefined, go to step1 with delta = delta and n=n*2. If not, Done. Found 1-minimal subset
Example of minimization algo
lesson 10.28
Use case of minimization?
fuzzing input
input find a failure but it is likely huge
so minimize the fuzz input
Delta debugging is fully automatic
False
Delta debugging finds the smallest failing subset of a failing input in polynomial time
false
Delta Debugging finds 1-minimal instead of local minimum test case due to performance
true
delta debugging may find a different sized subset of a failing input depending on the order in which it tests different input partitions
true
delta debugging is also effective at reducing non-deterministically failing inputs
false
Delta debugging bad news
probably must be re-implemented for each significant system to exploit knowledge changes
not portable
delta debugging good news
relatively simple algorithm, big payoff
worth reimplementing