基于顺序块的嵌入式白盒测试插桩技术研究
2014-09-15范琳王海
范琳+王海
摘 要: 深入研究嵌入式软件的白盒测试技术,提出基于宿主平台的嵌入式软件测试构架。针对语句覆盖测试,提出一种基于顺序块的插桩方法,能有效减少桩的个数,从而减少桩函数对测试过程的影响。针对分支覆盖率测试,插桩后的被测程序运行在ARMulator上,桩获取器分析桩信息,得出程序运行中的实时语句覆盖率。实现了嵌入式软件测试平台ARM?Test,实验证明:该模型能获取实时的语句覆盖率,有效进行白盒测试。
关键词: 嵌入式模拟器; 顺序块; 插桩; 白盒测试
中图分类号: TN710?34; TG335.58 文献标识码: A 文章编号: 1004?373X(2014)18?0140?03
An instrumentation method based on sequence block for embedded software
white?box testing
FAN Lin1, WANG Hai2
(1. Department of Computer Science and Technology, Xian University of Posts and Telecommunications, Xian 710121, China;
2. School of Information Science & Technology, Northwest University, Xian 710069, China)
Abstract: An embedded software testing framework based on hosting platform is proposed on the basis of in?depth study of the white?box testing technology for embedded softwares. An instrumentation method based on sequence block is brought forward to conduct statement coverage testing, which can effectively reduce the number of stubs, so as to reduce the impact of stubs on the testing process. After instrumentation, the program under test was run on ARMulator. The stub information is analyzed by the stub receiver to get the real?time statement branch coverage. An embedded software testing platform ARM?Test was developed. The experiment results show ARM?Test can get real?time statement branch coverage and do white?box testing effectively.
Keywords: embedded system simulator; sequence block; instrumentation; white?box testing
0 引 言
随着嵌入式系统的广泛应用,人们对嵌入式设备的稳定性和可靠性提出了更高的要求。由于目标机与宿主机硬件环境不同,使用的是不同体系结构的处理器,嵌入式软件无法在宿主机上直接运行与测试[1?4],将嵌入式模拟器应用于嵌入式软件的开发与测试,能使得软件与硬件并行开发。在宿主机上建立起一个内核与外设均可配置与裁剪的模拟器,使得硬件还没有开发出来时,软件就能在模拟器上运行和测试,就像在真正的硬件系统运行上一样[5?7]。
本文采用ARM公司提供的源内核模拟器ARMulator搭建嵌入式测试平台,针对源码进行基于顺序块的插桩,进行语句覆盖率测试,能在宿主平台通过ARMulator实时获取桩数据并进行分析,得到程序运行过程中的语句覆盖率,以实现软硬件开发的同步,保证嵌入式系统的质量。
1 已有研究
目前实用的嵌……
