摘要
异常处理是一种用来检测异常并对其进行处理的技术.异常传播改变了程序原来的执行路线,从而改变了程序中的数据流.在进行数据流分析时,如果不考虑异常传播对其造成的影响,则得到的信息将是不准确的.在分析C++异常传播机制和异常传播对数据流分析影响的基础上,提出一种包含异常传播信息的函数间控制流图的构建方法.该控制流图可以清晰地表示出异常的隐式控制流和异常的传播路径;然后提出了基于异常传播分析的数据流分析方法,并给出相应的算法.该方法既克服了因忽略异常传播对数据流影响而造成分析结果不准确的不足,又有助于实现异常传播数据流分析的自动处理;最后用一个实例验证了该方法的可用性.该方法可以为结构测试、回归测试、程序切片等软件工程任务提供相关信息.
Exception handling is a technology that tests and handles exception. Exception propagation induces a control flow other than the main control flow, so it changes the data flows of programs. For data flow analysis of C++ programs to be correct and precise, the flows induced by exception propagation must be properly analyzed. Firstly, based on analyzing the exception handling mechanism and the effects of exception propagation on data flow analysis, the paper proposes a precise and efficient representation for C++ programs with exception handling constructs--control flow graph that contains exception propagation. The control flow graph can represent precisely the implicit control flow for a raised exception and exception propagation path. Then this paper proposes an efficient method to analyze the data flow of the programs that contain exception propagations, and some efficient algorithms are also presented. This method overcomes the limitations of previous incorrect analysis due to failing to account for the effects of exception propagation, and also provides a basis for automatic data flow analysis that contains exception propagation. Finally, it validates the usability of the method by a case study. The method can provide related informations for software engineering tasks such as structure testing, regression testing and program slicing.
出处
《软件学报》
EI
CSCD
北大核心
2007年第1期74-84,共11页
Journal of Software
基金
国家杰出青年科学基金
国家自然科学基金
国家重点基础研究发展规划基金(973)
教育部跨世纪优秀人才基金
江苏省高技术研究项目
中国矿业大学科技基金~~
关键词
异常处理
程序分析
异常传播
控制流图
数据流分析
exception handling
program analysis
exception propagation
control flow graph
data flow analysis