コードグラフ上の動的依存関係をモデル化することによるプログラム実行予測の学習
Learning to Predict Program Execution by Modeling Dynamic Dependency on Code Graphs
August 5, 2024
著者: Cuong Chi Le, Hoang Nhat Phan, Huy Nhat Phan, Tien N. Nguyen, Nghi D. Q. Bui
cs.AI
要旨
プログラムの挙動を実行せずに予測することは、ソフトウェア工学において本質的かつ困難な課題である。従来のモデルは、コード内の動的な依存関係や相互作用を捉えることにしばしば苦戦してきた。本論文では、Dynamic Dependencies Learningを通じてコードカバレッジを予測し、ランタイムエラーを検出する新しい機械学習ベースのフレームワーク「CodeFlowrepresents」を提案する。CodeFlowrepresentsは、制御フローグラフ(CFG)を利用して、すべての可能な実行パスと異なるステートメント間の関係を表現し、プログラムの挙動を包括的に理解する。CFGを構築して実行パスを描き、CFGノードのベクトル表現を学習することで、静的な制御フローの依存関係を捉える。さらに、実行トレースを通じて動的な依存関係を学習し、実行中のステートメント間の影響を反映する。このアプローチにより、コードカバレッジの正確な予測とランタイムエラーの特定が可能となる。実証評価では、コードカバレッジ予測の精度が大幅に向上し、ランタイムエラーの効果的なローカライズが実現され、既存のモデルを凌駕する結果が示された。
English
Predicting program behavior without execution is an essential and challenging
task in software engineering. Traditional models often struggle to capture
dynamic dependencies and interactions within code. This paper introduces a
novel machine learning-based framework called CodeFlowrepresents, which
predicts code coverage and detects runtime errors through Dynamic Dependencies
Learning. Utilizing control flow graphs (CFGs), CodeFlowrepresents all possible
execution paths and the relationships between different statements, offering a
comprehensive understanding of program behavior. It constructs CFGs to depict
execution paths and learns vector representations for CFG nodes, capturing
static control-flow dependencies. Additionally, it learns dynamic dependencies
through execution traces, which reflect the impacts among statements during
execution. This approach enables accurate prediction of code coverage and
identification of runtime errors. Empirical evaluations show significant
improvements in code coverage prediction accuracy and effective localization of
runtime errors, surpassing current models.Summary
AI-Generated Summary