arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2401.02660cs.SE
收藏

面向框架API的异常感知生命周期模型构建

Exception-aware Lifecycle Model Construction for Framework APIs

Jiwei Yan, Jinhao Huang, Hengqin Yang, Jun Yan

AI总结:

本文提出基于静态分析和多步匹配的异常感知API生命周期模型构建方法及工具JavaExP,解决了现有API存在性模型忽略语义变化的问题,在F1分数和效率上显著优于现有工具并能识别更多兼容性隐患。

摘要:

复杂软件系统的实现通常依赖于底层框架或第三方库。在它们的演化过程中,API的添加和移除行为可能会引起意外的兼容性问题。因此,精确分析和构建框架/库的API生命周期模型具有重要意义。现有工作提出了用于缺陷检测的API存在性变更模型,但未考虑API语义变化的影响。在某些情况下,开发者不会移除或弃用API,而是通过添加、移除或修改其抛出异常的代码来修改其语义,这可能会给上层代码带来潜在缺陷。因此,除了API存在性模型外,开发者还需要关注API中与异常相关的代码演化,这需要为框架/库项目构建异常感知的API生命周期模型。为实现自动构建异常感知的API生命周期模型,本文采用静态分析技术提取框架API代码中的异常摘要信息,并采用多步匹配策略获取异常的变化过程。然后,它为给定的框架/库项目生成异常感知的API生命周期模型。通过这种方法,实现了基于Java字节码分析的API生命周期提取工具JavaExP。与最先进的工具相比,JavaExP在F1分数(+60%)和效率(+7倍)上均取得更高表现,其异常匹配和变化结果的准确率为98%。在60个版本上与无异常感知的API生命周期建模相比,JavaExp能够多识别18%的API变化。在分析的75,433个API中,20%的API在引入后至少改变了一次抛出异常的行为,这可能带来许多隐藏的兼容性问题。

英文摘要:

The implementation of complex software systems usually depends on low-level frameworks or third-party libraries. During their evolution, the APIs adding and removing behaviors may cause unexpected compatibility problems. So, precisely analyzing and constructing the framework/ library's API lifecycle model is of great importance. Existing works have proposed the API existence-changing model for defect detection, while not considering the influence of semantic changes in APIs. In some cases, developers will not remove or deprecate APIs but modify their semantics by adding, removing, or modifying their exception-thrown code, which may bring potential defects to upper-level code. Therefore, besides the API existence model, it is also necessary for developers to be concerned with the exception-related code evolution in APIs, which requires the construction of exception-aware API lifecycle models for framework/library projects. To achieve automatic exception-aware API lifecycle model construction, this paper adopts a static analysis technique to extract exception summary information in the framework API code and adopts a multi-step matching strategy to obtain the changing process of exceptions. Then, it generates exception-aware API lifecycle models for the given framework/library project. With this approach, the API lifecycle extraction tool, JavaExP, is implemented, which is based on Java bytecode analysis. Compared to the state-of-the-art tool, JavaExP achieves both a higher F1 score (+60%) and efficiency (+7x), whose precision of exception matching and changing results is 98%. Compared to the exception-unaware API lifecycle modeling on 60 versions, JavaExp can identify 18% times more API changes. Among the 75,433 APIs under analysis, 20% of APIs have changed their exception-throwing behavior at least once after API introduction, which may bring many hidden compatibility issues.

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

↑