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

CodeFlow:基于动态依赖学习的程序行为预测

CodeFlow: Program Behavior Prediction with Dynamic Dependencies Learning

Cuong Chi Le, Hoang Nhat Phan, Huy Nhat Phan, Tien N. Nguyen, Nghi D. Q. Bui

AI总结:

CodeFlow 通过结合控制流图的静态嵌入与执行轨迹的动态依赖学习,显著提升代码覆盖率预测和运行时错误定位性能,优于现有最先进模型。

摘要:

在不执行程序的情况下预测程序行为是软件工程中的一项关键任务。现有模型往往难以捕捉程序元素之间的动态依赖关系。为解决这一问题,我们提出了 CodeFlow,这是一种新颖的基于机器学习的方法,通过学习代码中的静态和动态依赖关系来预测代码覆盖率并检测运行时错误。通过使用控制流图(CFGs),CodeFlow 有效地表示所有可能的执行路径以及不同语句之间的统计关系,从而提供对程序行为更全面的理解。CodeFlow 构建 CFG 来表示可能的执行路径,并为 CFG 节点学习向量表示(嵌入),以捕捉静态控制流依赖。此外,它利用执行轨迹学习动态依赖关系,这些轨迹反映了执行过程中语句之间的相互影响。这种结合使 CodeFlow 能够准确预测代码覆盖率并识别运行时错误。我们的实证评估表明,CodeFlow 显著提高了代码覆盖率预测的准确性,并能有效定位运行时错误,优于最先进的模型。

英文摘要:

Predicting program behavior without execution is a critical task in software engineering. Existing models often fall short in capturing the dynamic dependencies among program elements. To address this, we present CodeFlow, a novel machine learning-based approach that predicts code coverage and detects runtime errors by learning both static and dynamic dependencies within the code. By using control flow graphs (CFGs), CodeFlow effectively represents all possible execution paths and the statistic relations between different statements, providing a more comprehensive understanding of program behaviors. CodeFlow constructs CFGs to represent possible execution paths and learns vector representations (embeddings) for CFG nodes, capturing static control-flow dependencies. Additionally, it learns dynamic dependencies by leveraging execution traces, which reflect the impacts among statements during execution. This combination enables CodeFlow to accurately predict code coverage and identify runtime errors. Our empirical evaluation demonstrates that CodeFlow significantly improves code coverage prediction accuracy and effectively localizes runtime errors, outperforming state-of-the-art models.

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

↑