skip to main content
10.1145/3568364.3568380acmotherconferencesArticle/Chapter ViewAbstractPublication PageswsseConference Proceedingsconference-collections
research-article

Identifying Candidate Classes for Unit Testing Using Deep Learning Classifiers: An Empirical Validation

Authors Info & Claims
Published:23 December 2022Publication History

ABSTRACT

This paper aims at investigating the use of deep learning to suggest (prioritize) classes to be tested rigorously during unit testing of object-oriented systems. We relied on software unit testing information history and source code metrics. We conducted an empirical study using data collected from two Apache open-source Java software systems (POI and ANT). For each software system, we extracted the source code of five different versions. For each version, we collected various metrics from the source code of the Java classes. Then, for all software classes, we extracted testing coverage measures at instruction and method levels of granularity. We used the existing JUnit test cases developed for these systems. Based on the different datasets we collected, we trained several deep neural network models. We validated the obtained classifiers using four validation techniques: (1) CV: Cross Version validation, (2) CPV: Combined Previous Version validation, (3) CSPV: Combined System and Previous Version validation, and (4) LOSO: Leave One System Out validation. The obtained results in terms of classifiers’ performance vary between 70% and 80% of accuracy and strongly support the viability of our approach.

References

  1. B. Boehm, "A Spiral Model of Software Development and Enhancement", Proc. Int'l Workshop Software Process and Software Environments, ACM Press, 1985; also, in ACM Software Eng. Notes, Aug. 1986, pp. 22-42.Google ScholarGoogle Scholar
  2. B. Boehm. "Software Engineering Economics". Prentice Hall, Englewood Cliffs, NJ, ISBN-10: 0138221227, edition 01 oct 1981.Google ScholarGoogle Scholar
  3. S. Elbaum, A. G. Malishevsky and G. Rothermel, "Test Case Prioritization: A Family of Empirical Studies", IEEE Transactions Software Engineering, Vol. 28, No. 2, pp.159-182, 2002.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Elbaum, A. G. Malishevsky and G. Rothermel, "Prioritizing test cases for regression testing". Proc. ACM SIGSOFT Int. Symp. On Software Testing and Analysis (ISSTA), Portland, OR, USA, 22-25 August 2000, pp. 102-12Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. G. Rothermel, R.H Untch, C. Chu and M.J Harrold. "Test case prioritization: an empirical study", International Conference on Software Maintenance, Oxford, UK, pp. 179–188.,1999.Google ScholarGoogle Scholar
  6. J. Kim, and A. Porter, "A history-based test prioritization technique for regression testing in resource constrained environments", In Proceedings of the International Conference on Software Engineering, 2002.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. F. Toure., M. Badri and L. Lamontagne, "Investigating the Prioritization of Unit Testing Effort Using Software Metrics", In Proceedings of the 12th International Conference on Evaluation of Novel Approaches to Software Engineering (ENASE’17) Volume 1: ENASE, pages 69-80, 2017.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Chidamber S.R. and Kemerer C.F., "A Metrics Suite for Object Oriented Design", IEEE Transactions on Software Engineering, vol. 20, no. 6, pp. 476–493, 1994.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Bruntink, and A.V. Deursen,"Predicting Class Testability using Object-Oriented Metrics", 4th Int. Workshop on Source Code Analysis and Manipulation (SCAM), IEEE, 2004.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. V. Gupta, K. K. Aggarwal and Y. Singh, "A Fuzzy Approach for Integrated Measure of Object-Oriented Software Testability", Journal of Computer Science, Vol. 1, No. 2, 2005, pp. 276-282. doi:10.3844/jcssp.2005.276.282.Google ScholarGoogle ScholarCross RefCross Ref
  11. M. Bruntink and A. Van Deursen, "Predicting class testability using object-oriented metrics", in Proceedings of the 4th IEEE International Workshop on Source Code Analysis and Manipulation (SCAM ’04), pp. 136–145, September 2004.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Bruntink and A. van Deursen, "An empirical study of class testability", Journal of Systems and Software, vol. 79, no. 9, pp. 1219– 1232, 2006.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. JUnit Framework, https://junit.org/junit5/. Visited in October 2020.Google ScholarGoogle Scholar
  14. K. Jarrett, K. Kavukcuoglu, M. A. Ranzato, and Y. LeCun. "What is the best multi-stage architecture for object recognition?" In International Conference on Computer Vision, pages 2146–2153. IEEE, 2009.Google ScholarGoogle Scholar
  15. Y. LeCun, K. Kavukcuoglu, and C. Farabet, Convolutional networks and applications in vision. In Circuits and Systems (ISCAS), Proceedings of 2010 IEEE International Symposium on, pages 253– 256. IEEE, 2010.Google ScholarGoogle Scholar
  16. Apache POI releases, https://github.com/apache/poi/releases, Visited in October 2020.Google ScholarGoogle Scholar
  17. Apache ANT releases, https://github.com/apache/ant/releases, Visited in October 2020.Google ScholarGoogle Scholar
  18. Williams, B. S. a. L. (2008). "A Survey on Code Coverage as a Stopping Criterion for Unit Testing.", Technical report (North Carolina State University. Dept. of Computer Science), TR-2008-22.Google ScholarGoogle Scholar
  19. S. Mirarab, A. Hassouna, and L. Tahvildar, "Using Bayesian belief networks to predict change propagation in software systems" in Proceedings of the 15th IEEE International Conference on Program Comprehension, pages 177-188, 2007.Google ScholarGoogle Scholar
  20. Lazić, L.: Software Testing Optimization by Advanced Quantitative Defect Management. Computer Science and Information Systems, Vol. 7, No. 3, 459-487, https://doi.org/10.2298/CSIS090923008L, (2010).Google ScholarGoogle Scholar
  21. G. Rothermel, M. J. Harrold, J. Ronne and C. Hong, “Empirical Studies of Test‐Suite Reduction”, In Journal of Software Testing, Verification, and Reliability, Vol. 12, No.4, 2002.Google ScholarGoogle ScholarCross RefCross Ref
  22. W. Wong, J. Horgan, S. London, and H. Agrawal, “A study of effective regression in practice”, Proceedings of the 8th International Symposium on Software Reliability Engineering, November, p.230–238, 1997.Google ScholarGoogle ScholarCross RefCross Ref
  23. R. Carlson, A. Denton, “A clustering approach to improving test case prioritization, An industrial case study”, 27th IEEE International Conference on Software Maintenance (ICSM), 2011.Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. H. Spieker, A. Gotlieb, D. Marijan and M. Mossige, "Reinforcement learning for automatic test case prioritization and selection in continuous integration", Proceedings of the 26th ACM SIGSOFT International Symposium on Software Testing and Analysis, July 2017.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. W. Matcha, F. Touré, M. Badri, L. Badri, Using Deep Learning Classifiers to Identify Candidate Classes for Unit Testing in Object-Oriented Systems. SEKE 2020: 353-358.Google ScholarGoogle Scholar
  26. Github Repository, https://github.com/apache/ant, Visited in October 2020.Google ScholarGoogle Scholar
  27. IntelliJ IDE, https://www.jetbrains.com/idea/, Visited in October 2020.Google ScholarGoogle Scholar
  28. Code Mr plugin, https://plugins.jetbrains.com/plugin/10811-codemr/, Visited in October 2020.Google ScholarGoogle Scholar
  29. Code-Coverage plugin, https://www.jetbrains.com/help/idea/codecoverage.html, Visited in October 2020.Google ScholarGoogle Scholar
  30. Artificial Intelligence and life in 2030, one-hundred-year study on artificial Intelligence, report of the 2015 Study panel, September 2016Google ScholarGoogle Scholar
  31. Y. LeCun, Y. Bengio, G, Hinton. "Deep learning”. Nature. 2015;521(7553):436-444. doi:10.1038/nature14539Google ScholarGoogle ScholarCross RefCross Ref
  32. F. Rosenblatt, "The perceptron: A probabilistic model for information storage and Organization in the brain", in cognitive systems. Buffalo: Cornell Aeronautical Laboratory, Inc. Rep. No. VG-1196-G-1, 1958.Google ScholarGoogle Scholar
  33. M. Minsky, and S. Papert, “Perceptrons: An Introduction to Computational Geometry,” MIT Press, expanded edition, ISBN-10: 0262631113, décembre 1987Google ScholarGoogle Scholar
  34. D. E. Rumelhart, G. Hinton, and R. J. Williams, "Learning representations by back-propagating errors", Cognitive modeling 5.3 (1988):Google ScholarGoogle Scholar
  35. Tensorflow: https://www.tensorflow.org/Google ScholarGoogle Scholar
  36. Kera: https://keras.io/Google ScholarGoogle Scholar
  37. Panda : https://pandas.pydata.orgGoogle ScholarGoogle Scholar

Index Terms

  1. Identifying Candidate Classes for Unit Testing Using Deep Learning Classifiers: An Empirical Validation

    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 Other conferences
      WSSE '22: Proceedings of the 4th World Symposium on Software Engineering
      September 2022
      187 pages
      ISBN:9781450396950
      DOI:10.1145/3568364

      Copyright © 2022 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: 23 December 2022

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article
      • Research
      • Refereed limited
    • Article Metrics

      • Downloads (Last 12 months)26
      • Downloads (Last 6 weeks)0

      Other Metrics

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    HTML Format

    View this article in HTML Format .

    View HTML Format