In-class exercise Delta Debugging: Instructions

High-level goal

The high-level goal of this exercise is to learn about automated debugging and how to use the delta debugging approach to systematically isolate failure-inducing inputs.

Set up

  1. Team up in groups of size 2.

  2. Assign yourself to the correct (In-class4-Debugging) group on Canvas. (If you are in a Canvas group of size 1, you can still submit.)

  3. Make sure that you are using a Unix environment (e.g., attu.cs.washington.edu or OSX) or git bash for Windows for this exercise.

  4. Clone the following Git repository: https://bitbucket.org/rjust/delta-debugging (Clone the repo into a directory whose absolute path does not contain any white spaces.)

Instructions

  1. Read the entire assignment and ask any clarifying questions that you might have.

  2. In the top-level directory (delta-debugging), run:

Background (story time)

A fellow developer hands you a legacy program (mysort.pl), written in Perl. The program works most of the time, but your fellow developer ran into a problem with it. In the spirit of following best practices, they provided instructions with a concrete test case that shows the problem (point 1 above).

Unfortunately, the provided test case isn’t quite minimal and your Perl skills are a little rusty. So, you decide to delta-debug (i.e., minimize) the test case first, before even thinking about the program itself. Luckily, you already have access to a delta-debugging implementation (delta-debugging/delta), so you “only” need to get it to work for this particular problem.

Now what?

  1. Use delta debugging to minimize failing.txt. A wrapper script dd-wrapper.sh for the delta command is provided, but you need to write a test oracle script that executes mysort.pl. Replace the <your test oracle script> in dd-wrapper.sh with your own script. Note that you can write your script in any way and any programming language you want. Also note that the delta command executes your test oracle script in a subdirectory like tmp0/arena/. You may need to take this into account when working with relative paths and calling mysort.pl from within your script.

    Hints:

  2. Using the minimized test case, debug and fix the issue in mysort.pl. (See Questions 1-3 below)

  3. Manually create two test cases (see Question 4 below) that trigger the problem in the original mysort.pl and that have the following properties:

    Delta debugging implementations differ in the order in which they test chunks of the input. Validate your test cases for the provided implementation.

Questions

  1. What is the root cause of the bug in mysort.pl?

  2. Give a one sentence explanation to characterize all test cases (input lists) on which mysort.pl fails because of the reason in 1.

  3. Provide a fix to the bug as unified diff (use git diff).

  4. Provide your two four-line test cases and, for each test case, list all steps of the delta-debugging algorithm (provided implementation). Briefly explain why these test cases are the best and worst case, respectively.

Deliverables

  1. The test oracle script you wrote.

  2. A plain-text file with your answers to the four questions above. Please list all group members.

Steps for turn-in

One team member should upload the deliverables to Canvas, via the Canvas submission site for this course.