arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.08843cs.SEcs.PFcs.PL
收藏

Input-Gen:用于测试、调优和训练的有状态输入引导式生成

Input-Gen: Guided Generation of Stateful Inputs for Testing, Tuning, and Training

Ivan R. Ivanov, Joachim Meyer, Aiden Grossman, William S. Moses, Johannes Doerfert

AI总结:

针对机器学习代码模型缺乏执行时输入数据的问题,本文提出编译器内的 Input-Gen,可跨语言和架构大规模生成有状态输入,并在 ComPile 上实现 90% 模块有效输入及最高 45% 块覆盖率。

摘要:

软件应用程序的规模和复杂性正以越来越快的速度增长。源代码仓库(连同其依赖项)需要大量人力来保持测试、维护和更新。随着该学科现在开始纳入自动生成的程序,需要测试和调优方面的自动化以跟上这一步伐——更不用说降低当前的复杂性水平了。虽然机器学习已被用于在各种场景中理解和生成代码,但机器学习模型本身几乎完全基于静态代码进行训练,这些代码没有输入、执行轨迹或其他执行时信息。训练数据的这种缺失限制了这些模型理解软件中现实世界问题的能力。在本工作中,我们表明输入与代码一样,可以大规模自动生成。我们生成的输入是有状态的,并且似乎能够忠实地复现重新运行程序函数所需的任意数据结构和系统调用。通过在编译器内部构建我们的工具,它既可以应用于任意编程语言和体系结构,又可以利用静态分析和转换来提升性能。我们的方法能够为我们探索的 ComPile 数据集中 90% 的模块生成有效输入(包括初始内存状态),共计 2140 万个可执行函数。此外,我们发现单个生成的输入可带来平均 37% 的基本块覆盖率,而引导式生成五个输入可将其提升至 45%。

英文摘要:

The size and complexity of software applications is increasing at an accelerating pace. Source code repositories (along with their dependencies) require vast amounts of labor to keep them tested, maintained, and up to date. As the discipline now begins to also incorporate automatically generated programs, automation in testing and tuning is required to keep up with the pace - let alone reduce the present level of complexity. While machine learning has been used to understand and generate code in various contexts, machine learning models themselves are trained almost exclusively on static code without inputs, traces, or other execution time information. This lack of training data limits the ability of these models to understand real-world problems in software. In this work we show that inputs, like code, can be generated automatically at scale. Our generated inputs are stateful, and appear to faithfully reproduce the arbitrary data structures and system calls required to rerun a program function. By building our tool within the compiler, it both can be applied to arbitrary programming languages and architectures and can leverage static analysis and transformations for improved performance. Our approach is able to produce valid inputs, including initial memory states, for 90% of the ComPile dataset modules we explored, for a total of 21.4 million executable functions. Further, we find that a single generated input results in an average block coverage of 37%, whereas guided generation of five inputs improves it to 45%.

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

↑