摘要
引用未初始化变量故障往往存在于C/C++程序中,该类故障常常会导致系统崩溃.鉴于传统测试方法、编译器和现有静态测试工具检测这类故障的局限性,本文提出了基于引用未初始化变量故障模型的静态测试方法.首先给出了引用未初始化变量的形式化定义,作为研究引用未初始化变量的基础;分析了变量状态及其变化,建立了变量状态集产生模型,作为静态识别引用未初始化变量的前提基础;建立了引用未初始化变量故障模型,作为静态识别引用未初始化变量的依据;提出了引用未初始化变量自动测试算法.实验结果表明,基于引用未初始化变量故障模型的静态测试方法具有较高的故障检测准确率和测试效率,这说明建立的故障模型和自动测试方法是有效的.
Referencing uninitialized variables usually exist in C/C+ + programs, and often lead to system crash. Since the limitation of traditional testing methods, compilers and existing static testing tools in detecting referencing uninitialized variables, a static testing method based on the fault model of referencing uninitialized variables is proposed in this paper. Formal definition of referencing uninitialized variables is given firstly, as the basis of investigating referencing uninitialized variables. Variable's state and its transformations are analyzed, and the generation model of variables' states set is established, as the preconditions of identifying referencing uninitialized variables statically. Fault model of referencing uninitialized variables is established, as the basis of identifying referencing uninitialized variables statically. The automatic testing algorithm of referencing uninitialized variables is proposed. The experimental result shows that the static testing method could detect referencing uninitialized variables with higher accuracy and efficiency, which means that the fault model and the automatic testing method are valid.
出处
《小型微型计算机系统》
CSCD
北大核心
2007年第5期948-951,共4页
Journal of Chinese Computer Systems
基金
总装备部十五预研基金(41315050107)资助
关键词
软件测试
引用未初始化变量
故障模型
静态测试方法
software testing
referencing uninitialized variables
fault model
static testing method