dbd253bf003fc01c104b12d49adcc756.ppt
- Количество слайдов: 27
Flow-Augmented Call Graph: A New Foundation for Taming API Complexity Qirun Zhang 1009004750 1
l. Past work: Taming API Complexity l Future plan: in the Presence of Pointers 2
Outline • • • Background Approach Evaluation Conclusion Q&A 3
Background 4
Background • Motivation 5
Background A Flow-Augmented Call Graph (FACG) G = (N, E) for procedure P is a directed multigraph in which each node n corresponds to either a caller P or a callee Q, and each weighted edge e represents a call-site augmented with control flow. Call Graph Flow-Augmented Call Graph 6
Background • What is the insight of FACG? 7
Background • Why taming API complexity? – For Software maintenances – Most of software not documented well scp Year 2005 2008 SEE ALSO Apache Project rcp(1), sftp(1), ssh-add(1), ssh. Function @see also Percentage agent(1), ssh-keygen(1), ssh_config(5), sshd(8) 1353 6 0. 4% 1461 15 1. 0% – For API documentation maintenances http: //msdn. microsoft. com/en-us/library/ms 633545(v=VS. 85). aspx 8
Background • Research solutions – How API is used • PLDI-05, OOPSLA-06, ECOOP-09, ASE-07, ICSE-05, AOSD -07 – How API is implemented • Suade (FSE-05), Fran(FSE-07), Altair(FSE-09) 9
Approach 10
Approach • Overview 11
Approach • Parsing & Hashing – How to parse the source code? – What kind of elements should be extracted? • Solution • gcc Gimple IR • API call-site, basic block, conditional block. • Build the CFG 12
Approach • Handling Function Pointers – Collecting the path conditions – Over-approximate the program behavior – Testing the validation by SMT solver 13
Approach • Reducing CFG – The CFG considered[1] – Eliminate the back edge[2] – Unroll the loop once [1] Podgurski, A. , Lori, Clarke, A. : A formal model of program dependences and its implications for software testing, debugging, and maintenance. IEEE Transactions on Software Engineering 16, 965– 979 (1990) [2] Ramanathan, M. K. , Grama, A. , Jagannathan, S. : Path-sensitive inference of function precedence protocols. In: ICSE. pp. 240– 250 (2007) 14
Approach • Calculating the Flow of Callees – The inflow of the basic block associated with Q – The outflow of the basic block associated with Q 15
Approach • Augmenting the Call graph Call Graph Flow-Augmented Call Graph 16
Approach • Augmenting the Call graph 17
Approach • Recommending API – Computing Cosine similarities g 0 h 0 g 1 h 1 g 2 f 0 1 1 0 0 0 f 1 1 0 0 f 2 0 0 0 1 1 18
Evaluation 19
Evaluation • Subject Project • Experimental Setup – A specific task suggested by Fran [2]: Given a query API, retrieve other APIs in the same module – Module is defined by original documentation • http: //www. tcl. tk/man/tcl 8. 4/Tcl. Lib/contents. htm [2] Saul, Z. M. , Filkov, V. , Devanbu, P. T. , Bird, C. : Recommending random walks. In: ESEC/SIGSOFT FSE. pp. 15– 24 (2007) 20 20
Evaluation • Case study 21
Evaluation • Quantitative evaluation – Compare the F 1 according to the original documentation 22
Evaluation • The impact of FACG Without FACG With FACG 23
Conclusion 24
Conclusion • Our contribution – We proposed the Flow-Augmented Call Graph – We applied FACG on API recommendation. Our approach could advance the state-of-the-arts – We developed a framework for program analysis by Gcc. • Future work – Recommendation system? – Static analysis? – SMT solving? 25
Q&A • Thanks! 26
27


