Test name recommendation — A study of the unit test naming and naming traditions

Christian Zürcher. Test name recommendation — A study of the unit test naming and naming traditions. Bachelor’s thesis, University of Bern, January 2020. Details.


The name of a unit test is an essential part of it and helps the developers to understand its purpose and to identify tests inside test suites. And even though such names have a lot of benefits, many tests end without a descriptive name. This occurs not only in automatically generated tests but also in manually written ones. Automatically generating descriptive names is confronted with the challenge that there is a vast variety of tests, written by different developers with different conventions, or generated by different tools. In this thesis, we present an automated approach to generate descriptive names based on the test body by finding the focal method of the test, around which it was written. We compared our results to the original names and to other publications to find out that our approach provides good results for all kind of tests even though in specific scenarios, other approaches may work better. Finally, we found out, that the names created by developers, when done correctly, are still the most descriptive.

Posted by scg at 23 January 2020, 11:15 am link
Last changed by admin on 21 April 2009