Automating Test Case Identification in Java Open Source Projects on GitHub Article Swipe
YOU?
·
· 2021
· Open Access
·
· DOI: https://doi.org/10.31577/cai_2021_3_575
· OA: W3217409757
Software testing is one of the very important Quality Assurance (QA)\ncomponents. A lot of researchers deal with the testing process in terms of\ntester motivation and how tests should or should not be written. However, it is\nnot known from the recommendations how the tests are written in real projects.\nIn this paper, the following was investigated: (i) the denotation of the word\n"test" in different natural languages; (ii) whether the number of occurrences\nof the word "test" correlates with the number of test cases; and (iii) what\ntesting frameworks are mostly used. The analysis was performed on 38 GitHub\nopen source repositories thoroughly selected from the set of 4.3M GitHub\nprojects. We analyzed 20,340 test cases in 803 classes manually and 170k\nclasses using an automated approach. The results show that: (i) there exists a\nweak correlation (r = 0.655) between the number of occurrences of the word\n"test" and the number of test cases in a class; (ii) the proposed algorithm\nusing static file analysis correctly detected 97% of test cases; (iii) 15% of\nthe analyzed classes used main() function whose represent regular Java programs\nthat test the production code without using any third-party framework. The\nidentification of such tests is very complex due to implementation diversity.\nThe results may be leveraged to more quickly identify and locate test cases in\na repository, to understand practices in customized testing solutions, and to\nmine tests to improve program comprehension in the future.\n