摘要
动态内存故障在使用指针的程序中是普遍存在的,采用动态测试方法进行测试难以准确定位故障源.而现有的静态分析方法主要存在漏报和误报过多的情况.针对这些问题,提出了指针映射代数系统的概念,全面地反映了指针与内存之间的映射关系,并给出了面向不同故障的指针映射集的构造规则,以此为基础建立了动态内存故障模型.通过指针映射集和故障模型,可以自动检测内存释放异常、内存泄露和空指针引用等动态内存故障,提高了测试效率.在分析过程中,还综合应用了控制流图和路径条件,提高了测试结果的精度.实验结果表明,该方法能够有效检测动态内存故障,而且由于规则定义较为全面,漏报和误报率也较低.
Dynamic memory faults are ubiquitous in the program with pointers. It is difficult to locate faults sources adopting dynamic testing method. Static analysis methods nowadays often miss some faults and produce too many false alarms. Considering of these problems, this paper puts forward the notion of pointer mapping algebra system that reflects the mapping relationship of pointer and memory completely, and gives the construction rules of pointer mapping sets for different faults class, and then establishes dynamic memory faults model. Through pointer mapping sets and fault model, it can detect bad deallocation, memory leak and null pointer dereference faults automatically and increase the testing efficiency. In the process of analyzing, it adopts synthetically control flow chart and path condition in order to increase the precision of testing results. Results of experimentation show that this method can detect dynamic memory faults effectively. Since rule definition is general, the probability of missing faults and producing false alarms is lower.
出处
《计算机学报》
EI
CSCD
北大核心
2009年第11期2274-2281,共8页
Chinese Journal of Computers
基金
国家"八六三"高技术研究发展计划探索导向类项目基金(2007AA010302
2009AA012404)资助
关键词
软件测试
静态分析
指针映射集
内存泄漏
空指针引用
software testing
static analysis
pointer mapping sets
memory leak
null pointerdereference