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

M3:语义API迁移

M3: Semantic API Migrations

Bruce Collie, Philip Ginsbach, Jackson Woodruff, Ajitha Rajan, Michael O'Boyle

摘要:

图书馆迁移是一个具有挑战性的问题,其中大多数现有的方法依赖于先验知识。例如,这可以是从更新日志或API使用的统计模型中导出的信息。本文讨论了一个不同的API迁移场景,其中没有目标库的先验知识。我们没有历史更新日志,也无法访问其内部表示。为了解决这个问题,本文提出了一种新的方法(M $^3$),概率程序合成是用来语义建模的库函数的行为。然后,我们使用一个基于SMT的代码搜索引擎来发现用户应用程序中的相似代码。这些发现的实例为API迁移提供了潜在的位置。我们评估我们的方法对7个知名的图书馆从不同的应用领域,学习正确的实现94个功能。我们的方法是集成了标准的编译器工具,我们使用这种集成来评估迁移的机会,在9个现有的C/C++应用程序超过1 MLoC。我们发现了这些功能的7,000多个实例,其中2,000多个代表了迁移机会。

英文摘要:

Library migration is a challenging problem, where most existing approaches rely on prior knowledge. This can be, for example, information derived from changelogs or statistical models of API usage. This paper addresses a different API migration scenario where there is no prior knowledge of the target library. We have no historical changelogs and no access to its internal representation. To tackle this problem, this paper proposes a novel approach (M$^3$), where probabilistic program synthesis is used to semantically model the behavior of library functions. Then, we use an SMT-based code search engine to discover similar code in user applications. These discovered instances provide potential locations for API migrations. We evaluate our approach against 7 well-known libraries from varied application domains, learning correct implementations for 94 functions. Our approach is integrated with standard compiler tooling, and we use this integration to evaluate migration opportunities in 9 existing C/C++ applications with over 1MLoC. We discover over 7,000 instances of these functions, of which more than 2,000 represent migration opportunities.

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

↑