期刊文献+

异常信息敏感的框架API生命周期模型构造

Exception-aware Lifecycle-Model Construction for Framework APIs
下载PDF
导出
摘要 大型软件系统的实现依赖于底层框架或第三方库,但这些复杂的框架/库代码在演化升级时往往独立于其调用者,为上层软件的质量保障带来挑战.例如,框架/库代码演化时新增和删除API、更改API的代码语义等行为会导致框架/库代码的不同版本之间不兼容,进而在上层应用开发者更新版本时,影响应用代码的正确性.为应对这一问题,需精准提取框架/库代码API的演化过程,形成演化报告,协助上层应用开发者选择兼容的版本或快速进行代码适配.其中,框架/库代码API的演化过程分析对应着框架API生命周期模型构造.现有工作中的API生命周期模型主要关注API的存在性变动,而未考虑特定代码语义变更对开发者的影响,特别是异常相关代码带来的语义变更,给上层软件系统带来隐患.为此,本文采用面向Java字节码的静态分析方法,识别框架API中的异常抛出行为并为其生成异常摘要报告,通过多轮流式匹配策略获取异常信息的变更情况,最终为框架/库代码构造异常信息敏感的API生命周期模型.该方法:(1)通过控制依赖语句切片提取异常抛出语句的关键触发条件,采用参数推断策略将局部变量的约束条件转换为仅与外部输入参数相关的异常前断言,并基于自底向上的摘要传递实现跨过程异常摘要提取;(2)通过关键信息精准匹配和自适应模糊匹配策略,分析异常摘要信息的新增、删除和修改情况,最终得到异常敏感的API生命周期模型(共涉及七种API变更形式).基于该方法,实现了基于Java字节码分析的API生命周期提取工具JavaExP.与现有最新方法相比,JavaExP的异常摘要信息提取准确性(F1值)提高了67%,分析用时减少了87%.对真实项目的API生命周期演化分析表明,与异常不敏感的API生命周期模型相比,采用异常敏感的模型时,API发生变动的比例提高了18%.在75,433个被分析的API中,约有20%API的异常抛出行为至少发生过一次改变,这些API共涉及超过七千多处独立的异常变更.在多个项目上的分析结果表明,异常敏感的模型构造能够更加精准地描述API的演化过程. The implementation of large-scale software systems usually depends on low-level frameworks,or third-party libraries.However,the evolution of these frameworks or libraries is independent of the upper-level applications,which brings challenges in upper-level code quality assurance.For instance,changes in framework/library code,such as adding or removing APIs and altering API semantics,may result in inconsistencies among different versions of the framework/library code.These inconsistencies can impact the quality of higher-level apps when developers update frameworks/libraries.To address this issue,analyzing the evolution process of framework/library code APIs is essential.This analysis helps upper-level app developers swiftly choose compatible versions or adjust their code.In this context,analyzing the evolution process corresponds to constructing a framework API lifecycle model.Nowadays,existing works propose the API existence-changing model for defect detection,while not considering the influence of semantic changes in APIs,especially exception-related code evolution.To fill this gap,this paper adopts static analysis techniques to extract exception summary information in the framework API code,proposes a multi-step matching strategy to obtain the changing process of exceptions,and finally generates exception-aware API lifecycle models for the given framework/library project.Our approach:(1)adopts control-dependency slicing analysis to extract the conditions of the exception-thrown statements;uses a parameter tracing strategy to transform exception-throwing conditions into external-variable-related preconditions;and performs inter-procedure precondition construction by a bottom-up summary-based analysis.(2)proposes the exact-matching and adaptive-matching strategies to analyze the framework/library code changes including additions,deletions and modifications of APIs;generates exception-aware API lifecycle models which cover seven API changing types.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,the F1 score of exception summary information extracted by JavaExP has increased by 67%,with a reduction in processing time by 87%.The evaluation of real-world projects shows that,compared to the exception-unaware API lifecycle modeling,JavaExP can identify 18%times more API changes.Among the 75,433 APIs under analysis,20%of APIs have changed their exceptionthrowing behavior at least once after API introduction.These APIs involve a total of more than 7K independent exception changes.The overall results show that the exception-aware lifecycle modeling can describe the evolution process of APIs more accurately.
作者 燕季薇 黄进豪 杨恒钦 严俊 YAN Ji-Wei;HUANG Jin-Hao;YANG Heng-Qin;YAN Jun(Technology Center of Software Engineering,Institute of Software,Chinese Academy of Sciences,Beijing 100190;Faculty of Information Technology,Beijing University of Technology,Beijing 100124;Hangzhou Institute for Advanced Study,University of Chinese Academy of Sciences,Hangzhou 310024;Key Laboratory of System Software,Institute of Software,Chinese Academy of Sciences,Beijing 100190;State Key Laboratory of Computer Science,Institute of Software,Chinese Academy of Sciences,Beijing 100190)
出处 《计算机学报》 EI CAS CSCD 北大核心 2024年第9期1989-2008,共20页 Chinese Journal of Computers
基金 国家自然科学基金青年科学基金(No.62102405) 国家自然科学基金重点项目(No.62132020) 中国科学院软件研究所创新基金重大重点项目(ISCAS-ZD-202302)资助.
关键词 静态分析 代码演化 Java异常摘要 API生命周期 static analysis program evolution Java exception summary API lifecycle
  • 相关文献

参考文献3

二级参考文献34

  • 1庞建民,赵荣彩,王怀民.Haskell语言的高阶特性及其应用[J].计算机科学,2005,32(6):167-168. 被引量:8
  • 2毛澄映,卢炎生.C++程序中异常处理的分析与测试技术研究[J].小型微型计算机系统,2006,27(3):481-485. 被引量:5
  • 3姜淑娟,徐宝文,史亮.一种基于异常传播分析的数据流分析方法[J].软件学报,2007,18(1):74-84. 被引量:14
  • 4Garcia A F, Rubira C M F, Romanovsky A et al. A comparative study of exception handling mechanisms for building dependable object-oriented software [J]. The Journal of Systems and Software, 2001, 59: 197-222.
  • 5Goodenough J B. Exception handling: issues and a proposed notation[J]. Communications of the ACM 18, 12, 1975, 683-696.
  • 6Cristian F. Exception handling and tolerance of software faults [A]. In:M. Lyu, editor, Software Fault Tolerance[M], 1995,81-107.
  • 7Toy WN. Fault-tolerant design of local ESS processors [C].Proceedings the IEEE,York,1978,66(10) :1126-1145.
  • 8Fetzer C, Hogstedt K, Felber P. Automatic detection and masking of non-atomic exception bandling[C]. Proceedings of the 2003 International Conference on Dependable Systems and Networks (DSN' 03), 2003,445-454.
  • 9Sinha S, Harrold M J. Analysis and testing of programs with exception-handling constructs[J]. IEEE Transactions on Software Engineering 26, September 2000,849-871.
  • 10Bieman J M, Dreilinger D, Lin Li-jun. Using fault injection to increase software test coverage[A]. Software Reliability Engineering Proceedings Seven International Symposium[C]. New York: IEEE Computer Society, 1996,166-174.

共引文献2

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部