arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2209.03230cs.SEcs.AI
收藏

AutoPruner:基于转换器的调用图修剪

AutoPruner: Transformer-Based Call Graph Pruning

Singapore Management University(新加坡管理大学);University of Melbourne(墨尔本大学);Hanoi University of Science and Technology(河内理工大学)

Thanh Le-Cong, Hong Jin Kang, Truong Giang Nguyen, Stefanus Agus Haryono, David Lo, Xuan-Bach D. Le, Huynh Quyet Thang

摘要:

构造静态调用图需要在可靠性和精确性之间进行权衡。不幸的是,用于构造调用图的程序分析技术通常是不精确的。为了解决这个问题,研究人员最近提出了由机器学习授权的调用图修剪,以对由静态分析构建的调用图进行后处理。构建机器学习模型以通过提取结构特征来从调用图捕获信息以用于随机森林分类器。然后,它删除被预测为误报的边缘。尽管机器学习模型显示出了改进,但它们仍然是有限的,因为它们不考虑源代码语义,因此通常无法有效区分真阳性和假阳性。在本文中,我们提出了一种新的调用图修剪技术,AutoPruner,通过统计语义和结构分析来消除调用图中的误报。给定由传统静态分析工具构造的调用图,AutoPruner采用基于Transformer的方法来捕获与调用图中的每条边相关联的调用者和被调用者函数之间的语义关系。为此,AutoPruner微调了一个在大型语料库上预先训练的代码模型,以基于其语义描述来表示源代码。接着,使用该模型从与调用图中的每条边相关的函数中提取语义特征。AutoPruner使用这些语义特征以及从调用图中提取的结构特征,通过前馈神经网络对每条边进行分类。我们对真实世界程序的基准数据集的实证评估表明,AutoPruner优于最先进的基线,在识别静态调用图中的假阳性边缘方面,F-measure提高了13%。

英文摘要:

Constructing a static call graph requires trade-offs between soundness and precision. Program analysis techniques for constructing call graphs are unfortunately usually imprecise. To address this problem, researchers have recently proposed call graph pruning empowered by machine learning to post-process call graphs constructed by static analysis. A machine learning model is built to capture information from the call graph by extracting structural features for use in a random forest classifier. It then removes edges that are predicted to be false positives. Despite the improvements shown by machine learning models, they are still limited as they do not consider the source code semantics and thus often are not able to effectively distinguish true and false positives. In this paper, we present a novel call graph pruning technique, AutoPruner, for eliminating false positives in call graphs via both statistical semantic and structural analysis. Given a call graph constructed by traditional static analysis tools, AutoPruner takes a Transformer-based approach to capture the semantic relationships between the caller and callee functions associated with each edge in the call graph. To do so, AutoPruner fine-tunes a model of code that was pre-trained on a large corpus to represent source code based on descriptions of its semantics. Next, the model is used to extract semantic features from the functions related to each edge in the call graph. AutoPruner uses these semantic features together with the structural features extracted from the call graph to classify each edge via a feed-forward neural network. Our empirical evaluation on a benchmark dataset of real-world programs shows that AutoPruner outperforms the state-of-the-art baselines, improving on F-measure by up to 13% in identifying false-positive edges in a static call graph.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑