Computer Engineering and Applications ›› 2015, Vol. 51 ›› Issue (3): 69-73.

Previous Articles     Next Articles

Software defect pattern analysis and location based on Cppcheck

ZHANG Shijin, SHANG Zhaowei   

  1. Computer School of Chongqing University, Chongqing 400030, China
  • Online:2015-02-01 Published:2015-01-28

Cppcheck的软件缺陷模式分析与定位

张仕金,尚赵伟   

  1. 重庆大学 计算机学院,重庆 400030

Abstract: The C/C++ program which is compiled well does not always guarantee that there are no defects in the code. There may still contain defects relativing to securities, design and code style, therefore it may result in memory leak or misuse of pointers so that it is difficult to accomplish the expected goal of software requirements. Aiming to software defection tool of Cppcheck’s insufficiency for open software defect, this paper mainly analyses the Cppcheck architecture, defect pattern representation and implementation, as well as on the basis of summarizing 350 defect patterns to improve Cppcheck. It makes two relevant experiments to verify the effectiveness of improved Cppcheck.

Key words: software defect, defect pattern, Cppcheck

摘要: 能通过编译的C/C++程序代码可能依然隐含安全、设计或风格上缺陷,从而导致运行时出现内存泄露、运行异常等现象,难以完成软件需求所预期的目标。针对开源软件缺陷检测工具Cppcheck软件存在的不足,主要分析了Cppcheck架构、缺陷模式表示与实现,在对已收集350个缺陷模式分析总结基础上,对其完善,提高缺陷检测能力。通过两组实验验证改进Cppcheck工作的有效性。

关键词: 软件缺陷, 缺陷模式, Cppcheck