arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1906.02591cs.SE
收藏

使用信息检索在方法级自动检测第三方Java库迁移

On the Use of Information Retrieval to Automate the Detection of Third-Party Java Library Migration at the Method Level

Hussein Alrubaye, Mohamed Wiem Mkaouer, Ali Ouni

摘要:

不同第三方库之间的迁移过程困难、复杂且容易出错。通常,在库迁移过程中,开发人员需要在新库中找到最适合替换退役库中旧方法的方法。这个过程是主观和耗时的,因为开发人员需要完全理解两个库应用程序编程接口的文档,并找到它们的方法之间的正确匹配(如果存在)。在这种情况下,一些研究依赖于挖掘现有的库迁移,为开发人员提供类似场景的示例方法。在本文中,我们介绍了一种新的挖掘方法,提取现有的实例库方法替换手动执行的开发人员为一个给定的库迁移自动生成迁移模式的方法级别。此后,我们的方法结合了挖掘方法的变化模式与方法相关的词汇相似性,以准确地检测替换/被替换的方法之间的映射。我们进行了一项大规模的实证研究,以57,447个开源Java项目为基准评估我们的方法,导致9个流行的库迁移。我们的定性结果表明,我们的方法显着提高了挖掘方法级映射的准确性,平均准确率为12%,以及增加发现的方法映射的数量,与现有的最先进的研究相比。最后,我们为社区提供了一个开源挖掘工具以及方法级别所有挖掘迁移的数据集。

英文摘要:

The migration process between different third-party libraries is hard, complex and error-prone. Typically, during a library migration, developers need to find methods in the new library that are most adequate in replacing the old methods of the retired library. This process is subjective and time-consuming as developers need to fully understand the documentation of both libraries Application Programming Interfaces, and find the right matching between their methods if it exists. In this context, several studies rely on mining existing library migrations to provide developers with by-example approaches for similar scenarios. In this paper, we introduce a novel mining approach that extracts existing instances of library method replacements that are manually performed by developers for a given library migration to automatically generate migration patterns in the method level. Thereafter, our approach combines the mined method-change patterns with method-related lexical similarity to accurately detect mappings between replacing/replaced methods. We conduct a large scale empirical study to evaluate our approach on a benchmark of 57,447 open-source Java projects leading to 9 popular library migrations. Our qualitative results indicate that our approach significantly increases the accuracy of mining method-level mappings by an average accuracy of 12%, as well as increasing the number of discovered method mappings, in comparison with existing state-of-the-art studies. Finally, we provide the community with an open source mining tool along with a dataset of all mined migrations at the method level.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑