C UES FOR S CENT I NTENSIFICATION IN D EBUGGING Alexandre Perez and Rui Abreu Faculty of Engineering University of Porto, Portugal November 4th 2013, International Workshop on Program Debugging
F AULT L OCALIZATION Runs mid() { Suspiciousness 1 2 3 4 5 6 int x,y,z,m; 0.41 read(“Enter 3 numbers:”,x,y,z); 0.41 m = z; 0.41 if (y<z) { 0.50 if (x<y) 0.0 m = y; 0.58 else if (x<z) 0.71 m = y; // ***BUG*** 0.0 } else { 0.0 if (x>y) 0.0 m = y; 0.0 else if (x>z) 0.0 m = x; 0.0 } 0.41 print(“Middle number is:”,m); } 2
F AULT L OCALIZATION Runs mid() { Suspiciousness 1 2 3 4 5 6 int x,y,z,m; 0.41 read(“Enter 3 numbers:”,x,y,z); 0.41 m = z; Are Automated Debugging Techniques 0.41 if (y<z) { 0.50 if (x<y) Actually Helping Programmers? 0.0 m = y; 0.58 else if (x<z) 0.71 m = y; // ***BUG*** Chris Parnin and Alessandro Orso 0.0 } else { G e o r g i a I n 0.0 if (x>y) s t i t u t e o f T e c C h n o o l l l o e g g e y o f C {chris.parnin|orso}@gatech.edu o m 0.0 m = y; p u t i n g ABSTRACT 0.0 else if (x>z) 0.0 m = x; is notoriously di ffi cult and extremely time con- 0.0 } esearchers have therefore invested a co second activity, fault understandin e ff ort in developi the root caus 0.41 print(“Middle number is:”,m); } 3
I NFORMATION F ORAGING Predator: person debugging the program. Prey: what the predator seeks to know to pinpoint the fault. 4
I NFORMATION F ORAGING Proximal cues: runtime behaviors that suggest information relative to the prey. Information scent: perceived likelihood that a cue will potentially lead to the fault. Topology: is the collection of paths through which the programmer can navigate. 5
I NFORMATION F ORAGING ✓ information gain ◆ choice = max cost 6
S UNBURST 7
S UNBURST 8
S UNBURST 1 Project 1 8
S UNBURST 1 Project 2 Source Folder 1 2 8
S UNBURST 1 Project 2 Source Folder 3 Package 1 2 3 8
S UNBURST 1 Project 2 Source Folder 3 Package 4 File 1 2 3 4 8
S UNBURST 1 Project 2 Source Folder 3 Package 4 File 1 5 Class 2 3 4 5 8
S UNBURST 1 Project 2 Source Folder 3 Package 4 File 1 5 Class 2 3 6 Method 4 5 6 8
S UNBURST 1 Project 2 Source Folder 3 Package 4 File 1 5 Class 2 3 6 Method 4 5 6 7 Statement 7 8
S UNBURST High Suspiciousness Low Suspiciousness 9
S UNBURST 10
S UNBURST Root Change 10
11
Check it out at www.gzoltar.com 11
I NFORMATION F ORAGING ✓ information gain ◆ choice = max cost 12
I NFORMATION F ORAGING color coding and the hierarchical visualization increase information scent ✓ information gain ◆ choice = max cost interaction features can reduce the cost of navigation 12
U SER S TUDY 40 Participants 13
U SER S TUDY Students of the Master in Informatics and Computing Engineering at University of Porto 14
U SER S TUDY 5+ years of Java/JUnit experience 15
(De)serializes Java objects into XML 17 kLOC, 306 classes Participants were unfamiliar with the application http://xstream.codehaus.org/ 16
com.thoughtworks.xstream.mapper.AnnotationMapper 454 final List<Object> parameter = new ArrayList<Object>(); 455 if (targetType == null) { 456 parameter.add(targetType); 457 } 458 final List<Object> arrays = new ArrayList<Object>(); 17
com.thoughtworks.xstream.mapper.AnnotationMapper 454 final List<Object> parameter = new ArrayList<Object>(); 455 if (targetType == null) { 456 parameter.add(targetType); 457 } 458 final List<Object> arrays = new ArrayList<Object>(); == instead of != 17
S ETUP Participants were asked to locate and fix the fault. Metric : time-to-green. Timeout : 30 minutes. 18
C ONTROL G ROUP Find and fix the fault without the aid of GZoltar. 7 out of 20 participants completed the task. 19
C ONTROL G ROUP Average time: 23.4 minutes* *Those that did not find the fault were assigned as taking the maximum time (30 minutes) 20
E XPERIMENTAL G ROUP Find and fix the fault with the aid of GZoltar. All participants completed the task. 21
E XPERIMENTAL G ROUP Average time: 7.9 minutes 22
23
F AULT L OCALIZATION Runs mid() { Suspiciousness 1 2 3 4 5 6 int x,y,z,m; read(“Enter 3 numbers:”,x,y,z); 0.41 m = z; 0.41 if (y<z) { 0.41 if (x<y) 0.50 m = y; 0.0 else if (x<z) 0.58 0.71 m = y; // ***BUG*** 0.0 } else { 0.0 if (x>y) 0.0 m = y; else if (x>z) 0.0 m = x; 0.0 } 0.0 print(“Middle number is:”,m); 0.41 } 24
F AULT L OCALIZATION I NFORMATION F ORAGING Runs mid() { Proximal cues: runtime behaviors that suggest Suspiciousness 1 2 3 4 5 6 int x,y,z,m; read(“Enter 3 numbers:”,x,y,z); 0.41 information relative to the prey. m = z; 0.41 if (y<z) { 0.41 if (x<y) 0.50 m = y; 0.0 Information scent: perceived likelihood that a cue else if (x<z) 0.58 0.71 m = y; // ***BUG*** will potentially lead to the fault. 0.0 } else { 0.0 if (x>y) 0.0 m = y; else if (x>z) 0.0 m = x; 0.0 Topology: is the collection of paths through which } 0.0 print(“Middle number is:”,m); 0.41 the programmer can navigate. } 24
F AULT L OCALIZATION I NFORMATION F ORAGING Runs mid() { Proximal cues: runtime behaviors that suggest Suspiciousness 1 2 3 4 5 6 int x,y,z,m; read(“Enter 3 numbers:”,x,y,z); 0.41 information relative to the prey. m = z; 0.41 if (y<z) { 0.41 if (x<y) 0.50 m = y; 0.0 Information scent: perceived likelihood that a cue else if (x<z) 0.58 0.71 m = y; // ***BUG*** will potentially lead to the fault. 0.0 } else { 0.0 if (x>y) 0.0 m = y; else if (x>z) 0.0 m = x; 0.0 Topology: is the collection of paths through which } 0.0 print(“Middle number is:”,m); 0.41 the programmer can navigate. } S UNBURST 1 Project 2 Source Folder 3 Package 4 File 1 5 Class 2 3 6 Method 4 5 6 7 Statement 7 24
F AULT L OCALIZATION I NFORMATION F ORAGING Runs mid() { Proximal cues: runtime behaviors that suggest Suspiciousness 1 2 3 4 5 6 int x,y,z,m; read(“Enter 3 numbers:”,x,y,z); 0.41 information relative to the prey. m = z; 0.41 if (y<z) { 0.41 if (x<y) 0.50 m = y; 0.0 Information scent: perceived likelihood that a cue else if (x<z) 0.58 0.71 m = y; // ***BUG*** will potentially lead to the fault. 0.0 } else { 0.0 if (x>y) 0.0 m = y; else if (x>z) 0.0 m = x; 0.0 Topology: is the collection of paths through which } 0.0 print(“Middle number is:”,m); 0.41 the programmer can navigate. } S UNBURST 1 Project 2 Source Folder 3 Package 4 File 1 5 Class 2 3 6 Method 4 5 6 7 Statement 7 24
Recommend
More recommend