[论文解读] Automatically generating features for learning program analysis heuristics
本文提出了一种框架,通过使用程序化简器对代表性程序-查询对进行简化和抽象,自动为数据驱动的静态程序分析生成特征。该方法生成紧凑且可泛化的代码片段作为布尔特征,使机器学习能够推导出有效的分析启发式规则;实验表明,其性能在三种C程序分析中与手工设计的特征相当。
We present a technique for automatically generating features for data-driven program analyses. Recently data-driven approaches for building a program analysis have been proposed, which mine existing codebases and automatically learn heuristics for finding a cost-effective abstraction for a given analysis task. Such approaches reduce the burden of the analysis designers, but they do not remove it completely; they still leave the highly nontrivial task of designing so called features to the hands of the designers. Our technique automates this feature design process. The idea is to use programs as features after reducing and abstracting them. Our technique goes through selected program-query pairs in codebases, and it reduces and abstracts the program in each pair to a few lines of code, while ensuring that the analysis behaves similarly for the original and the new programs with respect to the query. Each reduced program serves as a boolean feature for program-query pairs. This feature evaluates to true for a given program-query pair when (as a program) it is included in the program part of the pair. We have implemented our approach for three real-world program analyses. Our experimental evaluation shows that these analyses with automatically-generated features perform comparably to those with manually crafted features.
研究动机与目标
- 为解决数据驱动程序分析中的主要瓶颈:即输入特征设计的劳动密集型和对专家的依赖性。
- 自动化生成有意义且可泛化的特征,以捕捉在精度提升显著影响分析结果的模式。
- 在无需手动特征工程的情况下,实现对分析启发式规则的有效学习,降低对领域专业知识的依赖。
- 通过使用抽象化的程序片段作为特征,实现对不同类型静态分析(如区间分析、指针分析、Octagon分析)的泛化。
- 证明自动生成的特征可产生与手工设计特征性能相当的启发式规则。
提出的方法
- 对代码库中的程序-查询对使用程序化简器(如C-Reduce)生成最小且具有代表性的代码片段,以触发高精度分析行为。
- 将每个简化后的程序视为一个布尔特征,当该程序存在于给定的程序-查询对中时,其值为真。
- 将简化后的程序抽象为数据流图,以泛化模式并创建可重用的、与语言无关的特征。
- 将抽象后的特征应用于训练机器学习模型,以学习参数化静态分析的最优参数设置。
- 将特征生成与启发式学习整合为统一框架,适用于具有无限抽象域的各种C程序分析。
- 采用黑盒方法,无需访问静态分析的内部逻辑,从而增强泛化能力。
实验结果
研究问题
- RQ1程序化简能否用于自动生成有意义且最小的代码片段,作为学习程序分析启发式规则的有效特征?
- RQ2从简化程序中派生的抽象化数据流图能否在多种程序模式间实现泛化,并作为稳健且可重用的特征?
- RQ3使用自动生成特征学习的启发式规则在多大程度上可与使用手工设计特征学习的规则性能相当?
- RQ4所提出的方法在不同类型的静态分析中是否具有可扩展性,包括具有无限抽象域的分析(如区间分析和Octagon分析)?
- RQ5该框架是否可在无需深入分析特定知识的情况下,有效应用于真实世界代码库?
主要发现
- 所提出的方法成功生成了与三种不同静态分析相关的特征:部分流敏感的区间分析和指针分析,以及部分Octagon分析。
- 使用自动生成特征学习的启发式规则在Linux和GNU软件包的60个程序上验证后,性能与使用手工设计特征学习的规则相当。
- 通过依赖抽象化的程序片段作为特征,该框架在不同类型分析(包括具有无限抽象域的分析)中表现出良好的泛化能力。
- 利用程序化简器生成最小且具有行为意义的代码片段,有效捕捉了精度提升可带来可测量收益的模式。
- 该方法显著降低了对专家驱动的特征工程的需求,大幅降低了采用数据驱动静态分析技术的门槛。
- 使用字符级卷积神经网络的深度学习基线模型在预测流敏感性需求时仅达到27%的精确率和93%的召回率,凸显了所提特征生成方法的优势。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。