Abstract
Reusing existing library components is essential for reducing the cost of software development and maintenance. When library components evolve to accommodate new feature requests, to fix bugs, or to meet new standards, the clients of software libraries often need to make corresponding changes to correctly use the updated libraries. Existing API usage adaptation techniques support simple adaptation such as replacing the target of calls to a deprecated API, however, cannot handle complex adaptations such as creating a new object to be passed to a different API method, or adding an exception handling logic that surrounds the updated API method calls.
This paper presents LIBSYNC that guides developers in adapting API usage code by learning complex API usage adaptation patterns from other clients that already migrated to a new library version (and also from the API usages within the library's test code). LIBSYNC uses several graph-based techniques (1) to identify changes to API declarations by comparing two library versions, (2) to extract associated API usage skeletons before and after library migration, and (3) to compare the extracted API usage skeletons to recover API usage adaptation patterns. Using the learned adaptation patterns, LIBSYNC recommends the locations and edit operations for adapting API usages. The evaluation of LIBSYNC on real-world software systems shows that it is highly correct and useful with a precision of 100% and a recall of 91%.
- }}M. Acharya, T. Xie, J. Pei, and J. Xu. Mining API patterns as partial orders from source code: from usage scenarios to specifications. In ESEC-FSE '07: Proceedings of the 6th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering, pages 25--34. ACM Press, 2007. Google Scholar
Digital Library
- }}R. Agrawal and R. Srikant. Fast algorithms for mining association rules in large databases. In VLDB '94: Proceedings of the 20th International Conference on Very Large Data Bases, pages 487--499. Morgan Kaufmann Publishers Inc., 1994. Google Scholar
Digital Library
- }}J. Andersen and J. Lawall. Generic patch inference. In ASE '08: Proceedings of the 23rd IEEE/ACM International Conference on Automated Software Engineering, 2008, pages 337--346. IEEE Computer Society, 2008. Google Scholar
Digital Library
- }}A. Andoni and PiotrIndyk. E2 lsh 0.1 user manual. http://web.mit.edu/andoni/www/LSH/manual.pdf.Google Scholar
- }}T. Apiwattanapong, A. Orso, and M. J. Harrold. A differencing algorithm for object-oriented programs. In ASE '04: Proceedings of the 19th IEEE International Conference on Automated Software Engineering, pages 2--13. IEEE Computer Society, 2004. Google Scholar
Digital Library
- }}D. Binkley, S. Horwitz, and T. Reps. Program integration for languages with procedure calls. ACM Transactions on Software Engineering and Methodology, 4(1):3--35, 1995. Google Scholar
Digital Library
- }}K. Chow and D. Notkin. Semi-automatic update of applications in response to library changes. In ICSM '96: Proceedings of the 1996 International Conference on Software Maintenance, page 359. IEEE Computer Society, 1996. Google Scholar
Digital Library
- }}B. Dagenais and M. P. Robillard. Recommending adaptive changes for framework evolution. In ICSE '08: Proceedings of the 30th International Conference on Software Engineering, pages 481--490. ACM Press, 2008. Google Scholar
Digital Library
- }}D. Dig and R. Johnson. The role of refactorings in API evolution. In ICSM '05: Proceedings of the 21st IEEE International Conference on Software Maintenance, pages 389--398. IEEE Computer Society, 2005. Google Scholar
Digital Library
- }}D. Dig and R. Johnson. Automated detection of refactorings in evolving components. In ECOOP '06: Proceedings of European Conference on Object-Oriented Programming, pages 404--428. Springer, 2006. Google Scholar
Digital Library
- }}D. Dig, K. Manzoor, R. Johnson, and T. N. Nguyen. Refactoring-aware configuration management for object-oriented programs. In ICSE '07: Proceedings of the 29th International Conference on Software Engineering, pages 427--436. IEEE Computer Society, 2007. Google Scholar
Digital Library
- }}D. Engler, D. Y. Chen, S. Hallem, A. Chou, and B. Chelf. Bugs as deviant behavior: a general approach to inferring errors in systems code. In SOSP '01: Proceedings of the eighteenth ACM symposium on Operating systems principles, pages 57--72. ACM Press, 2001. Google Scholar
Digital Library
- }}B. Fluri, M. Wursch, M. Pinzger, and H. C. Gall. Change distilling - tree differencing for fine-grained source code change extraction. IEEE Transactions on Software Engi- neering, 33(11):18, November 2007. Google Scholar
Digital Library
- }}M. Gabel and Z. Su. Javert: fully automatic mining of general temporal properties from dynamic traces. In SIGSOFT '08/FSE-16: Proceedings of the 16th ACM SIGSOFT International Symposium on Foundations of software engineering, pages 339--349. ACM Press, 2008. Google Scholar
Digital Library
- }}J. Henkel and A. Diwan. CatchUp!: capturing and replaying refactorings to support API evolution. In ICSE '05: Proceedings of the 27th International Conference on Software Engineering, pages 274--283. ACM Press, 2005. Google Scholar
Digital Library
- }}J. W. Hunt and M. Mcilroy. An algorithm for differential file comparison. Technical report, 1976.Google Scholar
- }}J. W. Hunt and T. G. Szymanski. A fast algorithm for computing longest common subsequences. Communications of the ACM, 20(5):350--353, 1977. Google Scholar
Digital Library
- }}M. Kim, D. Notkin, and D. Grossman. Automatic inference of structural changes for matching across program versions. In ICSE '07: Proceedings of the 29th International Conference on Software Engineering, pages 333--343. IEEE Computer Society, 2007. Google Scholar
Digital Library
- }}S. Kim, K. Pan, and J. E. James Whitehead. When functions change their names: Automatic detection of origin relationships. In WCRE '05: Proceedings of the 12th Working Conference on Reverse Engineering, pages 143--152. IEEE Computer Society, 2005. Google Scholar
Digital Library
- }}S. Kim, E. J. Whitehead, and . J. Bevan, Jr. Properties of signature change patterns. In ICSM '06: Proceedings of the 22nd IEEE International Conference on Software Maintenance, pages 4--13. IEEE Computer Society, 2006. Google Scholar
Digital Library
- }}J. L. Lawall, G. Muller, and N. Palix. Enforcing the use of API functions in Linux code. In ACP4IS '09: Proceedings of the 8th workshop on Aspects, components, and patterns for infrastructure software, pages 7--12. ACM Press, 2009. Google Scholar
Digital Library
- }}B. Livshits and T. Zimmermann. Dynamine: finding common error patterns by mining software revision histories. SIGSOFT Softw. Eng. Notes, 30(5):296--305, 2005. Google Scholar
Digital Library
- }}I. Neamtiu, J. S. Foster, and M. Hicks. Understanding source code evolution using Abstract Syntax Tree matching. In MSR'05: Proceedings of the 2005 Mining Software Repositories Workshop, pages 2--6. ACM Press, 2005. Google Scholar
Digital Library
- }}H. A. Nguyen, T. T. Nguyen, N. H. Pham, J. M. Al-Kofahi, and T. N. Nguyen. Accurate and efficient structural characteristic feature extraction for clone detection. In FASE '09: Proceedings of the International Conference on Fundamental Approaches to Software Engineering, pages 440--455. Springer Verlag, 2009. Google Scholar
Digital Library
- }}T. T. Nguyen, H. A. Nguyen, N. H. Pham, J. M. Al-Kofahi, and T. N. Nguyen. Graph-based Mining of Multiple Object Usage Patterns. In ESEC/FSE '09: Proceedings of the 17th ACM SIGSOFT Symposium on the Foundations of Software Engineering. ACM Press, 2009. Google Scholar
Digital Library
- }}Y. Padioleau, J. L. Lawall, and G. Muller. Understanding collateral evolution in linux device drivers. SIGOPS Operating Systems Review, 40(4):59--71, 2006. Google Scholar
Digital Library
- }}Y. Padioleau, J. L. Lawall, and G. Muller. SmPL: A domain-specific language for specifying collateral evolutions in linux device drivers. Electronic Notes Theoretical Computer Science, 166:47--62, 2007. Google Scholar
Digital Library
- }}M. Pradel and T. R. Gross. Automatic generation of object usage specifications from large method traces. In ASE '09: Proceedings of the 24th IEEE/ACM International Conference on Automated Software Engineering, pages 371--382. IEEE Computer Society, 2009. Google Scholar
Digital Library
- }}M. K. Ramanathan, A. Grama, and S. Jagannathan. Path-sensitive inference of function precedence protocols. In ICSE '07: Proceedings of 29th international conference on Software Engineering, pages 240--250. IEEE CS, 2007. Google Scholar
Digital Library
- }}S. Shoham, E. Yahav, S. Fink, and M. Pistoia. Static specification mining using automata-based abstractions. In ISSTA '07: Proceedings of the international symposium on Software testing and analysis, pages 174--184. ACM Press, 2007. Google Scholar
Digital Library
- }}JBoss: An open source, standards-compliant, J2EE based application server. http://sourceforge.net/projects/jboss/.Google Scholar
- }}Subversion.tigris.org. http://subversion.tigris.org/.Google Scholar
- }}W. Tansey and E. Tilevich. Annotation refactoring: inferring upgrade transformations for legacy applications. In OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications, pages 295--312. ACM Press, 2008. Google Scholar
Digital Library
- }}S. Thummalapenta and T. Xie. Alattin: Mining alternative patterns for detecting neglected conditions. In ASE '09: Proceedings of the 24th International Conference on Automated Software Engineering, pages 283--294. IEEE Computer Society, 2009. Google Scholar
Digital Library
- }}W. F. Tichy. The string-to-string correction problem with block moves. ACM Transactions on Computer Systems, 2(4):309--321, 1984. Google Scholar
Digital Library
- }}A. Wasylkowski and A. Zeller. Mining temporal specifications from object usage. In ASE '09: Proceedings of the 24th IEEE/ACM International Conference on Automated Software Engineering, pages 295--306. IEEE Computer Society, 2009. Google Scholar
Digital Library
- }}A. Wasylkowski, A. Zeller, and C. Lindig. Detecting object usage anomalies. In ESEC-FSE '07: Proceedings of the 6th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on Foundations of software engineering, pages 35--44. ACM Press, 2007. Google Scholar
Digital Library
- }}P. Weissgerber and S. Diehl. Identifying refactorings from source-code changes. In ASE '06: Proceedings of the 21st IEEE/ACM International Conference on Automated Software Engineering, pages 231--240. IEEE Computer Society, 2006. Google Scholar
Digital Library
- }}C. C.Williams and J. K. Hollingsworth. Automatic mining of source code repositories to improve bug finding techniques. IEEE Trans. Softw. Eng., 31(6):466--480, 2005. Google Scholar
Digital Library
- }}W.Wu, Y.-G. Gueheneuc, G. Antoniol, and M. Kim. Aura: A hybrid approach to identify framework evolution. In ICSE '10: Proceedings of the 32nd International Conference on Software Engineering. ACM Press, 2010. Google Scholar
Digital Library
- }}Z. Xing and E. Stroulia. Umldiff: an algorithm for object-oriented design differencing. In ASE '05: Proceedings of the 20th IEEE/ACM International Conference on Automated Software Engineering, pages 54--65. ACM Press, 2005. Google Scholar
Digital Library
- }}Z. Xing and E. Stroulia. Refactoring practice: How it is and how it should be supported - an Eclipse case study. In ICSM '06: Proceedings of the 22nd IEEE International Conference on Software Maintenance, pages 458--468. IEEE Computer Society, 2006. Google Scholar
Digital Library
- }}Z. Xing and E. Stroulia. API-evolution support with Diff-Catchup. IEEE Trans. Softw. Eng., 33(12):818--836, 2007. Google Scholar
Digital Library
- }}J. Yang, D. Evans, D. Bhardwaj, T. Bhat, and M. Das. Perracotta: mining temporal API rules from imperfect traces. In ICSE '06: Proceedings of the 28th international conference on Software engineering, pages 282--291. ACM Press, 2006. Google Scholar
Digital Library
- }}R. Yokomori, H. Siy, M. Noro, and K. Inoue. Assessing the impact of framework changes using component ranking. In ICSM '09: Proceedings of the International Conference on Software Maintenance, pages 189--198. IEEE Computer Society, 2009.Google Scholar
Cross Ref
- }}H. Zhong, L. Zhang, T. Xie, and H. Mei. Inferring resource specifications from natural language API documentation. In ASE '09: Proceedings of the 24th IEEE/ACM International Conference on Automated Software Engineering, ACM Press, 2009. Google Scholar
Digital Library
- }}L. Zou and M. W. Godfrey. Using origin analysis to detect merging and splitting of source code entities. IEEE Transactions on Software Engineering, 31(2):166--181, 2005. Google Scholar
Digital Library
Index Terms
A graph-based approach to API usage adaptation
Recommendations
A graph-based approach to API usage adaptation
OOPSLA '10: Proceedings of the ACM international conference on Object oriented programming systems languages and applicationsReusing existing library components is essential for reducing the cost of software development and maintenance. When library components evolve to accommodate new feature requests, to fix bugs, or to meet new standards, the clients of software libraries ...
Eclipse API usage: the good and the bad
Today, when constructing software systems, many developers build their systems on top of frameworks. Eclipse is such a framework that has been in existence for over a decade. Like many other evolving software systems, the Eclipse platform has both ...
Exploring API: client co-evolution
WAPI '18: Proceedings of the 2nd International Workshop on API Usage and EvolutionSoftware libraries evolve over time, as do their APIs and the clients that use them. Studying this co-evolution of APIs and API clients can give useful insights into both how to manage the co-evolution, and how to design software so that it is more ...







Comments