Note

Starting in delta debugging, slide 43

Delta Debugging

Minimizing Test Cases

  • Global Minimum: the smallest test case that makes a test fail
  • Local Minimum: the smallest test case with respect to itself that causes a test to fail
    • removing one or more items from the failing test case would not create any other smaller test case
  • n-minimal: if making between 1 and n changes from causes the test to no longer fail
  • 1-minimal: if making any single change from c causes the test to no longer fail
  • 2-minimal: if making any 2 changes from c causes the test to no longer fail
  • k-minimal: if making any k changes from c causes the test to no longer fail
    • different than n-minimal, since n-minimal is any 1 to n, and this is exactly k changes

Examples

For the following test cases, the root cause for a failing test case is if it contains 3,4 or 8

Is this a failing test case? Is it the global minimum? Is it a local minimum?

Is this a failing test case? Is it the global minimum? Is it a local minimum?

Is this a failing test case? Is it the global minimum? Is it a local minimum?

Is this a failing test case? Is it the global minimum? Is it a local minimum?

Quiz

A program takes a string of a’s and b’s as input. It crashes on input with an odd number of b’s and an even number of a’s. Write a crashing test case (or NONE if none exists) that is a sub-sequence of input babab and is:

  • smallest
  • 1-minimal, of size 3
  • 2-minimal, of size 3

Remember, a failing test case is 1-minimal if, no matter what change we make, we get a passing test case. 2-minimal is the same but no matter what 2 changes we make, we get a passing test case

Is this 1-minimal? 2-minimal? 3-minimal? Why?

Naive algorithm to find 1-minimal

  • iterate through each change () in c, testing whether set c minus delta i fails or not
    • if every change’s removal causes. the test to stop failing, then c is 1-minimal return c
    • if we find a change delta such that still induces failure, then we call the algorithm recursively on
  • if we start with N elements, then perform up to tests on the ith iteration this is

Improved version

  • divide the set of changes (c) into 2 initially
  • increase the number of subsets if we can’t make progress
  • if we get lucky, search will converge quickly

Minimization algorithm

  • The delta debugging algorithm searches for a **-minimal test case.
  • It partitions the failing configuration into disjoint subsets:

where are pairwise disjoint.

  • the complement of a partition is defined as:

Steps

  1. start with
  2. test each configuration defined by every partition and its complement
  3. if any of these test cases fails, reduce to that failing subset
  4. otherwise, refine the partition:

Quiz

A program crashes when its input contains 42. Fill in the data in each iteration of the minimization algorithm assuming character granularity (and ignore duplicate strings).

Fill in the table:

Iteration
12242424
2
3
4

Note

Ended at slide 60