引用本文: | 龚丹丹,王甜甜,苏小红,马培军.冗余代码缺陷检测方法[J].哈尔滨工业大学学报,2012,44(7):58.DOI:10.11918/j.issn.0367-6234.2012.07.011 |
| GONG Dan-dan,WANG Tian-tian,SU Xiao-hong,MA Pei-jun.Redundancy detection based on control structure analysis[J].Journal of Harbin Institute of Technology,2012,44(7):58.DOI:10.11918/j.issn.0367-6234.2012.07.011 |
|
摘要: |
为解决冗余代码缺陷检测复杂度较高且检测精度较低的问题,设计并实现了基于控制结构的冗余代码检测模型.通过对TOKEN序列建立复合语句结构信息表,精简了程序的控制依赖关系,并在此基础上对幂等操作、死代码以及冗余赋值3种冗余代码进行检测,有效降低了缺陷检测复杂度.通过分析Linux开源代码表明,本模型可以快速的检测大规模程序,并且具有较低的误报率和漏报率.因此本模型可以帮助程序员发现进而修正软件缺陷,维护软件可靠性. |
关键词: 冗余代码 TOKEN序列 代码标准化 |
DOI:10.11918/j.issn.0367-6234.2012.07.011 |
分类号:TP311 |
基金项目:国家自然科学基金资助项目(61173021);高等学校博士学科点专项科研基金资助项目(20112302120052,20092302110040);中央高校基本科研业务费专项资金资助项目(HIT.NSRIF.201178). |
|
Redundancy detection based on control structure analysis |
GONG Dan-dan, WANG Tian-tian, SU Xiao-hong, MA Pei-jun
|
School of Computer Science and Technology,Harbin Institute of Technology,150001 Harbin,China
|
Abstract: |
To deal with the problems such as high complexity and low accuracy of redundancy detection, a model of redundancy detection based on control structure analysis is proposed and implemented. This paper predigests the complexity of control structure by establishing a compound node table for tokens, which reduces the complexity of redundancy detection, and then detects the idempotent operations, dead code and redundant assignment. Experimental results of the open source code of Linux show that this model can find redundant code accurately and also has a low time-complexity. With this model, it is very convenient for developers to detect and correct these kinds of defects, and thereby to further guarantee the software quality. |
Key words: redundant code TOKEN code standardization |