计算机学报
計算機學報
계산궤학보
CHINESE JOURNAL OF COMPUTERS
2009年
11期
2274-2281
,共8页
张威%宫云战%卢庆龄%万琳
張威%宮雲戰%盧慶齡%萬琳
장위%궁운전%로경령%만림
软件测试%静态分析%指针映射集%内存泄漏%空指针引用
軟件測試%靜態分析%指針映射集%內存洩漏%空指針引用
연건측시%정태분석%지침영사집%내존설루%공지침인용
software testing%static analysis%pointer mapping sets%memory leak%null pointer dereference
动态内存故障在使用指针的程序中是普遍存在的,采用动态测试方法进行测试难以准确定位故障源.而现有的静态分析方法主要存在漏报和误报过多的情况.针对这些问题,提出了指针映射代数系统的概念,全面地反映了指针与内存之间的映射关系,并给出了面向不同故障的指针映射集的构造规则,以此为基础建立了动态内存故障模型.通过指针映射集和故障模型,可以自动检测内存释放异常、内存泄露和空指针引用等动态内存故障,提高了测试效率.在分析过程中,还综合应用了控制流图和路径条件,提高了测试结果的精度.实验结果表明,该方法能够有效检测动态内存故障,而且出于规则定义较为全面,漏报和误报率也较低.
動態內存故障在使用指針的程序中是普遍存在的,採用動態測試方法進行測試難以準確定位故障源.而現有的靜態分析方法主要存在漏報和誤報過多的情況.針對這些問題,提齣瞭指針映射代數繫統的概唸,全麵地反映瞭指針與內存之間的映射關繫,併給齣瞭麵嚮不同故障的指針映射集的構造規則,以此為基礎建立瞭動態內存故障模型.通過指針映射集和故障模型,可以自動檢測內存釋放異常、內存洩露和空指針引用等動態內存故障,提高瞭測試效率.在分析過程中,還綜閤應用瞭控製流圖和路徑條件,提高瞭測試結果的精度.實驗結果錶明,該方法能夠有效檢測動態內存故障,而且齣于規則定義較為全麵,漏報和誤報率也較低.
동태내존고장재사용지침적정서중시보편존재적,채용동태측시방법진행측시난이준학정위고장원.이현유적정태분석방법주요존재루보화오보과다적정황.침대저사문제,제출료지침영사대수계통적개념,전면지반영료지침여내존지간적영사관계,병급출료면향불동고장적지침영사집적구조규칙,이차위기출건립료동태내존고장모형.통과지침영사집화고장모형,가이자동검측내존석방이상、내존설로화공지침인용등동태내존고장,제고료측시효솔.재분석과정중,환종합응용료공제류도화로경조건,제고료측시결과적정도.실험결과표명,해방법능구유효검측동태내존고장,이차출우규칙정의교위전면,루보화오보솔야교저.
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 map-ping sets and fault model, it can detect bad deallocation, memory leak and null pointer derefer-ence 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 re-sults. Results of experimentation show that this method can detect dynamic memory faults effec-tively. Since rule definition is general, the probability of missing faults and producing false alarms is lower.