predicting data dependences for slice inspection ...€¦ · predicting data dependences for slice...
TRANSCRIPT
![Page 1: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/1.jpg)
Predicting Data Dependences for Slice Inspection Prioritization
Yiji Zhang and Raul Santelices University of Notre Dame
![Page 2: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/2.jpg)
Outline • Introduction • Technique • Evaluation • Future work and Conclusion
1
![Page 3: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/3.jpg)
Introduction • Definitions
2
1. main(int a, int b){ 2. int *p; 3. if (…) 4. p = &a; else 5. p = &b; 6. if (…) 7. swap (p, &a); else 8. if (…) 9. a = b; else 10. swap (&b, &a); 11. print (a,b); }
12. swap (int *p1, int *p2){ 13. int temp = *p2; 14. *p2 = *p1; 15. *p1 = temp; }
data dependence: statement y depends on x iff 1) x writes to variable v (def) 2) y reads from v (use)
![Page 4: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/4.jpg)
Introduction • Definitions
3
1. main(int a, int b){ 2. int *p; 3. if (…) 4. p = &a; else 5. p = &b; 6. if (…) 7. swap (p, &a); else 8. if (…) 9. a = b; else 10. swap (&b, &a); 11. print (a,b); }
12. swap (int *p1, int *p2){ 13. int temp = *p2; 14. *p2 = *p1; 15. *p1 = temp; }
example: data dependence (4,7,p) or simply (4,7)
![Page 5: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/5.jpg)
Introduction • Definitions
4
1. main(int a, int b){ 2. int *p; 3. if (…) 4. p = &a; else 5. p = &b; 6. if (…) 7. swap (p, &a); else 8. if (…) 9. a = b; else 10. swap (&b, &a); 11. print (a,b); }
12. swap (int *p1, int *p2){ 13. int temp = *p2; 14. *p2 = *p1; 15. *p1 = temp; }
program slicing: affecting statements slicing criterion: value and point of interest
![Page 6: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/6.jpg)
Introduction • Definitions
5
1. main(int a, int b){ 2. int *p; 3. if (…) 4. p = &a; else 5. p = &b; 6. if (…) 7. swap (p, &a); else 8. if (…) 9. a = b; else 10. swap (&b, &a); 11. print (a,b); }
12. swap (int *p1, int *p2){ 13. int temp = *p2; 14. *p2 = *p1; 15. *p1 = temp; }
slicing criterion: value p at line 7
![Page 7: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/7.jpg)
Introduction • Definitions
6
1. main(int a, int b){ 2. int *p; 3. if (…) 4. p = &a; else 5. p = &b; 6. if (…) 7. swap (p, &a); else 8. if (…) 9. a = b; else 10. swap (&b, &a); 11. print (a,b); }
12. swap (int *p1, int *p2){ 13. int temp = *p2; 14. *p2 = *p1; 15. *p1 = temp; }
slicing criterion: value p at line 7 slice: lines 1, 2, 3, 4, 5, 6 and 7
![Page 8: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/8.jpg)
Introduction • Motivation
7
1. main(int a, int b){ 2. int *p; 3. if (…) 4. p = &a; else 5. p = &b; 6. if (…) 7. swap (p, &a); else 8. if (…) 9. a = b; else 10. swap (&b, &a); 11. print (a,b); }
12. swap (int *p1, int *p2){ 13. int temp = *p2; 14. *p2 = *p1; 15. *p1 = temp; }
Q: Which statement to examine first?
![Page 9: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/9.jpg)
Introduction • Related Work
– M. Sridharan, S. J. Fink, and R. Bodik, “Thin slicing,” in Proc. of PLDI, Jun. 2007, pp. 112–122
– X. Zhang, N. Gupta, and R. Gupta, “Pruning dynamic slices with confidence,” in PLDI, 2006, pp. 169–180
8
![Page 10: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/10.jpg)
Outline • Introduction • Technique • Evaluation • Future work and Conclusion
9
![Page 11: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/11.jpg)
Technique • PRIODU Process
10
Program
D-U Analyzer data dependences (d1,u1)
(d2,u2) (d3,u3) (d4,u4) (d5,u5)
……
data dependencesd
![Page 12: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/12.jpg)
Technique • PRIODU Process
11
Program
D-U Analyzer
Probabilities, Ranking
data dependences
PRIODU dependence (d,u):
compute P(d,u)
(d1,u1), P(d1,u1) (d2,u2), P(d2,u2) (d3,u3), P(d3,u3) (d4,u4), P(d4,u4) (d5,u5), P(d5,u5)
……
P(d,u) : Coverage Probability (estimated)
):p ( , )compute P((d,u, ))
)
![Page 13: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/13.jpg)
Technique • PRIODU Process
12
Program
D-U Analyzer
Probabilities, Ranking
data dependences
PRIODU dependence (d,u):
compute P(d,u)
p ( , )compute P((d,u, ))
P(d,u) : Coverage Probability (estimated)
):)
decreasing P(d,u)
(d3,u3), P(d3,u3) (d2,u2), P(d2,u2) (d1,u1), P(d1,u1) (d5,u5), P(d5,u5) (d4,u4), P(d4,u4)
……
![Page 14: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/14.jpg)
Technique Coverage Probability P(d,u) = Preach × Palias 1) Preach: Reaching probability 2) Palias: Alias probability
EN d u
d u
Memory
13
EN: entry of the program
![Page 15: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/15.jpg)
Technique 1) Preach = PEN d Pd u
for PEN d: src=EN, tgt=d for Pd u: src=d, tgt=u
14
1. main(int a, int b){ 2. int *p; 3. if (…) 4. p = &a; else 5. p = &b; 6. if (…) 7. swap (p, &a); else 8. if (…) 9. a = b; else 10. swap (&b, &a); 11. print (a,b); } example: data dep (4,7,p)
;
;P(succeeds(6,4)) = 1.0
P(reaches(6,7)) = 0.5
Simplifying assumption: All successors equally likely
Goal: P(d,u) = Preach × Palias achrea h_______
![Page 16: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/16.jpg)
Technique 2) Palias: only for d u
15
d u
Memory
P2Set (points-to set): all possible memory locations
Palias: degree of overlap
Goal: P(d,u) = Preach × Palias aliaaas______
![Page 17: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/17.jpg)
Technique 2) Palias: only for d u
16
d u
Memory
P2Set(d)
P2Set (points-to set): all possible memory locations
Palias: degree of overlap
Goal: P(d,u) = Preach × Palias aliaaas______
![Page 18: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/18.jpg)
Technique 2) Palias: only for d u
17
d u
Memory
P2Set(u)
P2Set (points-to set): all possible memory locations
Palias: degree of overlap
Goal: P(d,u) = Preach × Palias aliaaas______
![Page 19: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/19.jpg)
Technique 2) Palias: only for d u
18
d u
Memory
P2Set (points-to set): all possible memory locations
Palias: degree of overlap
Palias =
Goal: P(d,u) = Preach × Palias aliaaas______
1 4 1
![Page 20: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/20.jpg)
Technique 2) Palias: only for d u
19
1. main(int a, int b){ 2. int *p; 3. if (…) 4. p = &a; else 5. p = &b; 6. if (…) 7. swap (p, &a); else 8. if (…) 9. a = b; else 10. swap (&b, &a); 11. print (a,b); }
12. swap (int *p1, int *p2){ 13. int temp = *p2; 14. *p2 = *p1; 15. *p1 = temp; }
example: dependence (1,14,b)
P2Set(d) = {b} (d) =
P2Set(u) = {a, b} p;P=
Goal: P(d,u) = Preach × Palias aliaaas______
mp == *p1; = tempp;
![Page 21: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/21.jpg)
Outline • Introduction • Technique • Evaluation • Future work and Conclusion
20
![Page 22: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/22.jpg)
Evaluation • Goal: assess prediction effectiveness of PRIODU
– Compare with random order of the dependences
• Research questions: RQ1: Overall accuracy RQ2: Accuracy per inspection budget
21
![Page 23: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/23.jpg)
Evaluation • Experiment Setup
• Two Java subjects from SIR • Tool: DUA-Forensics – PRIODU extension
22
Subject Description LOC Data Dep. Tests
Schedule1 Task scheduler 290 381 2650
NanoXML XML parser 3497 11508 214
Table 1 Subjects, Data Dependences, and Tests
![Page 24: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/24.jpg)
Evaluation • Methodology
23
(d1,u1), P(d1,u1) (d2,u2), P(d2,u2) (d3,u3), P(d3,u3) (d4,u4), P(d4,u4)
…… PRIODU
our predicted ranking
Program, Dependences
ranking
![Page 25: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/25.jpg)
Evaluation • Methodology
24
PRIODU
Program, Dependences
Test Suite Runner
Test Suite
observed ranking
our predicted ranking
Fi = occurrence frequency in [0,1]
(d1,u1), P(d1,u1) (d2,u2), P(d2,u2) (d3,u3), P(d3,u3) (d4,u4), P(d4,u4)
……
(d2,u2), F2 (d1,u1), F1 (d4,u4), F4 (d3,u3), F3
……
ranking
observed rankingo
![Page 26: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/26.jpg)
Evaluation • Methodology
25
PRIODU
Program, Dependences
Test Suite Runner
Test Suite
Error Estimator
observed ranking
our predicted ranking
Prediction Error
(d1,u1), P(d1,u1) (d2,u2), P(d2,u2) (d3,u3), P(d3,u3) (d4,u4), P(d4,u4)
……
(d2,u2), F2 (d1,u1), F1 (d4,u4), F4 (d3,u3), F3
……
![Page 27: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/27.jpg)
Evaluation • Error Estimator
26
# PRIODU Predicted
Runtime Observed
1 (d1,u1) (d2,u2)
2 (d2,u2) (d1,u1)
3 (d3,u3) (d4,u4)
4 (d4,u4) (d3,u3)
1.
(How we evaluate PRIODU)
![Page 28: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/28.jpg)
Evaluation • Methodology
27
PRIODU
Program, Dependences
Test Suite Runner
Test Suite
Error Estimator
observed ranking
our predicted ranking
Prediction Error
![Page 29: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/29.jpg)
Evaluation • compare with the expected error of random
order
28
dep
Random Ranking
Observed Ranking
D ith:
![Page 30: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/30.jpg)
Evaluation • Expected error of random order
29
dep
Random Ranking
Observed Ranking
D ith:
i-1 Case 1: Errordep(i) = (i-1)/2D
![Page 31: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/31.jpg)
Evaluation
30
dep
Random Ranking
Observed Ranking
ith: D
• Expected error of random order
Case 1: Errordep(i) = (i-1)/2D
Case 2: Errordep(i) = 0
![Page 32: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/32.jpg)
Evaluation
31
dep
Random Ranking
Observed Ranking
Case 1: Errordep(i) = (i-1)/2D ith:
D Case 2: Errordep(i) = 0
Case 3: Errordep(i) = (D-i)/2D
• Expected error of random order
D-i
![Page 33: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/33.jpg)
Evaluation •
32
Case 1 Case 2 Case 3
![Page 34: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/34.jpg)
Evaluation • RQ1: Overall accuracy (based on average
error)
33
Subject PRIODU Error Random Error Schedule1 20.9% 33.3% NanoXML 5.9% 33.3%
![Page 35: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/35.jpg)
Evaluation • RQ2. Accuracy per fraction of the ranking
34 Ranking errors from the top of each ranking for Schedule1
Error: 39.51%
Error: 18.90%
![Page 36: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/36.jpg)
Evaluation • RQ2. Accuracy per fraction of the ranking
35 Ranking errors from the top of each ranking for Schedule1
![Page 37: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/37.jpg)
Evaluation • RQ2. Accuracy per fraction of the ranking
36 Ranking errors from the top of each ranking for NanoXML
![Page 38: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/38.jpg)
Outline • Introduction • Technique • Evaluation • Future Work and Conclusion
37
![Page 39: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/39.jpg)
Future Work and Conclusion Future Work
– Case studies and user studies for debugging – Improve the precision of the model
• Reaching probabilities using branch prediction • Experiment with dynamic analysis
– Other applications • Impact analysis • Information flow analysis
38
![Page 40: Predicting Data Dependences for Slice Inspection ...€¦ · Predicting Data Dependences for Slice Inspection Prioritization Yiji Zhang and Raul Santelices University of Notre Dame](https://reader034.vdocuments.us/reader034/viewer/2022050409/5f86357d94df652f477789e2/html5/thumbnails/40.jpg)
Future Work and Conclusion Conclusion PRIODU: (1) prioritize data dependences (2) especially good at the top of the ranking
Q & A
39