采用Clang/LLVM的C++源代码覆盖率分析插装方法  被引量:3

Approach to C++ Code Instrumentation for Coverage Analysis with Clang/LLVM

在线阅读下载全文

作  者:李树芳[1] 安金霞[1] 刘洋[1] 陈良 

机构地区:[1]中国酒泉卫星发射中心,酒泉732750

出  处:《计算机科学》2017年第11期191-194,共4页Computer Science

摘  要:近年来,越来越多的安全关键软件系统运行在国产Linux操作系统上,其中大多数采用C++开发,而C++正在扩展新版语言规范,已有的覆盖率统计插装工具不能满足要求。给出一种基于Clang/LLVM的C++源代码覆盖率统计插装方法,利用开源社区Clang/LLVM库提供的C++源代码解析和操作功能,构建面向C++源代码的语句、分支和MC/DC覆盖率统计框架,在运行时采集覆盖率信息并进行统计分析,输出覆盖率分析报告。实际案例表明,该方法简易实用,能够满足真实工程软件的覆盖率测试分析需求。In recent years,many safety-critical software system have been running under domestic Linux operating systems,most of which are developed with C+ +.As C+ + is expanding to new revision of the C+ + ISO/IEC standards,the existing source code instrumentation tools for coverage analysis cannot satisfy user's requirements.In this paper,an approach to C++ source code instrumentation for coverage analysis with Clang/LLVM was proposed.Employing the Clang/LLVM library in open source community,which provides C++ source code parsing and manipulation functions,a framework of C++ coverage analysis for statement coverage,branch coverage and MC/DC coverage was constructed.Coverage information was collected in real-time,and was analyzed and exported to reports.Case study shows that the proposed approach is very convenient and practical in real world software testing activities.

关 键 词:C++ Clang 代码插装 覆盖率分析 

分 类 号:TP311.5[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象