ABSTRACT
The quality of unit tests gains substantial importance in modern software systems. This work explores the way in which Junit tests are written in real world Java systems. We analyse 112 Java repositories and measure the quality of unit tests by finding patterns which indicate good practices of coding. Our results show that the quality of real world unit tests is low, and that in many cases, unit tests don't follow the well-known recommendations for writing unit tests. These early results demonstrate the need for more tools and techniques for refactoring of tests.
- Sujoy Acharya. 2014. Mastering Unit Testing Using Mockito and JUnit. Packt Publishing Ltd, Birmingham, UK. Google ScholarDigital Library
- Ken Arnold and James Gosling. 1996. The Java Programming Language. Addison-Wesley Publishing Company, Reading, MA.Google Scholar
- Moritz Beller, Georgios Gousios, Annibale Panichella, and Andy Zaidman. 2015. When, How, and Why Developers (Do Not) Test in Their IDEs. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2015). ACM, New York, NY, USA, Article 1, 12 pages. Google ScholarDigital Library
- Yossi Gil, Dor Ma'ayan, Niv Shalmon, Raviv Rachmiel, and Ori Roth. 2017. Syntactic Zoom-Out/Zoom-In Code with the Athenizer. In Software Visualization (VISSOFT), 2017 IEEE Working Conference on. IEEE, IEEE, Piscataway, NJ, USA, 124--128.Google ScholarCross Ref
- Danielle Gonzalez, Joanna C. S. Santos, Andrew Popovich, Mehdi Mirakhorli, and Mei Nagappan. 2017. A Large-scale Study on the Usage of Testing Patterns That Address Maintainability Attributes: Patterns for Ease of Modification, Diagnoses, and Comprehension. In Proceedings of the 14th International Conference on Mining Software Repositories (MSR '17). IEEE Press, Piscataway, NJ, USA, Article 1, 11 pages. Google ScholarDigital Library
- Jeff Grigg. 2012. Arrange Act Assert. http://wiki.c2.com/?ArrangeActAssert. (2012).Google Scholar
- Pavneet Singh Kochhar, Tegawendé F Bissyandé, David Lo, and Lingxiao Jiang. 2013. An empirical study of adoption of software testing in open source projects. In Quality Software (QSIC), 2013 13th International Conference on. IEEE, IEEE, Piscataway, NJ, USA, 103--112. Google ScholarDigital Library
- Gerard Meszaros. 2007. xUnit test patterns: Refactoring test code. Pearson Education, London, UK. Google ScholarDigital Library
- Ewan Tempero, Craig Anslow, Jens Dietrich, Ted Han, Jing Li, Markus Lumpe, Hayden Melton, and James Noble. 2010. Qualitas Corpus: A Curated Collection of Java Code for Empirical Studies. In 2010 Asia Pacific Software Engineering Conference (APSEC2010). IEEE, Piscataway, NJ, USA, 336--345. Google ScholarDigital Library
- Arie Van Deursen, Leon Moonen, Alex van den Bergh, and Gerard Kok. 2001. Refactoring test code. In Proceedings of the 2nd international conference on extreme programming and flexible processes in software engineering (XP2001). ACM, New York, NY, 92--95.Google Scholar
- Ahmed Zerouali and Tom Mens. 2017. Analyzing the evolution of testing library usage in open source Java projects. In Software Analysis, Evolution and Reengineering (SANER), 2017 IEEE 24th International Conference on. IEEE, IEEE, Piscataway, NJ, USA, 417--421.Google Scholar
- Yucheng Zhang and Ali Mesbah. 2015. Assertions Are Strongly Correlated with Test Suite Effectiveness. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2015). ACM, New York, NY, USA, Article 1, 11 pages. Google ScholarDigital Library
Index Terms
- The quality of junit tests: an empirical study report
Recommendations
Using testing and JUnit across the curriculum
SIGCSE '05: Proceedings of the 36th SIGCSE technical symposium on Computer science educationWhile the usage of unit-testing frameworks such as JUnit has greatly increased over the last several years, it is not immediately apparent to students and instructors how to best use tools like JUnit and how to integrate testing across a computer ...
Using testing and JUnit across the curriculum
While the usage of unit-testing frameworks such as JUnit has greatly increased over the last several years, it is not immediately apparent to students and instructors how to best use tools like JUnit and how to integrate testing across a computer ...
Evaluating the Quality of Student-Written Software Tests with Curated Mutation Analysis
SPLASH-E 2022: Proceedings of the 2022 ACM SIGPLAN International Symposium on SPLASH-EAn important learning outcome in software engineering education is the ability to write an effective test suite that rigorously tests a target application. The standard approach for assessing test suites is to check coverage which can be problematic ...
Comments