Tracing Naming Semantics in Unit Tests of Popular Github Android Projects

Matej Madeja, Jaroslav Porubän, Michael Wagner
2019 Symposium on Languages, Applications and Technologies  
The tests are so closely linked to the source code that we consider them up-to-date documentation. Developers are aware of recommended naming conventions and other best practices that should be used to write tests. In this paper we focus on how the developers test in practice and what conventions they use. For the analysis 5 very popular Android projects from Github were selected. The results show that 49 % of tests contain full and 76 % of tests contain a partial unit under test (UUT) method
more » ... me in their name. Further, there was observed that UUT was only rarely tested by multiple test classes and thus in cases when the tester wanted to distinguish the way he or she worked with the tested object. The analysis of this paper shows that the word "test" in the test title is not a reliable metric for identifying the test. Apart from assertions, the developers use statements like verify, try-catch and throw exception to verify the correctness of UUT functionality. At the same time it was found out that the test titles contained keywords which could lead to the identification of UUT, use case of test or data used for test. It was also found out that the words in the test title were very often found in its body and in a smaller amount in UUT body which indicated the use of similar vocabulary in tests and UUT. ACM Subject Classification Software and its engineering → Semantics; Software and its engineering → Software testing and debugging; Software and its engineering → Software reverse engineering; Software and its engineering → Maintaining software Keywords and phrases unit tests, android, real testing practices, unit tests, program comprehension Digital Object Identifier 10.4230/OASIcs.SLATE.2019.3 Acknowledgements This work was supported by project VEGA No. 1/0762/19: Interactive patterndriven language development.
doi:10.4230/oasics.slate.2019.3 dblp:conf/slate/MadejaP19 fatcat:3gz57hqz3nbpxp6ie67qbvomve