论文标题
一种基于模式的方法来检测和改善非描述性测试名称
A Pattern-based Approach to Detect and Improve Non-descriptive Test Names
论文作者
论文摘要
单位测试是一个重要的工件,可以通过多种方式支持软件开发过程。例如,当测试失败时,其名称可以提供了解测试目的的第一步。不幸的是,单位测试通常缺乏描述性名称。在本文中,我们提出了一种新的,基于模式的方法,可以通过使开发人员更具描述性来帮助开发人员提高JUNIT测试的测试名称质量。它通过检测非描述性测试名称和在某些情况下,提供有关如何改进名称的其他信息。使用34352 JUNIT测试的经验评估对我们的方法进行了评估。评估的结果表明,该方法在区分描述性和非描述性名称的情况下是可行,准确且有用的,其真实阳性率为95%。
Unit tests are an important artifact that supports the software development process in several ways. For example, when a test fails, its name can provide the first step towards understanding the purpose of the test. Unfortunately, unit tests often lack descriptive names. In this paper, we propose a new, pattern-based approach that can help developers improve the quality of test names of JUnit tests by making them more descriptive. It does this by detecting non-descriptive test names and in some cases, providing additional information about how the name can be improved. Our approach was assessed using an empirical evaluation on 34352 JUnit tests. The results of the evaluation show that the approach is feasible, accurate, and useful at discriminating descriptive and non-descriptive names with a 95% true-positive rate.