一句话:通过 96 名本科生的受控实验,发现测试异味(尤其 Assertion Roulette)会延长修复生产代码错误的时间。
单元测试用例也会出现不良编程实践,即测试异味,可能损害维护活动中的程序理解。该文关注两种常见测试异味 Assertion Roulette 与 Eager Test,对 96 名计算机科学本科生开展受控实验,考察它们如何影响学生调试和排查测试用例失败的能力。结果显示,当相关测试用例中存在测试异味时,学生修复生产代码错误所需时间更长,其中 Assertion Roulette 的影响尤为明显。作者希望这些发现能帮助教育界更好地培养学生编写和维护高质量测试用例的知识与资源。实验材料已在线公开。
To ensure the quality of a software system, developers perform an activity known as unit testing, where they write code (known as test cases) that verifies the individual software units that make up the system. Like production code, test cases are subject to bad programming practices, known as test smells, that hurt maintenance activities. An essential part of most maintenance activities is program comprehension which involves developers reading the code to understand its behavior to fix issues or update features. In this study, we conduct a controlled experiment with 96 undergraduate computer science students to investigate the impact of two common types of test smells, namely Assertion Roulette and Eager Test, on a student’s ability to debug and troubleshoot test case failures. Our findings show that students take longer to correct errors in production code when smells are present in their associated test cases, especially Assertion Roulette. We envision our findings supporting academia in better equipping students with the knowledge and resources in writing and maintaining high-quality test cases. Our experimental materials are available online11https://wajdialjedaani.github.io/testsmellstd/
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2303-04234,
title = {Do the Test Smells Assertion Roulette and Eager Test Impact Students’ Troubleshooting and Debugging Capabilities?},
author = {Wajdi Aljedaani and Mohamed Wiem Mkaouer and Anthony Peruma and Stephanie Ludi},
booktitle = {ICSE},
year = {2023},
doi = {10.1109/icse-seet58685.2023.00009}
}