xNose:面向 C# 的测试坏味检测器
xNose: A Test Smell Detector for C#
AI总结:
本文针对 C# 测试坏味检测工具缺乏的问题,开发了 xNose 工具,识别 16 种测试坏味并分析其在 xUnit 项目中的分布,精确率和召回率分别达 96.97% 和 96.03%,以帮助开发者维护代码质量。
摘要:
测试坏味与代码坏味类似,会对测试代码以及被测试的生产代码产生负面影响。尽管在 Java、Scala 和 Python 等语言中已有大量关于测试坏味的研究,但用于检测 C# 测试坏味的自动化工具仍然缺乏。本文旨在通过将测试坏味研究扩展到 C#,并开发一个工具(xNose)来识别该语言中的测试坏味并分析其在项目中的分布,从而弥补这一空白。我们从先前研究中识别出 16 种与语言无关且在 C# 中具有等效特征的测试坏味,并对 xNose 进行了评估,取得了 96.97% 的精确率和 96.03% 的召回率。此外,我们还开展了一项实证研究,以确定基于 xUnit 的 C# 项目中测试坏味的普遍性。该分析揭示了测试坏味的频率和分布情况,加深了我们对测试坏味对 C# 项目和测试套件影响的理解。xNose 的开发以及我们对 C# 代码中测试坏味的分析,旨在帮助开发人员在开发过程早期解决潜在问题,从而维护代码质量。
英文摘要:
Test smells, similar to code smells, can negatively impact both the test code and the production code being tested. Despite extensive research on test smells in languages like Java, Scala, and Python, automated tools for detecting test smells in C# are lacking. This paper aims to bridge this gap by extending the study of test smells to C#, and developing a tool (xNose) to identify test smells in this language and analyze their distribution across projects. We identified 16 test smells from prior studies that were language-independent and had equivalent features in C# and evaluated xNose, achieving a precision score of 96.97% and a recall score of 96.03%. In addition, we conducted an empirical study to determine the prevalence of test smells in xUnit-based C# projects. This analysis sheds light on the frequency and distribution of test smells, deepening our understanding of their impact on C# projects and test suites. The development of xNose and our analysis of test smells in C# code aim to assist developers in maintaining code quality by addressing potential issues early in the development process.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。