一句话:提出反馈驱动的部分执行工具 Incompleter,利用执行错误反馈逐步补全缺失定义,使不完整代码可执行。
部分代码执行指在缺失定义的情况下执行代码,该能力可支撑多种下游分析。本文提出反馈驱动的部分执行技术,并实现工具 Incompleter。其核心观察是:执行不完整代码片段时出现的错误往往遵循相似的错误模式。Incompleter 以不完整片段为输入,反复执行并根据动态错误应用规则(如添加类、添加字段、添加文件等)来消解连续遇到的错误,直到片段成功执行或达到预设界限。在包含 4.7K 个 StackOverflow 不完整片段的数据集上,Incompleter 相比现有最先进的 LExecutor 多执行了 10% 的代码片段,多覆盖了 23% 的语句;其类型推断的 F1 分数也比 LExecutor 高出 37%。
Partial code execution is the problem of executing code with missing definitions. The problem has gained recent traction as solutions to the problem could enable various downstream analyses. We propose feedback-directed partial execution, a technique supported by a tool, named Incompleter, that uses the error feedback from executions to enable partial code execution. Incompleter builds on the observation that errors observed during the execution of incomplete snippets often follow similar error patterns. Incompleter takes an incomplete snippet as input and applies rules (e.g., add class, add field, add file, etc.) to resolve the successive dynamic errors it encounters during execution of the snippet. Incompleter stops when the snippet successfully executes or when it reaches certain bounds. Our results indicate that Incompleter outperforms LExecutor, the state-of-the-art in partial execution. For example, considering a dataset of 4.7K incomplete StackOverflow snippets, Incompleter enables the execution of 10% more code snippets compared to LExecutor and covers 23% more statements. We also show that Incompleter’s type inference significantly improves over LExecutor’s type inference, with a 37% higher F1 score.
DOI 原文 ·
@inproceedings{paperbot8520,
title = {Feedback-Directed Partial Execution},
author = {Ishrak Hayet and Adam Scott and Marcelo d'Amorim},
booktitle = {ISSTA},
year = {2024},
doi = {10.1145/3650212.3680320}
}