paperbot · PL 论文追踪

全部论文 待读 收藏

P2 June: A Type Testability Transformation for Improved ATG Performance

June:一种提升自动测试生成性能的可测试性变换
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 1/10 · 论文属于软件测试领域的可测试性变换与自动测试生成,目标是提升 ATG 分支覆盖效率,未涉及用户关注的静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等方向;与“PL→AI”或“AI→PL”均无直接交叉。引用 1 inbox
Dan Bruce, David Kelly, Hector Menendez, Earl T. Barr, David Clark
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:June 用注解驱动的可测试性变换把字符串中的潜在结构暴露给自动测试生成器,从而大幅提升并加速分支覆盖。

字符串是通用容器,广泛存在于代码中却难以测试。字符串控制程序依据字符串输入做出分支决策,而自动测试生成器(ATG)若只把输入视为字符序列、忽略其中隐含的结构,生成有效测试输入的成本会高得难以承受。本文提出 June:一个注解驱动的可测试性变换,以及可扩展的结构化字符串定义库 JuneLib;其核心定义经经验推导得到,可为测试集中的全部结构化字符串提供模板。June 接收带少量注解的 Java 源码,并注入代码,使 ATG 能专注于构造结构化字符串内部的可变子串。开发者负担很小,平均每个字符串控制类仅需 2.1 个注解,且可直接使用标准 Java 构建工具部署。评估表明,June 显著减少无效搜索:EvoSuite 在 June 化类上平均 1 分钟即可达到未处理类上 9 分钟的覆盖率,且增益随时间扩大;在语料上,June 化把 24 小时执行时间压缩到约 2 小时。多种 ATG 工具可复用同一份 June 化代码,少量注解一次投入即可惠及多种测试方案。

问题
字符串控制程序的分支取决于字符串输入,若 ATG 只按字符序列搜索而不利用字符串中隐藏的结构,生成有效测试输入会极其昂贵甚至不可行。
方法
提出 June:一种注解驱动的可测试性变换,配合经验推导的可扩展结构化字符串定义库 JuneLib;它向带少量注解的 Java 代码注入代码,把结构化字符串中的可变子串暴露给 ATG。
评估
在测试语料上使用 EvoSuite 等 ATG 工具进行评估:June 化后平均 1 分钟即可达到原类 9 分钟的覆盖率,24 小时执行时间压缩至约 2 小时,且多种 ATG 可复用同一份 June 化代码。
原文摘要(Abstract)

Strings are universal containers: they are flexible to use, abundant in code, and difficult to test. String-controlled programs are programs that make branching decisions based on string input. Automatically generating valid test inputs for these programs considering only character sequences rather than any underlying string-encoded structures, can be prohibitively expensive. We present June, a tool that enables Java developers to expose any present latent string structure to test generation tools. June is an annotation-driven testability transformation and an extensible library, JuneLib, of structured string definitions. The core JuneLib definitions are empirically derived and provide templates for all structured strings in our test set. June takes lightly annotated source code and injects code that permits an automated test generator (ATG) to focus on the creation of mutable substrings inside a structured string. Using June costs the developer little, with an average of 2.1 annotations per string-controlled class. June uses standard Java build tools and therefore deploys seamlessly within a Java project. By feeding string structure information to an ATG tool, June dramatically reduces wasted effort; branches are effortlessly covered that would otherwise be extremely difficult, or impossible, to cover. This waste reduction both increases and speeds coverage. EvoSuite, for example, achieves the same coverage on June-ed classes in 1 minute, on average, as it does in 9 minutes on the un-June-ed class. These gains increase over time. On our corpus, June-ing a program compresses 24 hours of execution time into ca. 2 hours. We show that many ATG tools can reuse the same June-ed code: a few June annotations, a one-off cost, benefit many different testing regimes.

链接与引用

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

BibTeX
@inproceedings{BruceKMB023,
  title = {June: A Type Testability Transformation for Improved ATG Performance},
  author = {Dan Bruce and David Kelly and Hector Menendez and Earl T. Barr and David Clark},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598055}
}