首页> 外文会议>IEEE/ACM International Conference on Program Comprehension >Meditor: Inference and Application of API Migration Edits
【24h】

Meditor: Inference and Application of API Migration Edits

机译:PICETOR:API迁移编辑的推理和应用

获取原文

摘要

Developers build programs based on software libraries. When a library evolves, programmers need to migrate their client code from the library's old release(s) to new release(s). Due to the API backwards incompatibility issues, such code migration may require developers to replace API usage and apply extra edits (e.g., statement insertions or deletions) to ensure the syntactic or semantic correctness of migrated code. Existing tools extract API replacement rules without handling the additional edits necessary to fulfill a migration task. This paper presents our novel approach, Meditor, which extracts and applies the necessary edits together with API replacement changes. Meditor has two phases: inference and application of migration edits. For edit inference, Meditor mines open source repositories for migration-related (MR) commits, and conducts program dependency analysis on changed Java files to locate and cluster MR code changes. From these changes, Meditor further generalizes API migration edits by abstracting away unimportant details (e.g., concrete variable identifiers). For edit application, Meditor matches a given program with inferred edits to decide which edit is applicable, customizes each applicable edit, and produces a migrated version for developers to review. We applied Meditor to four popular libraries: Lucene, CraftBukkit, Android SDK, and Commons IO. By searching among 602,249 open source projects on GitHub, Meditor identified 1,368 unique migration edits. Among these edits, 885 edits were extracted from single updated statements, while the other 483 more complex edits were from multiple co-changed statements. We sampled 937 inferred edits for manual inspection and found all of them to be correct. Our evaluation shows that Meditor correctly applied code migrations in 218 out of 225 cases. This research will help developers automatically adapt client code to different library versions.
机译:开发人员根据软件库构建程序。当库演变时,程序员需要将其客户端代码从库的旧版本迁移到新版本。由于API向后不兼容问题,此类代码迁移可能需要开发人员替换API使用率并应用额外的编辑(例如,语句插入或删除),以确保迁移代码的句法或语义正确性。现有工具提取API替换规则,无需处理符合迁移任务所需的其他编辑。本文提出了我们的新方法,介绍,其中提取并将必要的编辑与API替换变化一起提取。介绍有两个阶段:推理和应用迁移编辑。对于编辑推理,Medors Mines开源用于迁移相关(MR)提交的源存储库,并在更改的Java文件中进行程序依赖性分析以定位和群集MR代码更改。从这些变化,介绍,通过抽出不重要的细节(例如,具体可变标识符),进一步概括了API迁移编辑。对于编辑应用程序,Mintor匹配带有推断编辑的给定程序来决定适用的编辑,自定义每个适用的编辑,并为开发人员提供迁移的版本来审查。我们应用于四个流行的库:Lucene,CraftBukkit,Android SDK和Commons Io。通过在GitHub上的602,249个开源项目中搜索,Mintors确定了1,368个独特的迁移编辑。在这些编辑中,从单个更新语句中提取885编辑,而另一个483更复杂的编辑来自多个共同改变的语句。我们采样937推断用于手动检查,并发现所有这些都是正确的。我们的评价显示,225例案例中218例,Mintors正确应用了代码迁移。本研究将帮助开发人员自动将客户端代码调整到不同的库版本。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号