CodeFlow: Program Behavior Prediction with Dynamic Dependencies Learning

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Le, Cuong Chi, Phan, Hoang Nhat, Phan, Huy Nhat, Nguyen, Tien N., Bui, Nghi D. Q.
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866910819610001408
author Le, Cuong Chi
Phan, Hoang Nhat
Phan, Huy Nhat
Nguyen, Tien N.
Bui, Nghi D. Q.
author_facet Le, Cuong Chi
Phan, Hoang Nhat
Phan, Huy Nhat
Nguyen, Tien N.
Bui, Nghi D. Q.
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2408_02816
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle CodeFlow: Program Behavior Prediction with Dynamic Dependencies Learning
Le, Cuong Chi
Phan, Hoang Nhat
Phan, Huy Nhat
Nguyen, Tien N.
Bui, Nghi D. Q.
Software Engineering
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.
title CodeFlow: Program Behavior Prediction with Dynamic Dependencies Learning
topic Software Engineering
url https://arxiv.org/abs/2408.02816