节点文献
C++程序中异常处理的分析与测试技术研究
Study on the Analysis and Testing of Exception Handlings in C++ Programs
【摘要】 异常处理机制是一种运行时错误通知机制,将程序的正常控制代码和错误处理代码分离.然而异常机制的引入使得程序控制信息变得更为复杂;且开发人员一般难以熟练使用它,导致程序中会潜伏许多异常错误.扩展已有的显式异常分析技术,对隐式异常也进行了全面的分析并提出了过程间(内)控制流图的构造方法,并以此为基础给出了一个C++程序健壮性改进模型.同时还提出了针对异常的两种动态测试策略基于约束求解的异常测试策略和统计结构性异常测试策略.最后实现了一个初步的异常分析与测试原型工具并进行了初步实验分析,其结果表明本文提出的分析与测试方法对程序质量有较大程度的提高.
【Abstract】 Exception handling is a runtime-error notifying mechanism. It separates the error handling code from normal code and makes software do its utmost to run on the normal state. However, the inclusion of exception handling mechanism makes program’s control information more complex. And it is hard for most developers to master exception, so incorrect usage of exception will bring about more potential faults in the program. Based on the existing analysis techniques for explicit exceptions, this article deals with the implicit exceptions and presents an all-around method of constructing the inter-(intra-) procedure control flow graphs (ICFG/CFG). Accordingly, a model that can improve the robustness of programs via static exception inspection is provided. This article also addresses two strategies of dynamic exception testing, that is, exception testing based on constraints solving and statistical structural exception testing. Finally, a rough prototype tool for exception analysis and testing has been implemented, and some preliminary experiments have been performed under it. The experiment results show that our methods of static exception analysis and dynamic exception testing are fairly effective to improve the quality of programs in the presence of exceptions.
【Key words】 exception handling mechanism; control flow graph (CFG); exception analysis; exception testing; robustness;
- 【文献出处】 小型微型计算机系统 ,Journal of Chinese Computer Systems , 编辑部邮箱 ,2006年03期
- 【分类号】TP312.1
- 【被引频次】8
- 【下载频次】252