The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are...

25
The credit for crea-ng these slides belongs to Fall 2014 CS 521/621 students. Student names have been removed per FERPA regula-ons.

Transcript of The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are...

Page 1: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

The$credit$for$crea-ng$these$slides$belongs$to$Fall$2014$CS$521/621$students.$$Student$names$have$been$removed$per$FERPA$regula-ons.$

Page 2: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Using Likely Invariants for Automated Software

Fault Localization

Page 3: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Do you see the needle?

Page 4: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Would it not be nice to have help finding things?

Page 5: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Motivation

Page 6: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Motivation

●  Software bugs are everywhere!

Page 7: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Motivation

●  Software bugs are everywhere! ●  Bug Detection is the problem of determining whether

the program has bugs.

Page 8: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Motivation

●  Software bugs are everywhere! ●  Bug Detection is the problem of determining whether

the program has bugs. ●  Involves Fault Localization: the problem of identifying

one or more possible locations in the program where code needs to be changed to prevent the failure.

Page 9: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Motivation

●  Software bugs are everywhere! ●  Bug Detection is the problem of determining whether

the program has bugs. ●  Involves Fault Localization: the problem of identifying

one or more possible locations in the program where code needs to be changed to prevent the failure.

●  Debugging is an important but time consuming step, and mostly a manual process.

Page 10: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Research Questions

Page 11: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Research Questions

●  Can we compare program invariants between failing and succeeding input to help narrow down potential bug locations?

Page 12: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Research Questions

●  Can we compare program invariants between failing and succeeding input to help narrow down potential bug locations?

●  Can we further filter the results to give better bug locations without removing the true cause?

Page 13: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Key Idea ●  Train the invariants with a small set of automatically constructed

“good inputs” that are close to a given failing input ●  Compare invariants to find different areas which can be root

causes for bug ●  Use filtering techniques to narrow down candidate root causes to a

small set of final locations o  Use dynamic backward slicing to filter out invariants that do not influence the observed

failure symptom o  Remove dependant instructions to a potentially failing instruction

●  Repeat this for similar failing inputs to compare common failing instructions (not always helpful: removes true root cause)

Page 14: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Code Example: MySQL long calc_daynr( uint year, uint month, uint day) { …. if (month <= 2)

year --; …… return ( delsum +( int ) year/4-temp ) ; } ……. weekday= calc_weekday (calc_daynr(t->year, t->month->day), 0); str->append(loc->d_names->type_names[weekday], …...

Year becomes negative for January 0000 and February 0000

Will return negative

weekday will get a negative value

Buffer overflow and program CRASH

Page 15: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Code Example Cont. ●  Generate successful Year, Month, Day inputs ●  Compare likely invariants to generate candidate root

causes o  ex. str->append(‘-’), weekday, calc_weekday,

calc_daynr ●  Filter root causes

o  output: calc_daynr ●  Compare with other failing inputs

o  if root cause eliminated, examine previous step’s root causes

Page 16: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Summary of Evaluation

Page 17: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Summary of Evaluation The root cause for bug-2 was found in the step after the Dependence filter

Comparing against 2 previously statistical approaches for how many lines of code (LOC) needs to be invested.

Page 18: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Contribution

●  New invariant based approach for fault localization that uses automatically created similar inputs to the failing input

●  Uses effective filtering to narrow down potential bug locations

●  Evaluated work on large input libraries ●  Results show the approach is very effective

Page 19: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Discussion Questions

1.  How do failing invariants help find the root error?

Page 20: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Discussion Questions

1.  How do failing invariants help find the root error? 2.  What problems would arise by using a large general test

suite, compared to a smaller and more precise?

Page 21: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Discussion Questions

1.  How do failing invariants help find the root error? 2.  What problems would arise by using a large general test

suite, compared to a smaller and more precise? 3.  How is Delta debugging incorporated in the technique?

Page 22: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Discussion Questions

1.  How do failing invariants help find the root error? 2.  What problems would arise by using a large general test

suite, compared to a smaller and more precise? 3.  How is Delta debugging incorporated in the technique? 4.  How is Daikon or similar tools be incorporated in the

technique?

Page 23: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Discussion Questions

1.  How do failing invariants help find the root error? 2.  What problems would arise by using a large general test

suite, compared to a smaller and more precise? 3.  How is Delta debugging incorporated in the technique? 4.  How is Daikon or similar tools be incorporated in the

technique? 5.  What are the limitations of the technique?

Page 24: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Discussion Questions

1.  How do failing invariants help find the root error? 2.  What problems would arise by using a large general test

suite, compared to a smaller and more precise? 3.  How is Delta debugging incorporated in the technique? 4.  How is Daikon or similar tools be incorporated in the

technique? 5.  What are the limitations of the technique? 6.  How can we handle the limitations?

Page 25: The$credit$for$crea-ng$these$slides$belongs$to$ Fall$2014 ... · Motivation Software bugs are everywhere! Bug Detection is the problem of determining whether the program has bugs.

Bibliography

Sahoo, Swarup K., John Criswell, Chase Geigle, and Vikram Adve. "Using

Likely Invariants for Automated Software Fault Localization."ACM

SIGARCH Computer Architecture News 41.1 (2013): 139-52. ACM Digital

Library. Web. 30 Oct. 2014. <http://dl.acm.org/citation.cfm?id=2451131>.