paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Increasing the Effectiveness of Automatically Generated Tests by Improving Class Observability

通过改善类可观测性来提升自动生成测试的有效性
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 2/10 · 该论文研究基于搜索的 Java 自动测试生成与类可观测性改进,属于软件测试方向,不涉及用户画像核心的 LLM/Agent 与静态分析/形式化验证交叉,也不涉及浮点程序分析或贝叶斯程序分析。仅在广义程序分析/软件工程测试上有弱关联。引用 1 inbox
Geraldine Galindo-Gutierrez, Juan Pablo Sandoval Alcocer, Nicolas Jimenez-Fuentes, Alexandre Bergel, Gordon Fraser
crossref: 2026-09-12

AI 速览

一句话:通过代码变换暴露封装属性并增强复杂对象断言生成,提升 EvoSuite 自动测试的变异分数。

自动单元测试生成需同时找到覆盖被测类的 API 调用序列并生成验证行为的断言。基于搜索的 EvoSuite 虽能获得高覆盖率,但类可观测性不足常限制其故障发现能力:关键属性未暴露,或复杂对象状态难以断言。该文研究可观测性对 EvoSuite 的影响,并作两项扩展:一是对被测代码进行变换,使封装属性暴露给测试生成器;二是增强 EvoSuite 对复杂对象状态的断言能力。评估显示,这些改进共同显著提高变异分数,表明在测试生成过程中考虑类可观测性至关重要。

问题
自动生成单元测试虽能通过搜索获得高覆盖率,但因被测类可观测性差,关键属性或复杂对象状态难以被暴露和断言,导致故障发现能力受限。
方法
在 EvoSuite 中通过对被测代码进行变换来暴露封装属性,并增强其对复杂对象状态生成断言的能力,以研究并改善类可观测性。
评估
在 EvoSuite 上评估两项改进,结果表明它们共同显著提高变异分数,验证了可观测性对自动测试有效性的重要影响。
原文摘要(Abstract)

Automated unit test generation consists of two complementary challenges: Finding sequences of API calls that exercise the code of a class under test, and finding assertion statements that validate the behavior of the class during execution. The former challenge is often addressed using meta-heuristic search algorithms optimising tests for code coverage, which are then annotated with regression assertions to address the latter challenge, i.e., assertions that capture the states observed during test generation. While the resulting tests tend to achieve high coverage, their fault finding potential is often inhibited by poor or difficult observability of the codebase. That is, relevant attributes and properties may either not be exposed adequately at all, or only in ways that the test generator is unable to handle. In this paper, we investigate the influence of observability in the context of the EvoSuite search-based Java test generator, which we extend in two complementary ways to study and improve observability: First, we apply a transformation to code under test to expose encapsulated attributes to the test generator; second, we address EvoSuite's limited capability of asserting the state of complex objects. Our evaluation demonstrates that together these observability improvements lead to significantly increased mutation scores, underscoring the importance of considering the class observability in the test generation process.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8801,
  title = {Increasing the Effectiveness of Automatically Generated Tests by Improving Class Observability},
  author = {Geraldine Galindo-Gutierrez and Juan Pablo Sandoval Alcocer and Nicolas Jimenez-Fuentes and Alexandre Bergel and Gordon Fraser},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00156}
}