Towards automatically generating descriptive names for unit tests | IEEE Conference Publication | IEEE Xplore

Towards automatically generating descriptive names for unit tests


Abstract:

During maintenance, developers often need to understand the purpose of a test. One of the most potentially useful sources of information for understanding a test is its n...Show More

Abstract:

During maintenance, developers often need to understand the purpose of a test. One of the most potentially useful sources of information for understanding a test is its name. Ideally, test names are descriptive in that they accurately summarize both the scenario and the expected outcome of the test. Despite the benefits of being descriptive, test names often fall short of this goal. In this paper we present a new approach for automatically generating descriptive names for existing test bodies. Using a combination of natural-language program analysis and text generation, the technique creates names that summarize the test's scenario and the expected outcome. The results of our evaluation show that, (1) compared to alternative approaches, the names generated by our technique are significantly more similar to human-generated names and are nearly always preferred by developers, (2) the names generated by our technique are preferred over or are equivalent to the original test names in 83% of cases, and (3) our technique is several orders of magnitude faster than manually writing test names.
Date of Conference: 03-07 September 2016
Date Added to IEEE Xplore: 06 October 2016
ISBN Information:
Conference Location: Singapore

References

References is not available for this document.