A graph-based approach to API usage adaptation

A graph-based approach to API usage adaptation
复制标题

DOI:
10.1145/1869459.1869486
复制
发表时间:
2010-10
期刊:
Proceedings of the ACM international conference on Object oriented programming systems languages and applications
影响因子:
--
通讯作者:
H. Nguyen;T. Nguyen;G. Wilson;A. Nguyen;Miryung Kim;T. Nguyen
H. Nguyen;T. Nguyen;G. Wilson;A. Nguyen;Miryung Kim;T. Nguyen
中科院分区:
其他
文献类型:
--
作者:
H. Nguyen;T. Nguyen;G. Wilson;A. Nguyen;Miryung Kim;T. Nguyen

文献摘要

被引文献

相似文献

重用现有的库组件对于降低软件开发和维护成本至关重要。当库组件发展以适应新的功能请求、修复错误或满足新标准时,软件库的客户端通常需要进行相应的更改以正确地使用更新的库。现有的API使用适配技术支持简单的适配,例如替换对过时API的调用的目标,然而,不能处理复杂的适配,例如创建要传递到不同API方法的新对象,或者添加围绕更新的API方法调用的异常处理逻辑。本文介绍了LIBSYNC,它通过从已经迁移到新库版本的其他客户端(以及库的测试代码中的API用法)学习复杂的API用法适应模式,来指导开发人员调整API用法代码。LIBSYNC使用几种基于图的技术(1)通过比较两个库版本来识别API声明的变化,(2)在库迁移之前和之后提取相关的API使用框架,以及(3)比较提取的API使用框架以恢复API使用适应模式。使用学习到的适应模式,LIBSYNC建议用于适应API用法的位置和编辑操作。在实际软件系统上的测试表明,LIBSYNC具有很高的正确率和实用性,准确率为100%,召回率为91%。
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%.