Browsing by Author "Wu, Jianwei"
Now showing 1 - 2 of 2
Results Per Page
Sort Options
Item Automated Identification of Uniqueness in JUnit Tests(ACM Transactions on Software Engineering and Methodology, 2022-05-24) Wu, Jianwei; Clause, JamesIn the context of testing, descriptive test names are desirable because they document the purpose of tests and facilitate comprehension tasks during maintenance. Unfortunately, prior work has shown that tests often do not have descriptive names. To address this limitation, techniques have been developed to automatically generate descriptive names. However, they often generated names that are invalid or do not meet with developer approval. To help address these limitations, we present a novel approach to extract the attributes of a given test that make it unique among its siblings. Because such attributes often serve as the basis for descriptive names, identifying them is an important first step towards improving test name generation approaches. To evaluate the approach, we created a prototype implementation for JUnit tests and compared its output with human judgment. The results of the evaluation demonstrate that the attributes identified by the approach are consistent with human judgment and are likely to be useful for future name generation techniques.Item Providing developer-approved descriptive names for unit tests(University of Delaware, 2023) Wu, JianweiUnit tests are a critical artifact that supports the software development process in several major ways. For example, when a test fails, its name can provide the first step towards comprehending the purpose of the test and fix the potential bug or issue found in software. As an alternative to reading tens or hundreds of lines of code, comprehension of unit tests is the foundation towards modifying existing tests, adding new tests, or removing unnecessary tests. Therefore, having a descriptive name that can summarize the purpose and context of the test is the key to a successful fix towards the potential bug or issue. Unfortunately, unit tests often lack descriptive names, and non-descriptive names prevent developers from accomplishing the first step of unit testing, comprehension of unit tests. ☐ This dissertation presents a novel method for generating descriptive names for unit tests. This method is based on test patterns and the uniqueness of the test to parse the test body and extract the purpose and context of the test to generate a descriptive name for the test. These combine as a natural and intuitive way to learn the information embedded in the test and use it to produce a descriptive name. Existing work tried to solve the naming problem of unit test. However, existing approaches, either fixing current names or generating new names to replace current names, ignored the vastly existing naming rationales that are commonly used by developers. Therefore, their fixed or generated names often failed to meet developers’ approval. Conversely, our method is mainly based on quantitative and empirical studies, which highly focused on the need of developers. ☐ The first contribution of this dissertation is a pattern-based approach to detect non- descriptive test names and provide initial guidance to fix them. After these non-descriptive names are detected and the initial clue about how to fix them is acquired, the next step is to extract the uniqueness of the test as a middle step towards generating descriptive names. The second contribution of this dissertation is to automatically identify the uniqueness of the test. This step laid the foundation of our name generation approach, which was conducted in an independent, empirical study. After the uniqueness of the test is identified, we can further use it to generate descriptive name. Finally, based on the uniqueness of the test, the last contribution is the name generation approach, which can provide descriptive test names that meet developers’ needs.