首页 | 本学科首页   官方微博 | 高级检索  
     

C++程序中异常处理的分析与测试技术研究
引用本文:毛澄映,卢炎生.C++程序中异常处理的分析与测试技术研究[J].小型微型计算机系统,2006,27(3):481-485.
作者姓名:毛澄映  卢炎生
作者单位:华中科技大学,计算机科学与技术学院,湖北,武汉,430074
基金项目:国家科技预研项目;海军总装备部预研项目
摘    要:异常处理机制是一种运行时错误通知机制,将程序的正常控制代码和错误处理代码分离.然而异常机制的引入使得程序控制信息变得更为复杂;且开发人员一般难以熟练使用它,导致程序中会潜伏许多异常错误.扩展已有的显式异常分析技术,对隐式异常也进行了全面的分析并提出了过程间(内)控制流图的构造方法,并以此为基础给出了一个C++程序健壮性改进模型.同时还提出了针对异常的两种动态测试策略:基于约束求解的异常测试策略和统计结构性异常测试策略.最后实现了一个初步的异常分析与测试原型工具并进行了初步实验分析,其结果表明本文提出的分析与测试方法对程序质量有较大程度的提高.

关 键 词:异常处理机制  控制流图  异常分析  异常测试  健壮性
文章编号:1000-1220(2006)03-0481-05
收稿时间:11 22 2004 12:00AM
修稿时间:2004-11-22

Study on the Analysis and Testing of Exception Handlings in C++ Programs
MAO Cheng-ying,LU Yan-sheng.Study on the Analysis and Testing of Exception Handlings in C++ Programs[J].Mini-micro Systems,2006,27(3):481-485.
Authors:MAO Cheng-ying  LU Yan-sheng
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.
Keywords:exception handling mechanism  control flow graph (CFG)  exception analysis  exception testing  robustness
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号