嵌入式软件缺陷的自动定位技术实现

胡芸++胡国祥++胡世港++熊曾刚



摘 要: 在嵌入式软件开发中,代码缺陷会导致软件系统瘫痪。为了实现对软件缺陷的自动定位,提出一种基于抽象语法树解析的嵌入式软件代码缺陷定位技术。采用软件代码缺陷信息演化导入模型进行嵌入式软件的缺陷抽象语法树建模,对软件设计和程序代码中的缺陷模式进行信息重构,对嵌入式软件的括号、设计、命名等代码缺陷进行语法逻辑探测与自动优化,实现软件缺陷的自动定位。测试结果表明,采用该技术进行嵌入式软件缺陷定位的精度较高,时间成本较低,提高了软件的可靠性。
关键词: 嵌入式软件; 缺陷; 定位; 代码; 软件系统瘫痪
中图分类号: TN958.98?34; TP311 文献标识码: A 文章编号: 1004?373X(2017)18?0079?04
Realization of automatic positioning technology for embedded software defects
HU Yun1, HU Guoxiang2, HU Shigang3, XIONG Zenggang4
(1. Pingdingshan Industrial College of Technology, Pingdingshan 467000, China; 2. Yili Vocational and Technical College, Yining 835000, China;
3. Hubei Polytechnic Institute, Xiaogan 432000, China; 4. Hubei Engineering University, Xiaogan 432000, China)
Abstract: In the development of the embedded software, code defects will lead to paralysis of the software system. In order to realize the automatic positioning of software defects, a kind of embedded software code defect positioning technology based on the analysis of the abstract syntax tree is put forward. The evolution import model of the software code defect information is adopted for abstract syntax tree modeling of the embedded software defect to achieve information reconstruction of the defect mode in software design and program code. The code defects of d brackets, design and naming in the embedded software are detected in syntax logic and optimized automatically to realize automatic positioning of software defects precision. The test results show that the technology for the embedded soft defect localization can implement high accuracy and low time cost, and improve the reliability of the embedded software.
Keywords: embedded software; defect; location; code; softeware system paralysis
0 引 言
嵌入式软件的代码开发在整个软件程序开发中占据重要的地位,软件代码的缺陷定位很大程度上决定了整个嵌入式软件系统的健壮性和可维护性。在软件开发中,由于程序本身的Bug以及开发人员的经验因素,难免会产生软件缺陷,通过软件缺陷定位降低软件开发和维护成本,对软件缺陷的定位涉及到对软件编码和软件度量等问题[1]。
软件缺陷的度量方法分为内部度量和外部度量,内部度量是对软件内部代码和编码程序运行过程中软件产品测试水平,如软件规格说明和软件源代码等;外部度量是从软件测试和软件运行状况方面进行的软件产品缺陷分析和定位。对当软件产品的规格要求给定后,产品的功能价值得以体现,通过外部度量的价值从而评价出内部度量的优越性,完成整个软件度量评价工作。嵌入式软件的缺陷定位在软件开发生命周期中具有非常重要的作用,它不但能使开发人员了解到项目进展的实际状况,还能够正确及时地对软件开发中的相关技术进行调整,避免软件开发过程中存在的问题和风险。因此研究软件缺陷定位技术具有重要意义,当前对软件缺陷定位的方法主要有分支语句分析方法、属性名分析方法以及代码味道探测方法等[2],传统的方法存在缺陷探测精度不高,定位的灵敏度不好等问题。对此,本文提出一种基于抽象语法树解析的嵌入式软件代码缺陷定位技术,实现对代码缺陷的优化定位分析,并通过实验得出有效性结论。
4 结 语
为了实现对软件缺陷的自动定位,本文提出一种基于抽象语法树解析的嵌入式软件代码缺陷定位技术。采用软件代码缺陷信息演化导入模型进行嵌入式软件的缺陷抽象语法树建模,对软件设计和程序代码中的缺陷模式进行信息重构,对嵌入式软件的括号、设计、命名等代码缺陷进行语法逻辑探测与自动优化,实现软件缺陷的自动定位。测试表明,采用该技术进行嵌入式软件缺陷定位的精度较高,时间成本较低,提高了软件的可靠性。
参考文献
[1] 熊伟,王娟丽.软件需求定量分析及其映射的模糊层次分析法[J].科技通报,2012,28(8):201?204.
[2] 汪中才,蔡铭.用HOQ技术的软件可信性评估研究[J].计算机应用研究,2012,28(8):150?152.
[3] ZHENG Guo, WANG Bing, CUI Jun. Generic prediction assisted single?copy routing in underwater delay tolerant sensor networks [J]. Ad hoc networks, 2013, 11(3): 1136?1149.
[4] LIU Hui, NIU Zhendong, MA Zhiyi, et al. Identification of generalization refactoring opportunities [J]. Automated software engineering, 2013, 20(1): 81?110.
[5] ZHANG Min, HALL T, BADDOO N. Code bad smells: a review of current knowledge [J]. Journal of software maintenance and evolution: research and practice, 2011, 23(3): 179?202.
[6] 陈志华,刘晓勇.云计算下大数据非结构的稳定性检索方法[J].现代电子技术,2016,39(6):58?61.
[7] 陈志锋,李清宝,张平,等.基于聚类分析的内核恶意软件特征选择[J].电子与信息学报,2015,37(12):2821?2829.
[8] 林永峰,陈亮.面向安全性分析的嵌入式软件测试方法研究[J].现代电子技术,2016,39(13):80?83.