paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Fine-grained test minimization

细粒度测试最小化
ICSE Proceedings of the 40th International Conference on Software Engineering2018匹配度 2/10 · 论文聚焦测试用例细粒度最小化与测试套件模型,属于软件测试/维护方向;未涉及静态分析、Agentic/LLM 程序、浮点程序分析或贝叶斯程序分析等用户核心研究问题。引用 33 inbox
Arash Vahabzadeh, Andrea Stocco, Ali Mesbah
crossref: 2026-09-12

AI 速览

一句话:提出细粒度测试最小化方法,在测试语句级去除冗余,同时保留覆盖率与断言。

随着软件系统演化,测试套件会积累冗余。现有测试最小化技术以整个测试用例为粒度,依据代码覆盖率等充分性准则删除冗余用例,这带来两个问题:删除整个用例会一并丢失其测试断言,削弱套件有效性;同时忽略了部分冗余的测试用例,即内部含有冗余测试语句的用例。本文提出一种细粒度测试最小化方法,通过推断测试套件模型,实现测试用例内部的自动重组,从而在测试语句级别删除冗余,同时保持套件的覆盖率与全部测试断言。作者实现了工具 Testler,并在 15 个开源项目的测试套件上评估:这些套件中超过 4,639 个(24%)测试是部分冗余的,共含 11,819 条冗余测试语句;Testler 移除了 43% 的冗余语句,将部分冗余测试减少 52%,使测试执行时间最多降低 37%(平均 20%),同时保持原有的语句覆盖、分支覆盖、测试断言与故障检测能力。

问题
现有测试最小化以整个测试用例为粒度,删除冗余用例时会一并丢失其断言,并且无法处理内部含有冗余语句的部分冗余测试,影响测试套件有效性与执行开销。
方法
通过推断测试套件模型来实现测试用例内部的自动化重组,在测试语句级别消除冗余,同时保留覆盖率与测试断言。
评估
在 15 个开源项目的测试套件上评估工具 Testler,统计部分冗余测试与冗余测试语句的数量,并测量语句覆盖、分支覆盖、断言保留、故障检测能力与测试执行时间的变化。
原文摘要(Abstract)

As a software system evolves, its test suite can accumulate redundancies over time. Test minimization aims at removing redundant test cases. However, current techniques remove whole test cases from the test suite using test adequacy criteria, such as code coverage. This has two limitations, namely (1) by removing a whole test case the corresponding test assertions are also lost, which can inhibit test suite effectiveness, (2) the issue of partly redundant test cases, i.e., tests with redundant test statements, is ignored. We propose a novel approach for fine-grained test case minimization. Our analysis is based on the inference of a test suite model that enables automated test reorganization within test cases. It enables removing redundancies at the test statement level, while preserving the coverage and test assertions of the test suite. We evaluated our approach, implemented in a tool called Testler, on the test suites of 15 open source projects. Our analysis shows that over 4,639 (24%) of the tests in these test suites are partly redundant, with over 11,819 redundant test statements in total. Our results show that Testler removes 43% of the redundant test statements, reducing the number of partly redundant tests by 52%. As a result, test suite execution time is reduced by up to 37% (20% on average), while maintaining the original statement coverage, branch coverage, test assertions, and fault detection capability.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot4494,
  title = {Fine-grained test minimization},
  author = {Arash Vahabzadeh and Andrea Stocco and Ali Mesbah},
  booktitle = {ICSE},
  year = {2018},
  doi = {10.1145/3180155.3180203}
}