Improved Debugging Using Automatic Fault-localization Techniques - - PDF document

improved debugging using automatic fault localization
SMART_READER_LITE
LIVE PREVIEW

Improved Debugging Using Automatic Fault-localization Techniques - - PDF document

Improved Debugging Using Automatic Fault-localization Techniques Mary Jean Harrold ADVANCE Professor of Computing Georgia Institute of Technology Supported by NSF, NASA Boeing Commercial Airplanes, Tata Consultancy Services MASPLAS 2007 My


slide-1
SLIDE 1

1

MASPLAS 2007

Mary Jean Harrold ADVANCE Professor of Computing Georgia Institute of Technology

Improved Debugging Using Automatic Fault-localization Techniques

Supported by NSF, NASA Boeing Commercial Airplanes, Tata Consultancy Services

MASPLAS 2007

Summer 2006

Postdoc

  • Carsten Görg

Graduate students

  • Ahmed Ghiduk
  • Saswat Anand
  • Term Apiwattanapong
  • George Baah
  • Jim Jones
  • Irina Kishiniovski
  • Paul Li
  • Raul Santelices
  • Hina Shah
  • Yanbing Yu

Research Scientists

  • Rashmitha Bupathi
  • Pavan Kumar Chittimalli

Aristotle Research Group

My Research Group

slide-2
SLIDE 2

2

MASPLAS 2007

Denver Airport Baggage System (1995): $280M Ariane 5 Explosion (1996): $7B

High Cost of Software Failure

Mars Rover (2004): Unknown cost

MASPLAS 2007

Denver Airport Baggage System (1995): $280M Ariane 5 Explosion (1996): $7B

High Cost of Software Failure

Mars Rover (2004): Unknown cost

Software bugs are costing the U.S. economy an estimated $59.5 billion each year. Improvements in testing and debugging could reduce this cost by about a third, or $22.5 billion.

(from NIST Estimated Planning Report 02-3)

slide-3
SLIDE 3

3

MASPLAS 2007

Usage scenarios

Nightly-build process

  • Run set tests (regression,

breadth) each night

  • Report pass/fail status

Test-driven development

  • Create and run tests

(regression, breadth) after changes

  • Report pass/fail status

Regression testing

  • Run regression tests after

changes

  • Report pass/fail status

Testing and Debugging Fault Localization

Use fault-localization to identify most likely faulty parts of the software

MASPLAS 2007

Research Projects

  • Introduction
  • Fault localization—Tarantula
  • General technique
  • Visualization and demo
  • Test-case clustering to improve efficiency
  • Related work
  • Conclusion

Outline of Talk

slide-4
SLIDE 4

4

MASPLAS 2007

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = y; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); }

General Technique—Tarantula

MASPLAS 2007

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = y; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); }

Technique uses Dynamic information

  • statements executed
  • outcome (pass/fail)

Statistical analysis

  • computes suspiciousness
  • f each statement

General Technique—Tarantula

Intuition: Statements primarily executed by failed test cases are more suspicious than statements primarily executed by passed test cases

slide-5
SLIDE 5

5

MASPLAS 2007

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h h h h h h h h P P F F F t1 t2 t3 t4 t5 t6 t7 t8 t9 t10

General Technique—Tarantula

MASPLAS 2007

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h h h h h h h h P P F F F suspiciousness

General Technique—Tarantula

slide-6
SLIDE 6

6

MASPLAS 2007

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h h h h h h h h P P F F F suspiciousness 0.60 0.50 0.50 0.43 0.00 0.50 0.60 0.60 0.75 0.00 0.00 0.50 0.50

50 . 4 4 6 6 4 4 ) 1 ( = + = susp

General Technique—Tarantula

MASPLAS 2007

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h h h h h h h h P P F F F suspiciousness 0.60 0.50 0.50 0.43 0.00 0.50 0.60 0.60 0.75 0.00 0.00 0.50 0.50

60 . 4 2 6 2 4 2 ) 7 ( = + = susp

General Technique—Tarantula

slide-7
SLIDE 7

7

MASPLAS 2007

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h h h h h h h h P P F F F suspiciousness 0.60 0.50 0.50 0.43 0.00 0.50 0.60 0.60 0.75 0.00 0.00 0.50 0.50 rank 5 5 5 10 11 5 2 2 2 1 11 11 5 mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); }

General Technique—Tarantula

MASPLAS 2007

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h h h h h h h h P P F F F suspiciousness 0.60 0.50 0.50 0.43 0.00 0.50 0.60 0.60 0.75 0.00 0.00 0.50 0.50 rank mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } //bug;correct m=y

General Technique—Tarautula

5 5 5 10 11 5 2 2 2 1 11 11 5

slide-8
SLIDE 8

8

MASPLAS 2007

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = y; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h h h h h h h h P P P F P //fixed suspiciousness rank

General Technique—Tarantula

MASPLAS 2007

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = y; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h h h h h h h h P P P F P //bug;correct:m=x; //fixed suspiciousness 0.50 0.50 0.50 0.67 0.00 0.73 0.80 0.00 0.00 0.00 0.00 0.00 0.50 rank 4 4 4 3 8 2 1 8 8 8 8 8 4

General Technique—Tarantula

slide-9
SLIDE 9

9

MASPLAS 2007

h h h h h h h t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = x; 8:else 9: if (x>y) 10: m = y; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P P h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h P P P P P //fixed //fixed suspiciousness rank h h h h h h h 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

General Technique—Tarantula

MASPLAS 2007

Measure

Percentage of program to be examined to find fault

Subjects

Empirical Study

1054 23 440 Tot_info 13585 33 6000 Space 141 301 292 512 399 472 LOC 1578 41 Tcas 2680 10 Schedule_2 2650 9 Schedule 5542 32 Replace 4071 10 Print_tokens_2 4056 7 Print_tokens Test Cases Faulty Versions (single fault) Program

Siemens Suite

slide-10
SLIDE 10

10

MASPLAS 2007

Method

  • For each program and test suite, compute

suspiciousness of each statement using Tarantula

  • Compute percentage of program examined to find

fault, using suspiciousness to order search

  • Use results of published studies on same subjects

Techniques compared

  • Tarantula [Jones, Harrold, Stasko, ICSE02,ASE05]
  • Set-based, Nearest Neighbor [Renieris, Reiss, ASE03]
  • Cause Transitions [Cleve, Zeller, ICSE05]
  • Statistical [Liblit et al., PLDI05]

Empirical Study

MASPLAS 2007

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h h h h h h h h P P F F F suspiciousness 0.60 0.50 0.50 0.43 0.00 0.50 0.60 0.60 0.75 0.00 0.00 0.50 0.50 % program examined 75 75 75 83 100 75 33 33 33 1 100 100 75 mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); }

General Technique—Tarantula

slide-11
SLIDE 11

11

MASPLAS 2007

0 20 40 60 80 100 % of program to be examined to find fault % of faulty versions 20 40 60 80 100

Ideal technique Worst technique

Reporting Technique

MASPLAS 2007

0 20 40 60 80 100 % of faulty versions 20 40 60 80 100

Nearest Neighbor (1) Nearest Neighbor (2) Cause Transitions Tarantula Statistical Set based

Results on Siemens

0 20 40 60 80 100 % of program to be examined to find fault

slide-12
SLIDE 12

12

MASPLAS 2007

  • Generalization
  • Single fault (more later)

0 20 40 60 80 100 % of program examined to find fault % of faulty versions 20 40 60 80 100

Tarantula on Siemens Tarantula on Space

Threats to Validity

MASPLAS 2007

Research Projects

  • Introduction
  • Fault localization—Tarantula
  • General technique
  • Visualization and demo
  • Test-case clustering to improve efficiency
  • Related work
  • Conclusion

Outline of Talk

slide-13
SLIDE 13

13

MASPLAS 2007

Visualization

Hue (color) summarizes pass/fail results of test cases that executed s For statement s:

Least suspicious Most suspicious

MASPLAS 2007

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h h h h h h h h P P F F F suspiciousness 0.60 0.50 0.50 0.43 0.00 0.50 0.60 0.60 0.75 0.00 0.00 0.50 0.50 9 9 9 10 13 9 4 4 4 1 13 13 9

Coloring Statements

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); }

slide-14
SLIDE 14

14

MASPLAS 2007

SeeSoft view

  • each pixel represents a character in the source

}

File-level View

mid() { int x,y,z,m; read(“Enter 3 integers:”,x,y,z); m = z; if (y<z) if (x<y) m = y; else if (x<z) m = y; else if (x>y) m = z; else if (x>z) m = x; print(“Middle number is:”, m);

MASPLAS 2007

File-level View

SeeSoft view

  • each pixel represents a character in the source
slide-15
SLIDE 15

15

MASPLAS 2007

System-level View

TreeMap view

  • each node
  • represents a file
  • is divided into blocks representing color of

statements

MASPLAS 2007

Tarantula

slide-16
SLIDE 16

16

MASPLAS 2007

Research Projects

  • Introduction
  • Automatic fault localization—Tarantula
  • General technique
  • Visualization
  • Test-case clustering to improve efficiency
  • Related work
  • Conclusion

Outline of Talk

MASPLAS 2007

Improving Fault-localization Efficiency

P Execute Debug failed tests P’ all tests pass Execute Debug failed tests P’’ Pi is failure-free Execute …

  • Are all failing tests caused by the same fault?
  • Are all failing tests caused by the same fault?
  • Can we associate groups of tests with different

faults?

  • Are all failing tests caused by the same fault?
  • Can we associate groups of tests with different

faults?

  • Can we reduce debugging effort by considering

these groups individually?

  • Are all failing tests caused by the same fault?
  • Can we associate groups of tests with different

faults?

  • Can we reduce debugging effort by considering

these groups individually?

  • Can we reduce debugging effort by considering

these groups simultaneously?

slide-17
SLIDE 17

17

MASPLAS 2007

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h h h h h h h h P P F F F t1 t2 t3 t4 t5 t6 t7 t8 t9 t10

Improving Fault-localization Efficiency

MASPLAS 2007

3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h h Pass/fail Status 3,2,1 2,1,3 5,4,2 5,2,6 h h h h h h h h h h h h h h h h h h h h h P P F F F mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } t1 t2 t3 t4 t5 t6 t7 t8 t9 t10

Improving Fault-localization Efficiency

h h h h h h h

slide-18
SLIDE 18

18

MASPLAS 2007

Debugging Process

P Execute Debug failed tests P’ all tests pass Execute Debug failed tests P’’ Pi is failure-free Pj is failure-free Execute … P Execute Debug some failed tests P’ all tests pass Execute some failed tests…

MASPLAS 2007

Debugging Process

P Execute Debug failed tests P’ all tests pass Execute Debug failed tests P’’ Pi is failure-free Pj is failure-free Execute … P Execute Debug some failed tests P’ all tests pass Execute some failed tests… Execute P Debug Debug P’ all tests pass

Pk is failure-free s

  • m

e f a i l e d t e s t s some failed tests

slide-19
SLIDE 19

19

MASPLAS 2007

Debugging Process

P Execute Debug failed tests P’ all tests pass Execute Debug failed tests P’’ Pi is failure-free Pj is failure-free Execute … P Execute Debug some failed tests P’ all tests pass Execute some failed tests… Execute P Debug Debug P’ all tests pass

s

  • m

e f a i l e d t e s t s some failed tests

Potential costs

  • Overhead to partition test

cases

  • Multiple debuggers

(developers)

Pk is failure-free

Potential benefits

  • Reduced time to failure-free

program Potential benefits

  • Reduced time to failure-free

program

  • Less “noise” in locating each

fault

  • Better utilization of developer

effort

MASPLAS 2007

Debugging Process

P Execute Debug failed tests P’ all tests pass Execute Debug failed tests P’’ Pi is failure-free Pj is failure-free Execute … P Execute Debug some failed tests P’ all tests pass Execute some failed tests… Execute P Debug Debug P’ all tests pass

Pk is failure-free s

  • m

e f a i l e d t e s t s some failed tests

Crucial problem:

  • Partitioning failed tests into

groups of similar behavior— focus on different faults

  • fault-focusing clusters

Crucial problem:

  • Partitioning failed tests into

groups of similar behavior— focus on different faults

  • fault-focusing clusters of failed

test cases

slide-20
SLIDE 20

20

MASPLAS 2007

Fault-focusing Clusters—Overview

t06 t07 t09 t08 t10 t04 t02 t05 t01 t03

Fault-focusing clusters:

  • Clusters of failing test cases
  • Clusters failing in similar way
  • Each cluster targeting a different fault

Test Cases

MASPLAS 2007

Fault-focusing Clusters

t07 t09 t08 t10

Specialized Test Suites

t06 t04 t02 t05 t01 t03 t06 t04 t02 t05 t01 t03

Specialized test suites: Fault-focusing clusters combined with passing test cases

slide-21
SLIDE 21

21

MASPLAS 2007

Fault-focusing Clusters

t07 t09 t08 t10

Specialized Test Suites

Developer Developer t06 t04 t02 t05 t01 t03 t06 t04 t02 t05 t01 t03

Specialized test suites: Fault-focusing clusters combined with passing test cases Specialized test suites: Fault-focusing clusters combined with passing test cases

  • Find faults one at a

using specialized test suites

MASPLAS 2007

Fault-focusing Clusters

t07 t09 t08 t10 t06 t04 t02 t05 t01 t03

Test Cases

t06 t04 t02 t05 t01 t03

Specialized Test Suites

Developer 1 Developer 2 t06 t04 t02 t05 t01 t03 t06 t04 t02 t05 t01 t03

Specialized test suites: Fault-focusing clusters combined with passing test cases

  • Find faults one at a

using specialized test suites

  • Find faults at the same

time (in parallel) using specialized test suites

slide-22
SLIDE 22

22

MASPLAS 2007

Fault-focusing Clusters

Execution Clustering Fault Localization

failed test cases execution information specialized test suites suspiciousness and ranks

MASPLAS 2007

Fault-focusing Clusters

Clustering by behavior models Dynamic information

  • profiles (branch, method-method, …)
  • only failed tests

Statistical analysis, machine learning

  • generate models for each execution
  • cluster models

Fault-localization for stopping point Execution Clustering Fault Localization

failed test cases execution information specialized test suites suspiciousness and ranks

slide-23
SLIDE 23

23

MASPLAS 2007

t07-09 t07-09-08-10 t08-010

Clustering Behavior Models

Most difficult problem of clustering is determining a good stopping criterion?

t07 t08 t09 t10

MASPLAS 2007

t07-09 t07-09-08-10 t08-010

Clustering Behavior Models

  • Models: discrete-time Markov chains (DTMCs) from profiles

(branch, method,…)

  • Clustering: iterative with two most similar according to Sim1

Sim1: sum of absolute difference between matching transitions in DTMCs being compared t07 t08 t09 t10

slide-24
SLIDE 24

24

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10

B A B A Sim U I = 2

slide-25
SLIDE 25

25

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10

t06 t08 t07 t04 t09 t02 t05 t01 t03 t10

t07-09-08-10

B A B A Sim U I = 2

rank

MASPLAS 2007

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F

  • Pass/fail Status

3,2,1 2,1,3 5,4,2 5,2,6

  • P P F

F F

Tarantula: Fault Localization

//bug //bug suspiciousness 0.50 0.50 0.50 0.43 0.00 0.50 0.60 0.60 0.60 0.75 0.00 0.00 0.50 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10

slide-26
SLIDE 26

26

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10

t06 t08 t07 t04 t09 t02 t05 t01 t03 t10

t07-09-08-10

10 9 8 7

t06 t07 t04 t09 t02 t05 t01 t03

t07-09

B A B A Sim U I = 2

rank rank

MASPLAS 2007

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P

  • Pass/fail Status

3,2,1 5,4,2

  • P P F

F

Fault-focusing Cluster 1

//bug //bug suspiciousness 0.50 0.50 0.50 0.00 0.00 0.00 0.00 0.75 0.75 0.86 0.00 0.00 0.50 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10

slide-27
SLIDE 27

27

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10

t06 t08 t07 t04 t09 t02 t05 t01 t03 t10

t07-09-08-10

10 9 8 7

t06 t07 t04 t09 t02 t05 t01 t03

t07-09

10 9 8 1 B A B A Sim U I = 2

5 3 2 = Sim

rank rank .60

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10

t06 t08 t07 t04 t09 t02 t05 t01 t03 t10

t07-09-08-10

10 9 8 7

t06 t08 t04 t10 t02 t05 t01 t03

t08-10

B A B A Sim U I = 2

rank rank .60

slide-28
SLIDE 28

28

MASPLAS 2007

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F

  • Pass/fail Status

2,1,3 5,2,6

  • P P

F //bug //bug suspiciousness 0.50 0.50 0.50 0.60 0.00 0.67 0.75 0.00 0.00 0.00 0.00 0.00 0.50

Fault-focusing Cluster 2

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10

t06 t04 t10 t02 t05 t01 t03

t08-10

7 6 4 1 B A B A Sim U I = 2

7 1 2 = Sim

t06 t08 t07 t04 t09 t02 t05 t01 t03 t10

t07-09-08-10

10 9 8 7

rank rank .14 .60

t08

slide-29
SLIDE 29

29

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10

B A B A Sim U I = 2

.14 .60

7 6 4 1

rank

t06 t04 t10 t02 t05 t01 t03

t08-10

t08 t06 t04 t02 t05 t01 t03

t08

7 6 4 1

rank

t08

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10

B A B A Sim U I = 2

.14 .60

7 6 4 1

rank

t06 t04 t10 t02 t05 t01 t03

t08-10

t08

slide-30
SLIDE 30

30

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10

B A B A Sim U I = 2

4 4 2 = Sim

.14 .60 1.00

7 6 4 1

rank

t06 t04 t10 t02 t05 t01 t03

t08-10

t08

rank

t06 t04 t02 t05 t01 t03

t08

7 6 4 1

rank

t08

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10

B A B A Sim U I = 2

4 4 2 = Sim

.14 .60 1.00

7 6 4 1

rank

t06 t04 t10 t02 t05 t01 t03

t08-10

t08

rank

t06 t04 t02 t05 t01 t03

t10

7 6 4 1

rank

t10

1.00

slide-31
SLIDE 31

31

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10 .14 .60 1.00 1.00

  • Composite is similar (above threshold) to

both of its constituents so clustering stops at this level

  • Result is two clusters: {t07, t09}, {t08, t10}

MASPLAS 2007

Fault Localization for Stopping Point

t07-09 t07-09-08-10 t08-10 t07 t08 t09 t10 .14 .60 1.00 1.00

  • Composite is similar (above threshold) to

both of its constituents so clustering stops at this level

  • Result is two clusters: {t07, t09}, {t08, t10}
slide-32
SLIDE 32

32

MASPLAS 2007

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P

  • Pass/fail Status

3,2,1 5,4,2

  • P P F

F

Fault-focusing Cluster 1

//bug //bug suspiciousness 0.50 0.50 0.50 0.00 0.00 0.00 0.00 0.75 0.75 0.86 0.00 0.00 0.50 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10

MASPLAS 2007

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”,x,y,z); 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”, m); } 3,3,5 1,2,3 3,2,2 5,5,5 1,1,4 5,3,4 P P P P F

  • Pass/fail Status

2,1,3 5,2,6

  • P P

F //bug //bug suspiciousness 0.50 0.50 0.50 0.60 0.00 0.67 0.75 0.00 0.00 0.00 0.00 0.00 0.50

Fault-focusing Cluster 2

t1 t2 t3 t4 t5 t6 t7 t8 t9 t10

slide-33
SLIDE 33

33

MASPLAS 2007

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”… 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”… } //bug //bug

Visualization of Specialized Test Suites

mid() { int x,y,z,m; 1:read(“Enter 3 integers:”… 2:m = z; 3:if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; 8:else 9: if (x>y) 10: m = z; 11: else if (x>z) 12: m = x; 13:print(“Middle number is:”… } //bug //bug

Cluster 1 Cluster 2

MASPLAS 2007

Metrics for Evaluation

E: Expense (developer effort): number of statements examined to find fault D: Total developer effort (total person hours): sum of developer effort for each fault in the program FF: Total effort to failure-free program (time to failure -free): sum of maximum developer effort at each iteration (critical path to failure-free)

statement

  • f

rank

slide-34
SLIDE 34

34

MASPLAS 2007

Metrics for Evaluation

E: Expense (developer effort): number of statements examined to find fault D: Total developer effort (total person hours): sum of developer effort for each fault in the program FF: Total effort to failure-free program (time to failure -free): sum of maximum developer effort at each iteration (critical path to failure-free)

statement

  • f

rank

Fault 1 Fault 2 Fault 3

MASPLAS 2007

Metrics for Evaluation

E: Expense (developer effort): number of statements examined to find fault D: Total developer effort (total person hours): sum of developer effort for each fault in the program FF: Total effort to failure-free program (time to failure -free): sum of maximum developer effort at each iteration (critical path to failure-free)

statement

  • f

rank

Fault 1 Fault 3 Fault 2

slide-35
SLIDE 35

35

MASPLAS 2007

Metrics for Evaluation

E: Expense (developer effort): number of statements examined to find fault D: Total developer effort (total person hours): sum of developer effort for each fault in the program FF: Total effort to failure-free program (time to failure -free): sum of maximum developer effort at each iteration (critical path to failure-free)

statement

  • f

rank

Fault 1 Fault 2 Fault 3 Fault 4 Fault 5 Fault 6

MASPLAS 2007

Metrics for Evaluation

E: Expense (developer effort): number of statements examined to find fault D: Total developer effort (total person hours): sum of developer effort for each fault in the program FF: Total effort to failure-free program (time to failure -free): sum of maximum developer effort at each iteration (critical path to failure-free)

statement

  • f

rank

Fault 1 Fault 2 Fault 3 Fault 4 Fault 5 Fault 6

slide-36
SLIDE 36

36

MASPLAS 2007

Metrics for Evaluation

E: Expense (developer effort): number of statements examined to find fault D: Total developer effort (total person hours): sum of developer effort for each fault in the program FF: Total effort to failure-free program (time to failure -free): sum of maximum developer effort at each iteration (critical path to failure-free)

statement

  • f

rank

= faults 1 i

E

i

MASPLAS 2007

Metrics for Evaluation

E: Expense (developer effort): number of statements examined to find fault D: Total developer effort (total person hours): sum of developer effort for each fault in the program FF: Total effort to failure-free program (time to failure -free): sum of maximum developer effort at each iteration (critical path to failure-free)

statement

  • f

rank

= faults 1 i

E

i Fault 1 Fault 2 Fault 3

slide-37
SLIDE 37

37

MASPLAS 2007

Metrics for Evaluation

E: Expense (developer effort): number of statements examined to find fault D: Total developer effort (total person hours): sum of developer effort for each fault in the program FF: Total effort to failure-free program (time to failure -free): sum of maximum developer effort at each iteration (critical path to failure-free)

statement

  • f

rank

= faults 1 i

E

i Fault 1 Fault 3 Fault 2

MASPLAS 2007

Metrics for Evaluation

E: Expense (developer effort): number of statements examined to find fault D: Total developer effort (total person hours): sum of developer effort for each fault in the program FF: Total effort to failure-free program (time to failure -free): sum of maximum developer effort at each iteration (critical path to failure-free)

statement

  • f

rank

= faults 1 i

E

i Fault 1 Fault 2 Fault 3 Fault 4 Fault 5 Fault 6

slide-38
SLIDE 38

38

MASPLAS 2007

Metrics for Evaluation

E: Expense (developer effort): number of statements examined to find fault D: Total developer effort (total person hours): sum of developer effort for each fault in the program FF: Total effort to failure-free program (time to failure -free): sum of maximum developer effort at each iteration (critical path to failure-free)

statement

  • f

rank

= faults 1 i

E

i Fault 1 Fault 2 Fault 3 Fault 4 Fault 5 Fault 6

MASPLAS 2007

Metrics for Evaluation

E: Expense (developer effort): number of statements examined to find fault D: Total developer effort (total person hours): sum of developer effort for each fault in the program FF: Total effort to failure-free program (time to failure -free): sum of maximum developer effort at each iteration (critical path to failure-free)

statement

  • f

rank

= faults 1 i

E

i

} | E { max

iteration th at the clusters

  • f

number the is

ij iterations 1

i j

i

=

slide-39
SLIDE 39

39

MASPLAS 2007

Empirical Study

Variables

NSTS: Finding faults using non-specialized test suites STS-S: Finding faults using specialized test suites STS-P: Finding faults using specialized test suites in parallel

Measures

D: total developer effort FF: total effort to failure-free program

Subject

SPACE

  • 6000 LOC
  • 100 8-fault versions; > 1000 derivative versions)

Method

For each of 100 8-fault versions, debug until failure-free, using

  • Non specialized test suite
  • Specialized test suite both sequential and parallel

MASPLAS 2007

D 5 10 15 20 25 30 35 40 D D 36.3 26.2 26.2 NSTS STS-S STS-P

Summary of Results

D

slide-40
SLIDE 40

40

MASPLAS 2007

D 5 10 15 20 25 30 35 40 D D 36.3 26.2 26.2 NSTS STS-S STS-P

Summary of Results

D

  • Using specialized test suites based on fault-focusing

clusters reduces developer effort, on average, over not using specialized test suites

  • Benefit holds when performing
  • fault localization sequentially (one developer)
  • fault localization in parallel (multiple developers)

MASPLAS 2007

D 5 10 15 20 25 30 35 40 D D 36.3 26.2 26.2 NSTS STS-S STS-P F F 5 10 15 20 25 30 35 40 FF FF 36.3 26.2 18.3 NSTS STS-S STS-P

Summary of Results

D FF

slide-41
SLIDE 41

41

MASPLAS 2007

D 5 10 15 20 25 30 35 40 D D 36.3 26.2 26.2 NSTS STS-S STS-P F F 5 10 15 20 25 30 35 40 FF FF 36.3 26.2 18.3 NSTS STS-S STS-P

Summary of Results

D FF

  • Using specialized test suites based on fault-focusing

cluster can reduce time to a failure-free program, on average, over not using specialized test suites

  • Benefit holds when performing
  • fault localization sequentially (one developer)
  • fault localization in parallel (multiple developers)

MASPLAS 2007

Research Projects

  • Introduction
  • Automatic fault localization—Tarantula
  • General technique
  • Visualization and demo
  • Test-case clustering to improve efficiency
  • Related work
  • Conclusion

Outline of Talk

slide-42
SLIDE 42

42

MASPLAS 2007

Automated clustering

  • Multivariate Projection

[Podgurski et al. ICSE ’01, ICSE ’03]

Fault localization

  • Set-based, and Nearest Neighbor [Renieris,

Reiss ASE ’03]

  • Statistical [Liblit et al. PLDI ‘03, ‘05]
  • SOBER [Liu et al. ESEC/FSE ‘05]

Related Work

MASPLAS 2007

Research Projects

  • Introduction
  • Automatic fault localization—Tarantula
  • General technique
  • Visualization and demo
  • Test-case clustering to improve efficiency
  • Related work
  • Conclusion

Outline of Talk

slide-43
SLIDE 43

43

MASPLAS 2007

Conclusion

  • Technique and visualization to provide support

for finding faults

  • Technique to get fault-focusing clusters to

create specialized test suite

  • New approach to debugging—parallel

debugging

  • Benefits, supported by studies
  • general technique outperforms existing techniques

(subjects)

  • less time to failure-free program
  • better utilization of developer effort
  • indication of the number off faults

MASPLAS 2007

Future Work

  • Additional experimentation and with more

subject programs

  • Development of a cost model that accounts for
  • Number of developers that are available
  • Organizational parameters such as salary, testing

costs, and urgency of software delivery

  • Development of a process for debugging that
  • includes fault-localization techniques
  • guides multiple debuggers with tasks such as

synchronization

slide-44
SLIDE 44

44

MASPLAS 2007

Debugging For More Information

  • Jones, Bowring, Harrold, International Symposium
  • n Software Testing and Analysis (ISSTA) 2007, to

appear

  • Jones, Harrold, Automated Software Engineering

(ASE) 2005

  • Jones, Orso, Harrold, Journal of Information

Visualization 2004

  • Jones, Orso, Harrold, Software Visualization

(SoftVis) 2003

  • Jones, Harrold, Stasko, International Conference
  • n Software Engineering (ICSE) 2002
  • Jones, Harrold, Stasko, Workshop on Software

Visualization 2001