Path Projection
For User-Centered Static Analysis Tools
Khoo Yit Phang, Jeff Foster, Michael Hicks, Vibha Sazawal University of Maryland PASTE 2008, November 10
1
Path Projection For User-Centered Static Analysis Tools Khoo Yit - - PowerPoint PPT Presentation
Path Projection For User-Centered Static Analysis Tools Khoo Yit Phang , Jeff Foster, Michael Hicks, Vibha Sazawal University of Maryland PASTE 2008, November 10 1 Success in Static Analysis Coverity, Fortify, Grammatech, Klocwork, many others
1
2
3
call stacks and control-flow paths
Helping users understand paths will help many static analysis tools We have applied Path Projection to Locksmith and BLAST
Task: triaging Locksmith error reports Result: 18% improvement in completion time, similar accuracy
4
Data race: Two or more threads access a shared variable at the same time
To triage, user must decide whether multiple paths are simultaneously realizable
5
6
Standard Viewer designed to mimic typical editors/IDEs
6
Locksmith error report with hyperlinks
6
7
7
Shared variable
7
Shared variable Call stacks leading to race
7
Thread creation
7
Thread creation Dereference
7
Thread creation Dereference w/no locks held
7
Thread creation Dereference w/no locks held
7
8
Triage: are these call stacks simultaneously realizable?
9
Begin by clicking
9
Begin by clicking
10
Thread creation realizable?
10
Thread creation realizable? Yes, unconditionally created
11
Keep around context
11
Keep around context Easier than remembering
12
Focus
12
Call site of Next call
13
Skipping a few steps
13
the dereference, finally!
14
14
Screen is very cluttered!
14
Old context is hidden!
14
Old context is hidden!
Which function is this? Where was this called?
15
Read error report Click hyperlink 1 Read code Scroll up Scroll down Split window Focus Back to error report Click hyperlink 2 Read code Scroll down Split window Focus Back to error report Click hyperlink 3 Read code Scroll down Split window Focus Back to error report Collapse splits (resize window, move window...)
15
16
Inline function directly below call site
16
Inline function directly below call site
Show only implicated lines and lexical control-blocks
16
Inline function directly below call site
Show only implicated lines and lexical control-blocks
16
17
Show paths side by side
17
Show paths side by side
18
Multiple searches (despite folds)
18
Multiple searches (despite folds)
19
Continuing example...
19
from 1st call stack
19
from 2nd call stack
19
from 2nd call stack dereference
19
in loop condition for dereference condition for thread creation
19
not a single click or scroll!
19
not a single click or scroll! no need to look here too!
20
What’ s foffset?
20
21
What’ s in read_log?
21
Reveal definition (initially folded)
22
23
ad hoc, inconsistent procedure neglected some causes of false positives sidetracked by non-causes of false positives
24
Different tools have different imprecision & error reports
check if any pair of paths are simultaneously realizable different cases: threads in loop, parent-child, child-child
Source of imprecision: Locksmith is path-insensitive Possible false positive: child-child threads may be mutually exclusive
25
check if any pair of paths are simultaneously realizable different cases: threads in loop, parent-child, child-child
Source of imprecision: Locksmith is path-insensitive Possible false positive: child-child threads may be mutually exclusive
25
check if any pair of paths are simultaneously realizable different cases: threads in loop, parent-child, child-child
Source of imprecision: Locksmith is path-insensitive Possible false positive: child-child threads may be mutually exclusive
25
Quantitatively: completion time Qualitatively: user ratings
26
Participants have different skill level Are differences due to participant or UI?
Compare UI results for each participant
27
Participants get better over time (learning) Participants biased by initial UI or problem
SV-PP: Standard Viewer, then Path Projection PP-SV: Path Projection, then Standard Viewer
28
no need to manage warnings
No aliasing/imprecise lock state (future work)
29
3 undergraduates, 5 graduates Prior experience in C, multithreading (not necessarily C) Self-rated 3-4 (1: no experience to 5: very experienced) 2 had experience in Locksmith and Eraser
30
Session 1 Session 2 100 200 300 400
Completion time (sec)
Standard Viewer Path Projection
31
Session 1 Session 2 100 200 300 400
Completion time (sec)
Standard Viewer Path Projection
31
Time in Seconds
Session 1 Session 2 100 200 300 400
Completion time (sec)
Standard Viewer Path Projection
31
Time in Seconds PP-SV group SV-PP group
Session 1 Session 2 100 200 300 400
Completion time (sec)
Standard Viewer Path Projection
32
all improved in Session 2*
Session 1 Session 2 100 200 300 400
Completion time (sec)
Standard Viewer Path Projection
*statistically significant (p<0.05)
32
Learning effect
all improved in Session 2*
(effect size d=1.276)
Session 1 Session 2 100 200 300 400
Completion time (sec)
Standard Viewer Path Projection
*statistically significant (p<0.05)
32
SV-PP: 188s Learning effect
all improved in Session 2*
(effect size d=1.276)
(effect size d=0.375)
Session 1 Session 2 100 200 300 400
Completion time (sec)
Standard Viewer Path Projection
*statistically significant (p<0.05)
32
SV-PP: 188s PP-SV: 55s Learning effect
all improved in Session 2*
(effect size d=1.276)
(effect size d=0.375)
10 in PP (10.9%), 9 in SV (9.8%)
Session 1 Session 2 100 200 300 400
Completion time (sec)
Standard Viewer Path Projection
*statistically significant (p<0.05)
32
SV-PP: 188s PP-SV: 55s Learning effect
(e.g., using hyperlinks)
Session 1 Session 2 20 40 60 80 100 120
Duration in error report (sec)
Standard Viewer Path Projection
33
(e.g., using hyperlinks)
Session 1 Session 2 20 40 60 80 100 120
Duration in error report (sec)
Standard Viewer Path Projection
*statistically significant (p<0.05)
33
(e.g., using hyperlinks)
Session 1 Session 2 20 40 60 80 100 120
Duration in error report (sec)
Standard Viewer Path Projection
*statistically significant (p<0.05)
33
to learn Confident
Easy to verify race Prefer Path Projection 1 2 3 4 5
Overall impression
Standard Viewer Path Projection
Strongly agree
Strongly disagree
34
to learn Confident
Easy to verify race Prefer Path Projection 1 2 3 4 5
Overall impression
Standard Viewer Path Projection
Strongly agree
Strongly disagree
34
median quartiles max (<1.5quartile) min (<1.5quartile)
to learn Confident
Easy to verify race Prefer Path Projection 1 2 3 4 5
Overall impression
Standard Viewer Path Projection
Strongly agree
Strongly disagree 35
to learn Confident
Easy to verify race Prefer Path Projection 1 2 3 4 5
Overall impression
Standard Viewer Path Projection
Strongly agree
Strongly disagree
35
to learn Confident
Easy to verify race Prefer Path Projection 1 2 3 4 5
Overall impression
Standard Viewer Path Projection
Strongly agree
Strongly disagree
*statistically significant (p<0.05)
35
Very useful
Not useful
report Checklist Function inlining Code folding Multi− query Query reveals folded code
1 2 3 4 5
Usefulness of features
36
Very useful
Not useful
report Checklist Function inlining Code folding Multi− query Query reveals folded code
1 2 3 4 5
Usefulness of features
36
*statistically significant (p<0.05)
Very useful
Not useful
report Checklist Function inlining Code folding Multi− query Query reveals folded code
1 2 3 4 5
Usefulness of features
37
Very useful
Not useful
code folding was “the best feature” or “my favorite feature”
report Checklist Function inlining Code folding Multi− query Query reveals folded code
1 2 3 4 5
Usefulness of features
37
small number of users and trials not static analysis experts, unfamiliar programs statistically significant despite limitations
deliberate choice to avoid bias from prior experience
checklist designed for Locksmith, not SV or PP both interfaces use the same checklist
38
Takes an XML path report as input
39