基于机器学习的调用图剪枝有效性:一项实证研究
On the Effectiveness of Machine Learning-based Call Graph Pruning: An Empirical Study
AI总结:
本研究针对机器学习调用图剪枝方法的评估局限,构建了NYXCorpus数据集,通过保守剪枝策略在提升CG精确度的同时保持召回率,使生成的CG更小更快且下游分析结果几乎不变。
摘要:
静态调用图(CG)构建通常会过度近似调用关系,导致结果虽然可靠但不精确。近期研究探索了基于机器学习(ML)的CG剪枝方法,旨在通过消除假边来提升精确度。然而,现有方法存在评估数据集有限、训练数据不平衡以及召回率降低等问题,这影响了实际的下游分析。此外,先前的结果尚未与先进的静态CG构建技术进行比较。本研究解决了这些问题。我们引入了NYXCorpus,这是一个包含高测试覆盖率真实Java程序的数据集,我们从测试执行中收集追踪信息,并构建了动态CG的基准真值。我们利用这些CG来探索在基于ML的CG剪枝器的训练和推理过程中的保守剪枝策略。我们对使用零控制流分析(0-CFA)生成的静态CG与由上下文敏感的1-CFA算法生成的CG进行了比较分析,并对两者在有无剪枝的情况下进行了评估。我们发现,对于真实的Java项目,CG剪枝是一项困难的任务,CG精确度的显著提升(+25%)伴随着召回率的下降(-9%)。然而,我们的实验显示了有希望的结果:即使在实验中我们使用F2指标偏向召回率而非精确度,我们也能证明剪枝后的CG在质量上与上下文敏感的1-CFA分析相当,同时计算需求更低。生成的CG体积小得多(缩小69%),速度大幅提升(3.5倍加速),且在下游分析中结果几乎保持不变。
英文摘要:
Static call graph (CG) construction often over-approximates call relations, leading to sound, but imprecise results. Recent research has explored machine learning (ML)-based CG pruning as a means to enhance precision by eliminating false edges. However, current methods suffer from a limited evaluation dataset, imbalanced training data, and reduced recall, which affects practical downstream analyses. Prior results were also not compared with advanced static CG construction techniques yet. This study tackles these issues. We introduce the NYXCorpus, a dataset of real-world Java programs with high test coverage and we collect traces from test executions and build a ground truth of dynamic CGs. We leverage these CGs to explore conservative pruning strategies during the training and inference of ML-based CG pruners. We conduct a comparative analysis of static CGs generated using zero control flow analysis (0-CFA) and those produced by a context-sensitive 1-CFA algorithm, evaluating both with and without pruning. We find that CG pruning is a difficult task for real-world Java projects and substantial improvements in the CG precision (+25%) meet reduced recall (-9%). However, our experiments show promising results: even when we favor recall over precision by using an F2 metric in our experiments, we can show that pruned CGs have comparable quality to a context-sensitive 1-CFA analysis while being computationally less demanding. Resulting CGs are much smaller (69%), and substantially faster (3.5x speed-up), with virtually unchanged results in our downstream analysis.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。