论文标题
M3:语义API迁移
M3: Semantic API Migrations
论文作者
论文摘要
图书馆迁移是一个具有挑战性的问题,大多数现有方法都依赖于先验知识。例如,这可以是从变频器或API使用的统计模型中得出的信息。 本文讨论了不同的API迁移方案,其中没有目标库的知识。我们没有历史性的变形值,也无法访问其内部表示。为了解决这个问题,本文提出了一种新颖的方法(M $^3 $),其中概率程序合成用于语义上对库函数的行为进行建模。然后,我们使用基于SMT的代码搜索引擎来发现用户应用程序中的类似代码。这些发现的实例为API迁移提供了潜在的位置。 我们评估了来自不同应用程序域的7个著名库,学习94个功能的实现。我们的方法与标准编译器工具集成在一起,我们使用此集成来评估9个现有的C/C ++应用程序中的迁移机会超过1MLOC。我们发现了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.