一种基于模式的非描述性测试名检测与改进方法
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。