1 / 28

Árpád Beszédes University of Szeged, Hungary, Department of Software Engineering

Static and Dynamic Execute After Relationships as a replacement of dependence-based program slices. Árpád Beszédes University of Szeged, Hungary, Department of Software Engineering. with F. Fischer, T. Gergely, T. Gyimóthy, J. Jász, V. Rajlich. COW , London, January 2011. Introduction.

manchu
Download Presentation

Árpád Beszédes University of Szeged, Hungary, Department of Software Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Static and Dynamic Execute After Relationshipsas a replacement of dependence-based program slices Árpád Beszédes University of Szeged, Hungary, Department of Software Engineering with F. Fischer, T. Gergely, T. Gyimóthy, J. Jász, V. Rajlich COW , London, January 2011

  2. Introduction • Dependence analysis on source code • Some applications: • Maintenance, in general • Program comprehension, in general • Change impact analysis, specifically • Regression test selection, specifically • Debugging, specifically • (Imprecise & incomplete for some applications like change impact analysis) 10th CREST Open Workshop on Program Analysis and Slicing

  3. SDG • System (Program) Dependence Graph • Well understood technique • Since Horwitz, Reps and Binkley (1990) • Graph representation of the program • Nodes: program elements • Edges: dependencies (data & control) • Reachability  program slicing • Forward slice: computing the impact set • We refer to it as Traditional Software Dependencies 10th CREST Open Workshop on Program Analysis and Slicing

  4. Performance of TSD algorithm • Accurate and sound method • Imprecisions due to different reasons • Not very scalable • Millions of LOC out of question • Not useful for complex systems and complex maintenance problems • What can we do? • Improve algorithms (?!) • Trade off accuracy; two outcomes: • Lose soundness • Lose precision • Approximation, e.g. use call-graph 10th CREST Open Workshop on Program Analysis and Slicing

  5. Example texts[] = {...} procedure getIndex(out index){ read(index); } procedure printParam(in index){ write(texts[index]); } procedure printLast(){ write(texts[texts.length-1]); } procedure main(){ i = MAX_LENGTH-1; while (i >= texts.length) getIndex(i); if (i > 0) printParam(i); printLast(); } TSD – Traditional Software Dependencies (Slice) CG - Call Graph 10th CREST Open Workshop on Program Analysis and Slicing

  6. Approach • Missing dependencies in call-graph based method? • Typically due to data dependencies • A data dependency requires flow • Compute reachability on the Inter-procedural Control Flow Graph (ICFG) • Replace data- and control dependencies by flow dependencies • This is a sound approximation 10th CREST Open Workshop on Program Analysis and Slicing

  7. SEA and SEB • Static Execute After (SEA) relation (SEB is similar): • Possibleflow-baseddependencies: Entity B depends on entity A B is executed after A in some of the possible executions of the program 10th CREST Open Workshop on Program Analysis and Slicing

  8. Example (cont’d) main Interprocedural Component Control Flow Graph (ICCFG) Strongly Connected Component Interprocedural Control Flow Graph i = MAX_LENGTH-1 i >= texts.length call getIndex(i) … i >0 … call printParam(i) call printLast() … 10th CREST Open Workshop on Program Analysis and Slicing

  9. Example (cont’d) 10th CREST Open Workshop on Program Analysis and Slicing

  10. Research goals • What is to be expected: very imprecise • What we claim here: not much worse • Compare SEA/SEB to TSD (slice)as the golden standard • RQ1: What is the difference in precision? • RQ2: What is the difference in efficiency? • Dynamic variant • Applications 10th CREST Open Workshop on Program Analysis and Slicing

  11. Precision • Average size of dependence setscompared to the program size (procedure level): Difference: ~4% Recall is always 100% 10th CREST Open Workshop on Program Analysis and Slicing

  12. Relation components Using call graph onlyis not a good idea 10th CREST Open Workshop on Program Analysis and Slicing

  13. Analysis at different levels • Statement • Flow reachability starting from statements • Procedure • Flow reachability taking into account only call-sites and summary of flow information (ICCFG) • Heuristics to improve precision (e.g. black&white methods) • Class • (A,B)  SEA  A::f B::g (f,g)  SEA • Handling of field and global accesses: artificial wrapper procedures 10th CREST Open Workshop on Program Analysis and Slicing

  14. Difference in precision 10th CREST Open Workshop on Program Analysis and Slicing

  15. Precise slice Summary of analyses Program SEA/SEB Imprecision of SEA/SEB (small) TSD Imprecision of TSD (big): e.g. PTA, executability, … Control dep. Call dep. 10th CREST Open Workshop on Program Analysis and Slicing

  16. Experimental implementation • CodeSurfer for thecommon front end • Common IR • Different analysissettings • TSD and SEA/SEB from SDG and ICCFG, respectively • C programs for precision measurements • 29 programs; 595 kLOC total • C/C++ programs for efficiency measurements • 4 programs; 4,14MLOC total • Calculations for all possible criteria 10th CREST Open Workshop on Program Analysis and Slicing

  17. Scalability • Properties of the graph representations: 10th CREST Open Workshop on Program Analysis and Slicing

  18. Scalability (cont’d) • Analysis times: 10th CREST Open Workshop on Program Analysis and Slicing

  19. g f h,i… (but not g) Dynamic Execute After Trace Dynamic EA of f is h,i… Limiting the dependency based on the ‘closeness’ of the functions in the trace: 10th CREST Open Workshop on Program Analysis and Slicing

  20. Dynamic EA – measurements 10th CREST Open Workshop on Program Analysis and Slicing

  21. Applications • Dependencies in database-intensive systems • Heterogeneous system: Host language, SQL queries, Stored procedures, Database schemas • SEA/SEB relations on the source code combined with ‘CRUD’ relations • Uses the CRUD matrix and looks for table accesses • Disjoint parts are similar in size and the intersection is small • Which means that SEA/SEB itself is not sound 10th CREST Open Workshop on Program Analysis and Slicing

  22. Another implementation • By FrontEndART • Based on the Columbus technology • New implementation and enhancement of the algorithms • In the SourceInventory framework • For architecture analysis • In Eclipse • For Impact analysis and test case selection 10th CREST Open Workshop on Program Analysis and Slicing

  23. SourceInventory 10th CREST Open Workshop on Program Analysis and Slicing

  24. Eclipse 10th CREST Open Workshop on Program Analysis and Slicing

  25. Conclusion • Use SEA/SEB instead of TSD in some applications • But not at all levels! Procedure level is the most useful • SDG based dependencies as the golden standard? • How far are we from the ‘real’ dependencies, i.e. precise slices? 10th CREST Open Workshop on Program Analysis and Slicing

  26. Precise slice Summary of analyses Program SEA/SEB Imprecision of SEA/SEB (small) TSD Imprecision of TSD (big): e.g. PTA, executability, … Control dep. Call dep. 10th CREST Open Workshop on Program Analysis and Slicing

  27. Summary (cont.) size SEA SMALL Static slice BIG Precise impact Union slice Execute After Dynamic slice executions 10th CREST Open Workshop on Program Analysis and Slicing

  28. 10th CREST Open Workshop on Program Analysis and Slicing

More Related