一句话:提出集合式程序分析,利用分析相关相似性聚类程序,仅分析每类代表以大幅加速大规模控制/数据流分析。
数据驱动软件工程对大规模源码分析基础设施提出更高需求,而现有优化与并行化手段仍有局限。本文提出集合式程序分析(CPA),通过“分析相关相似性”判断多个程序在特定分析下是否等价,并据此聚类程序;对每类仅分析一个代表即可得到其他程序的结果。方法采用稀疏表示与规范化标号方案来判定相似性并聚类分析等价程序。作者在大型程序数据集上对多种源码分析进行评估,发现大量分析等价程序存在,分析时间较基线平均减少69%,较先前技术平均减少36%。
Popularity of data-driven software engineering has led to an increasing demand on the infrastructures to support efficient execution of tasks that require deeper source code analysis. While task optimization and parallelization are the adopted solutions, other research directions are less explored. We present collective program analysis (CPA), a technique for scaling large scale source code analyses, especially those that make use of control and data flow analysis, by leveraging analysis specific similarity. Analysis specific similarity is about, whether two or more programs can be considered similar for a given analysis. The key idea of collective program analysis is to cluster programs based on analysis specific similarity, such that running the analysis on one candidate in each cluster is sufficient to produce the result for others. For determining analysis specific similarity and clustering analysis-equivalent programs, we use a sparse representation and a canonical labeling scheme. Our evaluation shows that for a variety of source code analyses on a large dataset of programs, substantial reduction in the analysis time can be achieved; on average a 69% reduction when compared to a baseline and on average a 36% reduction when compared to a prior technique. We also found that a large amount of analysis-equivalent programs exists in large datasets.