Empirical Study of Test Case and Test Framework Presence in Public Projects on GitHub

Automated tests are often considered an indicator of project quality. In this paper, we performed a large analysis of 6.3 M public GitHub projects using Java as the primary programming language. We created an overview of tests occurrence in publicly available GitHub projects and the use of test frameworks in them. The results showed that 52% of the projects contain at least one test case. However, there is a large number of example tests that do not represent relevant production code testing. It was also found that there is only a poor correlation between the number of the word “test” in different parts of the project (e.g., file paths, file name, file content, etc.) and the number of test cases, creation date, date of the last commit, number of commits, or number of watchers. Testing framework analysis confirmed that JUnit is the most used testing framework with a 48% share. TestNG, considered the second most popular Java unit testing framework, occurred in only 3% of the projects.

[1]  Maria Cláudia Figueiredo Pereira Emer,et al.  The effects of test driven development on internal quality, external quality and productivity: A systematic review , 2016, Inf. Softw. Technol..

[2]  David Lo,et al.  An Empirical Study of Adoption of Software Testing in Open Source Projects , 2013, 2013 13th International Conference on Quality Software.

[3]  Matús Sulír,et al.  Source code annotations as formal languages , 2015, 2015 Federated Conference on Computer Science and Information Systems (FedCSIS).

[4]  Jan Vitek,et al.  FSE/CACM Rebuttal2: Correcting A Large-Scale Study of Programming Languages and Code Quality in GitHub , 2019, ArXiv.

[5]  Andrea De Lucia,et al.  Testing of Mobile Applications in the Wild: A large-Scale Empirical Study on Android Apps , 2020, 2020 IEEE/ACM 28th International Conference on Program Comprehension (ICPC).

[6]  Georgios Gousios,et al.  TravisTorrent: Synthesizing Travis CI and GitHub for Full-Stack Research on Continuous Integration , 2017, 2017 IEEE/ACM 14th International Conference on Mining Software Repositories (MSR).

[7]  Burak Turhan,et al.  What Do We (Really) Know about Test-Driven Development? , 2018, IEEE Software.

[8]  Luis Cruz,et al.  To the attention of mobile software developers: guess what, test your app! , 2019, Empirical Software Engineering.

[9]  Tracy Hall,et al.  How Effectively Is Defective Code Actually Tested?: An Analysis of JUnit Tests in Seven Open Source Systems , 2018, PROMISE.

[10]  David Lo,et al.  Adoption of Software Testing in Open Source Projects--A Preliminary Study on 50,000 Projects , 2013, 2013 17th European Conference on Software Maintenance and Reengineering.

[11]  A. Culyer Pearson’s Correlation Coefficient , 2014 .

[12]  Natalia Juristo Juzgado,et al.  A Dissection of the Test-Driven Development Process: Does It Really Matter to Test-First or to Test-Last? , 2016, IEEE Transactions on Software Engineering.

[13]  Vojislav B. Misic,et al.  The Effects of Test-Driven Development on External Quality and Productivity: A Meta-Analysis , 2013, IEEE Transactions on Software Engineering.

[14]  Georgios Gousios,et al.  When, how, and why developers (do not) test in their IDEs , 2015, ESEC/SIGSOFT FSE.

[15]  Andy Zaidman,et al.  On the Relation of Test Smells to Software Code Quality , 2018, 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[16]  Meiyappan Nagappan,et al.  Curating GitHub for engineered software projects , 2017, Empirical Software Engineering.