paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Automatically Tagging the “AAA” Pattern in Unit Test Cases Using Machine Learning Models

使用机器学习模型自动标注单元测试用例中的“AAA”模式
ASE Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering2022匹配度 3/10 · 该论文属于机器学习辅助软件测试中的单元测试理解与维护,虽涉及 ML+PL,但与用户核心关注的静态分析、Agentic 程序、浮点/贝叶斯程序分析及其与 LLM 的交叉方向距离较远,也未涉及 LLM/Agent 或形式化验证。引用 6 inbox
Chenhao Wei, Lu Xiao, Tingting Yu, Xinyu Chen, Xiao Wang, Sunny Wong, Abigail Clune
crossref: 2026-09-12

AI 速览

一句话:提出用机器学习模型自动标注单元测试中的 Arrange、Act、Assert 语句,以支持测试理解与维护。

单元测试常采用 AAA 模式,即 Arrange、Action、Assertion,这种结构有助于测试用例的理解、调试和维护。然而真实项目中的测试用例往往较为复杂,AAA 结构并不显式,人工标注测试语句属于 Arrange、Action 还是 Assertion 既繁琐又耗时。本文提出一种自动化方法,利用机器学习模型对现有测试用例中的 AAA 语句进行标注,从而帮助新开发者以及采用集体代码所有权和测试驱动开发实践的项目更好地理解与维护测试代码。摘要主要阐述了动机与方法方向,未给出具体实验设置、评价指标或结果数据。

问题
真实单元测试用例结构复杂,AAA 模式不显式,人工标注 Arrange、Action、Assertion 语句繁琐,影响测试理解与维护。
方法
使用机器学习模型自动识别并标注现有测试用例中的 AAA 语句,以降低人工标注成本。
评估
摘要未报告具体实验设置、指标与结果;其预期应用场景是帮助新开发者和采用集体代码所有权或测试驱动开发的项目。
原文摘要(Abstract)

The AAA pattern, i.e. the Arrangement, Action, and Assertion, is a common and nature layout to create a test case. Following this pattern in test cases may benefit comprehension, debugging, and maintenance. The AAA structure of real-life test cases may not be explicit due to its high complexity. Manually labeling AAA statements in test cases is tedious. Thus, an automated approach for labeling AAA statements in existing test cases could benefit new developers and projects that practice collective code ownership and test driven development.

链接与引用

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

BibTeX
@inproceedings{paperbot7335,
  title = {Automatically Tagging the “AAA” Pattern in Unit Test Cases Using Machine Learning Models},
  author = {Chenhao Wei and Lu Xiao and Tingting Yu and Xinyu Chen and Xiao Wang and Sunny Wong and Abigail Clune},
  booktitle = {ASE},
  year = {2022},
  doi = {10.1145/3551349.3559510}
}