paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Quickly generating diverse valid test inputs with reinforcement learning

利用强化学习快速生成多样化的有效测试输入
ICSE Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering2020匹配度 3/10 · 该论文属于机器学习辅助软件测试(性质测试输入生成),与用户核心关注的静态分析、形式化验证、浮点程序分析、贝叶斯程序分析以及 LLM/Agent 与程序分析的交叉均无直接关联;仅在“机器学习用于程序语言任务”这一宽泛方向上边缘相关。引用 30 inbox
Sameer Reddy, Caroline Lemieux, Rohan Padhye, Koushik Sen
crossref: 2026-09-12

AI 速览

一句话:提出黑盒强化学习方法 RLCheck,引导随机输入生成器快速产生多样化且有效的性质测试输入。

基于性质的测试需要快速生成大量多样且合法的输入,但当测试驱动有严格有效性约束时,完全随机生成难以产生足够合法输入。现有方法依赖对输入生成器或测试驱动插桩获得的白盒/灰盒信息,而插桩会降低测试速度。本文提出黑盒方法:形式化引导随机生成器产生多样合法输入的问题,并指出“引导”控制生成器内部的选择空间;随后提出 RLCheck,用表格型同策略强化学习引导生成器。作者在四个真实基准上,将 RLCheck 与纯随机生成及最先进灰盒演化算法比较,发现在相同时间预算下,RLCheck 产生的多样合法输入数量高出一个数量级。

问题
性质测试中,当输入需满足严格有效性约束时,纯随机生成难以在有限时间内产生足够多合法输入;现有白盒/灰盒引导又因插桩降低生成速度。
方法
将随机输入生成视为受“引导”控制的选择序列,提出黑盒强化学习方案 RLCheck,用表格型同策略 RL 学习引导策略以产生多样合法输入。
评估
在四个真实基准上与纯随机生成及最先进灰盒演化算法比较,相同时间预算下 RLCheck 生成的多样合法输入数量高出一个数量级。
原文摘要(Abstract)

Property-based testing is a popular approach for validating the logic of a program. An effective property-based test quickly generates many diverse valid test inputs and runs them through a parameterized test driver. However, when the test driver requires strict validity constraints on the inputs, completely random input generation fails to generate enough valid inputs. Existing approaches to solving this problem rely on whitebox or greybox information collected by instrumenting the input generator and/or test driver. However, collecting such information reduces the speed at which tests can be executed. In this paper, we propose and study a black-box approach for generating valid test inputs. We first formalize the problem of guiding random input generators towards producing a diverse set of valid inputs. This formalization highlights the role of a guide which governs the space of choices within a random input generator. We then propose a solution based on reinforcement learning (RL), using a tabular, on-policy RL approach to guide the generator. We evaluate this approach, RLCheck, against pure random input generation as well as a state-of-the-art greybox evolutionary algorithm, on four real-world benchmarks. We find that in the same time budget, RLCheck generates an order of magnitude more diverse valid inputs than the baselines.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot5656,
  title = {Quickly generating diverse valid test inputs with reinforcement learning},
  author = {Sameer Reddy and Caroline Lemieux and Rohan Padhye and Koushik Sen},
  booktitle = {ICSE},
  year = {2020},
  doi = {10.1145/3377811.3380399}
}