摘要
开发人员思维定式和代码复制与克隆会导致代码中存在相同类型的软件缺陷。基于这一思想,提出一种基于特征相似的软件缺陷排除方法。该方法对已定位缺陷代码进行特征分析,基于该缺陷代码特征,查找项目代码中具有相似特征的代码片段。结合缺陷类型和代码特征对缺陷代码进行分析,建立特征相似关联规则,检测项目代码,排查与缺陷代码相似度超过预定阈值的代码片段,相似度超过预定阈值的代码片段称为疑似代码。通过对科研管理系统和物业系统人工导入错误并进行缺陷排除实验分析和人工检测,证实了该方法能够有效地发现项目中隐含的相似缺陷代码。
Mind-sets of, developers and code duplication and cloning can result in similar software defects. Considering this fact, software defect removing method based on characteristic similarity is proposed. The method analyzed the characteristic of the fixed defect codes, and according to that, the code fragments with similar features in the project code would be detected. Combining with defect types and code characteristic, the defect codes were analysed; association rules on feature similarity were established; project codes were defected; the code fragment called suspected code would be founded whose defect code similarity exceeded the predetermined threshold. Men imported error into both the scientific research management system and the property system and then defect removing analysis and manual inspection were carried out. The results show that this method can effectively find implicit similar software defects in the project.
出处
《计算机应用与软件》
2017年第11期13-19,33,共8页
Computer Applications and Software
基金
国家自然科学基金青年基金项目(61402288)
关键词
特征相似
缺陷排除
抽象语法树
特征分析
Characteristic similarity Defect removing Abstract tree Characteristic analysis