paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Automatic Unit Test Generation for Machine Learning Libraries: How Far Are We?

面向机器学习库的自动单元测试生成:我们还有多远?
ICSE 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE)2021匹配度 3/10 · 论文研究机器学习库的单元测试自动生成与实证评估,属于软件测试方向,与用户核心关注的静态分析、LLM/Agent 改进程序分析、浮点程序分析及贝叶斯程序分析均无直接交集。仅在“对 ML 系统进行程序分析/测试”的大方向上有弱关联。引用 47 inbox
Song Wang, Nishtha Shrestha, Abarna Kucheri Subburaman, Junjie Wang, Moshi Wei, Nachiappan Nagappan
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:实证评估EVOSUITE与Randoop在五个机器学习库上的单元测试生成效果,发现现有工具提升有限且未覆盖代码存在共性模式。

现有自动单元测试生成工具多面向通用软件评估,其在统计导向、构造方式迥异的机器学习库上的实用效果尚不明确。本文对五个广泛使用的机器学习库开展实证研究,采用EVOSUITE与Randoop两种流行工具生成单元测试,并以代码覆盖率和变异得分作为质量指标进行衡量。结果表明:第一,多数机器学习库自身维护的单元测试套件质量不高,平均代码覆盖率仅34.1%,平均变异得分仅21.3%;第二,两种生成工具虽能明显提升覆盖率与变异得分,但提升幅度有限;第三,五个库中未被覆盖的代码存在共性模式,这些模式可用于改进单元测试生成任务。该工作揭示了自动测试生成在机器学习库场景下的局限,并为后续针对性改进提供了实证依据。

问题
现有自动单元测试生成工具主要在通用软件程序上评估,其在具有统计特性、构造方式迥异的机器学习库上是否有效尚不明确。
方法
对五个广泛使用的机器学习库开展实证研究,使用EVOSUITE和Randoop两个流行单元测试生成工具,以代码覆盖率和变异得分等质量指标衡量测试套件质量与工具提升效果。
评估
通过覆盖率与变异得分量化分析发现,ML库自身测试套件平均覆盖率仅34.1%、变异得分仅21.3%,工具虽带来明显但有限的提升,并总结出未覆盖代码中的共性模式。
原文摘要(Abstract)

Automatic unit test generation that explores the input space and produces effective test cases for given programs have been studied for decades. Many unit test generation tools that can help generate unit test cases with high structural coverage over a program have been examined. However, the fact that existing test generation tools are mainly evaluated on general software programs calls into question about its practical effectiveness and usefulness for machine learning libraries, which are statistically orientated and have fundamentally different nature and construction from general software projects. In this paper, we set out to investigate the effectiveness of existing unit test generation techniques on machine learning libraries. To investigate this issue, we conducted an empirical study on five widely used machine learning libraries with two popular unit testcase generation tools, i.e., EVOSUITE and Randoop. We find that (1) most of the machine learning libraries do not maintain a high-quality unit test suite regarding commonly applied quality metrics such as code coverage (on average is 34.1%) and mutation score (on average is 21.3%), (2) unit test case generation tools, i.e., EVOSUITE and Randoop, lead to clear improvements in code coverage and mutation score, however, the improvement is limited, and (3) there exist common patterns in the uncovered code across the five machine learning libraries that can be used to improve unit test case generation tasks.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{WangSSWWN21,
  title = {Automatic Unit Test Generation for Machine Learning Libraries: How Far Are We?},
  author = {Song Wang and Nishtha Shrestha and Abarna Kucheri Subburaman and Junjie Wang and Moshi Wei and Nachiappan Nagappan},
  booktitle = {ICSE},
  year = {2021},
  doi = {10.1109/icse43902.2021.00138}
}