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-class-4-debugging) group on Canvas. (You may work and submit alone, but you must still self-assign to a group on Canvas!)

  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 repository 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.

    Hints:

    If you can’t get your test oracle script to work within 15 minutes, ask the staff for help and move on.

  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 (input lists) that trigger the problem in the original mysort.pl and that have the following properties (see Question 4 below) :

    Delta debugging implementations differ in the order in which they evaluate subsets and complements of the input. Validate your test cases for the provided delta-debugging 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 root cause in Question 1.

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

  4. Provide your two four-line test cases and:

Deliverables

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

  2. The test oracle script you wrote.

Steps for turn-in

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