paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Graph-based seed object synthesis for search-based unit testing

面向基于搜索的单元测试的基于图的种子对象合成
FSE Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2021匹配度 3/10 · 论文属于基于搜索的单元测试与程序分析,使用静态分析构建对象构造图来合成测试种子,与程序分析有一定关联;但它不涉及用户核心关注的 LLM/Agent 与静态分析交叉、浮点程序分析或贝叶斯程序分析,因此匹配度较低。引用 33 inbox
Yun Lin, You Sheng Ong, Jun Sun, Gordon Fraser, Jin Song Dong
crossref: 2026-09-12

AI 速览

一句话:提出基于对象构造图的测试种子合成,使经典适应度度量可用于对象输入,并提升基于搜索的单元测试生成。

基于搜索的软件测试(SBST)通过适应度度量引导测试生成,但当被测函数接收对象输入时,经典度量难以指导构造合法对象,导致适应度地形不连续。本文提出测试种子,即合法对象的测试代码骨架。针对目标分支,静态分析函数并构建对象构造图,刻画目标方法操作数与其相关对象输入状态之间的关系;再据此合成带可变槽位的测试模板,槽位作为搜索算法的变异点。该方法可无缝集成现有 SBST 算法,并在 EvoSuite 上实现 EvoObj。在 103 个开源 Java 项目、2750 个方法上,EvoObj 使用先进 SBST 算法显著优于 EvoSuite。

问题
SBST 在对象输入场景下缺乏有效引导:经典适应度度量难以构造合法对象,导致适应度地形不连续或非单调。
方法
静态分析目标函数以构建对象构造图,并据此合成包含可变槽位的合法对象测试种子/模板,再与现有 SBST 搜索算法集成。
评估
在 EvoSuite 上实现 EvoObj,并在 103 个开源 Java 项目的 2750 个方法上,与先进 SBST 算法对比,结果表明其显著优于 EvoSuite。
原文摘要(Abstract)

Search-based software testing (SBST) generates tests using search algorithms guided by measurements gauging how far a test case is away from exercising a coverage goal. The effectiveness of SBST largely depends on the continuity and monotonicity of the fitness landscape decided by these measurements and the search operators. Unfortunately, the fitness landscape is challenging when the function under test takes object inputs, as classical measurement hardly provide guidance for constructing legitimate object inputs. To overcome this problem, we propose test seeds, i.e., test code skeletons of legitimate objects which enable the use of classical measurements. Given a target branch in a function under test, we first statically analyze the function to build an object construction graph that captures the relation between the operands of the target method and the states of their relevant object inputs. Based on the graph, we synthesize test template code where each "slot" is a mutation point for the search algorithm. This approach can be seamlessly integrated with existing SBST algorithms, and we implemented EvoObj on top of EvoSuite. Our experiments show that EvoObj outperforms EvoSuite with statistical significance on 2750 methods over 103 open source Java projects using state-of-the-art SBST algorithms.

链接与引用

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

BibTeX
@inproceedings{paperbot6380,
  title = {Graph-based seed object synthesis for search-based unit testing},
  author = {Yun Lin and You Sheng Ong and Jun Sun and Gordon Fraser and Jin Song Dong},
  booktitle = {FSE},
  year = {2021},
  doi = {10.1145/3468264.3468619}
}