skip to main content
10.1145/3194095.3194102acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
short-paper

The quality of junit tests: an empirical study report

Published:28 May 2018Publication History

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.

References

  1. Sujoy Acharya. 2014. Mastering Unit Testing Using Mockito and JUnit. Packt Publishing Ltd, Birmingham, UK. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Ken Arnold and James Gosling. 1996. The Java Programming Language. Addison-Wesley Publishing Company, Reading, MA.Google ScholarGoogle Scholar
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarCross RefCross Ref
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. Jeff Grigg. 2012. Arrange Act Assert. http://wiki.c2.com/?ArrangeActAssert. (2012).Google ScholarGoogle Scholar
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. Gerard Meszaros. 2007. xUnit test patterns: Refactoring test code. Pearson Education, London, UK. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle Scholar
  11. 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 ScholarGoogle Scholar
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. The quality of junit tests: an empirical study report

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            SQUADE '18: Proceedings of the 1st International Workshop on Software Qualities and Their Dependencies
            May 2018
            53 pages
            ISBN:9781450357371
            DOI:10.1145/3194095

            Copyright © 2018 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 28 May 2018

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • short-paper

            Upcoming Conference

            ICSE 2025

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader