Skip to content

In-class Assignment 1

In class assignment 1 (due Friday 11:59). Note that this one replaces and extends the in-class assignment 1 you did on Tuesday.

Part 1: Delta Debugging (DD)

  • Apply DD to the following 4 inputs. YOU MUST SHOW ALL STEPS
  abcdef*g   :  fail whenever input contains *
  *abcdef*   :  fail whenever input contains (both) **
  abcdef     :  fail whenever input contains abcdef
  ab*cdef     :  fail whenever input contains  bde
  • Answer the following questions: given an original failure input of size N,
  • what is the worst case run time complexity of DD? Why? Give an example input of size 6 to demonstrate this worst case behavior?
  • what is the best case run time of complexity DD? Why? Give an example input of size 6 to demonstrate this best case behavior?

Part 2: Statistical Debugging

  • Use the Tarantula formula learned in class (also shown below) to compute the suspicious scores for all 12 lines in the following Python median function. Use this pdf for tests and coverage information.
Score(s) =                     #bad tests hitting(s) / # of bad tests
               -----------------------------------------------------------------------------------
             #bad tests hitting(s) / # of bad tests   +   # good tests hitting(s)  / # of good test


Note that if the denominator (divisor) is 0,  then the score is 0.
def median(x, y, z):
    print("input ", x, y, z)      #1
    m = z                         #2
    if y < z:                     #3
        if x < y:                 #4
            m = y                 #5
        elif x < z:               #6
            m = y                 #7
    else:                         #8
        if x > y:                 #9
            m = z                 #10
        elif x > z:               #11
            m = x                 #12

return m