skip to main content
10.1145/2771783.2771801acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Automated unit test generation during software development: a controlled experiment and think-aloud observations

Published:13 July 2015Publication History

ABSTRACT

Automated unit test generation tools can produce tests that are superior to manually written ones in terms of code coverage, but are these tests helpful to developers while they are writing code? A developer would first need to know when and how to apply such a tool, and would then need to understand the resulting tests in order to provide test oracles and to diagnose and fix any faults that the tests reveal. Considering all this, does automatically generating unit tests provide any benefit over simply writing unit tests manually? We empirically investigated the effects of using an automated unit test generation tool (EvoSuite) during development. A controlled experiment with 41 students shows that using EvoSuite leads to an average branch coverage increase of +13%, and 36% less time is spent on testing compared to writing unit tests manually. However, there is no clear effect on the quality of the implementations, as it depends on how the test generation tool and the generated tests are used. In-depth analysis, using five think-aloud observations with professional programmers, confirms the necessity to increase the usability of automated unit test generation tools, to integrate them better during software development, and to educate software developers on how to best use those tools.

References

  1. C. Pacheco, S. K. Lahiri, M. D. Ernst, and T. Ball, “Feedback-directed random test generation,” in ACM/IEEE Int. Conference on Software Engineering (ICSE), 2007, pp. 75–84. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. B. Meyer, I. Ciupa, A. Leitner, and L. L. Liu, “Automatic testing of object-oriented software,” in SOFSEM’07: Theory and Practice of Computer Science, ser. LNCS, vol. 4362. Springer-Verlag, 2007, pp. 114–129. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. N. Tillmann and J. N. de Halleux, “Pex — white box test generation for .NET,” in Int. Conference on Tests And Proofs (TAP), ser. LNCS, vol. 4966. Springer, 2008, pp. 134 – 253. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. C. Csallner and Y. Smaragdakis, “JCrasher: an automatic robustness tester for Java,” Softw. Pract. Exper., vol. 34, pp. 1025–1050, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. P. Tonella, “Evolutionary testing of classes,” in ACM Int. Symposium on Software Testing and Analysis (ISSTA), 2004, pp. 119–128. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. H. Andrews, F. C. H. Li, and T. Menzies, “Nighthawk: a two-level genetic-random unit test data generator,” in IEEE/ACM Int. Conference on Automated Software Engineering (ASE), 2007, pp. 144–153. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. L. Baresi, P. L. Lanzi, and M. Miraz, “TestFul: an evolutionary test approach for Java,” in IEEE Int. Conference on Software Testing, Verification and Validation (ICST), 2010, pp. 185–194. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. G. Fraser and A. Arcuri, “Whole test suite generation,” IEEE Transactions on Software Engineering, vol. 39, no. 2, pp. 276–291, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Park, B. M. M. Hossain, I. Hussain, C. Csallner, M. Grechanik, K. Taneja, C. Fu, and Q. Xie, “CarFast: achieving higher statement coverage faster,” in ACM Symposium on the Foundations of Software Engineering (FSE), 2012, pp. 35:1–35:11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. (2014) Agitar One. {Online}. Available: http://www.agitar.comGoogle ScholarGoogle Scholar
  11. (2014) Parasoft JTest. {Online}. Available: http://www.parasoft.com/jtestGoogle ScholarGoogle Scholar
  12. G. Fraser, M. Staats, P. McMinn, A. Arcuri, and F. Padberg, “Does automated white-box test generation really help software testers?” in ACM Int. Symposium on Software Testing and Analysis (ISSTA), 2013, pp. 291–301. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. G. Fraser and A. Arcuri, “EvoSuite: Automatic test suite generation for object-oriented software.” in ACM Symposium on the Foundations of Software Engineering (FSE), 2011, pp. 416–419. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. Jedlitschka, M. Ciolkowski, and D. Pfahl, “Reporting experiments in software engineering,” in Guide to Advanced Empirical Software Engineering, F. Shull, J. Singer, and D. Sjøberg, Eds. Springer London, 2008, pp. 201–228.Google ScholarGoogle ScholarCross RefCross Ref
  15. (2014) Apache Commons Libraries. {Online}. Available: http://commons.apache.org/Google ScholarGoogle Scholar
  16. (2014) JavaNCSS - a source measurement suite for Java. Version 32.53. {Online}. Available: http://www.kclee.de/clemens/java/javancssGoogle ScholarGoogle Scholar
  17. (2014) EclEmma - Java code coverage for Eclipse. Version 2.3.1. {Online}. Available: http://www.eclemma.org/Google ScholarGoogle Scholar
  18. (2014) Rabbit - Eclipse statistics tracking plugin. Version 1.2.1. {Online}. Available: https://code.google.com/p/rabbit-eclipse/Google ScholarGoogle Scholar
  19. N. Li, X. Meng, J. Offutt, and L. Deng, “Is bytecode instrumentation as good as source code instrumentation: An empirical study with industrial tools (experience report),” in IEEE Int. Symposium on Software Reliability Engineering (ISSRE), 2013, pp. 380–389.Google ScholarGoogle ScholarCross RefCross Ref
  20. R. Just, “The Major mutation framework: Efficient and scalable mutation analysis for Java,” in ACM Int. Symposium on Software Testing and Analysis (ISSTA), 2014, pp. 433–436. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. J. H. Andrews, L. C. Briand, and Y. Labiche, “Is mutation an appropriate tool for testing experiments?” in ACM/IEEE Int. Conference on Software Engineering (ICSE), 2005, pp. 402–411. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. R. Just, D. Jalali, L. Inozemtseva, M. Ernst, R. Holmes, and G. Fraser, “Are mutants a valid substitute for real faults in software testing?” in ACM Symposium on the Foundations of Software Engineering (FSE), 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. Fay and M. Proschan, “Wilcoxon-Mann-Whitney or t-test? On assumptions for hypothesis tests and multiple interpretations of decision rules,” Statistics Surveys, vol. 4, pp. 1–39, 2010.Google ScholarGoogle ScholarCross RefCross Ref
  24. A. Arcuri and L. Briand, “A hitchhiker’s guide to statistical tests for assessing randomized algorithms in software engineering,” Software Testing, Verification and Reliability (STVR), vol. 24, no. 3, pp. 219–250, 2012.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. R. Grissom and J. Kim, Effect sizes for research: A broad practical approach. Lawrence Erlbaum, 2005.Google ScholarGoogle Scholar
  26. J. Cohen, “A power primer,” Psychological bulletin, vol. 112, no. 1, pp. 155–159, 1992.Google ScholarGoogle ScholarCross RefCross Ref
  27. A. Vargha and H. D. Delaney, “A critique and improvement of the CL common language effect size statistics of McGraw and Wong,” Journal of Educational and Behavioral Statistics, vol. 25, no. 2, pp. 101–132, 2000.Google ScholarGoogle Scholar
  28. J. Carver, L. Jaccheri, S. Morasca, and F. Shull, “Issues in using students in empirical studies in software engineering education,” in IEEE Int. Software Metrics Symposium, 2003, pp. 239–249. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. M. Höst, B. Regnell, and C. Wohlin, “Using students as subjects—A comparative study of students and professionals in lead-time impact assessment,” Empirical Software Engineering, vol. 5, no. 3, pp. 201–214, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. B. A. Kitchenham, S. L. Pfleeger, L. M. Pickard, P. W. Jones, D. C. Hoaglin, K. E. Emam, and J. Rosenberg, “Preliminary guidelines for empirical research in software engineering,” IEEE Transactions on Software Engineering (TSE), vol. 28, no. 8, pp. 721–734, Aug. 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. K. A. Ericsson and H. A. Simon, Protocol Analysis: Verbal Reports as Data (revised edition). MIT Press, Cambridge, MA, 1993.Google ScholarGoogle ScholarCross RefCross Ref
  32. K. A. Ericsson, “Valid and non-reactive verbalization of thoughts during performance of tasks - towards a solution to the central problems of introspection as a source of scientific data,” Consciousness Studies, vol. 10, no. 9-10, pp. 1–18, 2003.Google ScholarGoogle Scholar
  33. S. McDonald, H. Edwards, and T. Zhao, “Exploring think-alouds in usability testing: An international survey,” IEEE Transactions on Professional Communication, vol. 55, no. 1, pp. 2–19, March 2012.Google ScholarGoogle ScholarCross RefCross Ref
  34. D. Sjoberg, J. Hannay, O. Hansen, V. By Kampenes, A. Karahasanovic, N. Liborg, and A. C Rekdal, “A survey of controlled experiments in software engineering,” IEEE Transactions on Software Engineering (TSE), vol. 31, no. 9, pp. 733–753, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. R. P. Buse, C. Sadowski, and W. Weimer, “Benefits and barriers of user evaluation in software engineering research,” in ACM SIGPLAN Notices, vol. 46, no. 10, 2011, pp. 643–656. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. A. Orso and G. Rothermel, “Software Testing: A Research Travelogue (2000–2014),” in ACM Future of Software Engineering (FOSE), 2014, pp. 117–132. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. M. Ceccato, A. Marchetto, L. Mariani, C. D. Nguyen, and P. Tonella, “An empirical study about the effectiveness of debugging when random test cases are used,” in ACM/IEEE Int. Conference on Software Engineering (ICSE), 2012, pp. 452–462. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. R. Ramler, D. Winkler, and M. Schmidt, “Random test case generation and manual unit testing: Substitute or complement in retrofitting tests for legacy code?” in IEEE Euromicro Conference on Software Engineering and Advanced Applications (SEAA), 2012, pp. 286–293. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. D. Saff and M. D. Ernst, “An experimental evaluation of continuous testing during development,” in ACM Int. Symposium on Software Testing and Analysis (ISSTA), 2004, pp. 76–85. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. J. Hughes and S. Parkes, “Trends in the use of verbal protocol analysis in software engineering research,” Behaviour and Information Technology, vol. 22, no. 2, pp. 127–140, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  41. A. M. Vans, A. von Mayrhauser, and G. Somlo, “Program understanding behavior during corrective maintenance of large-scale software,” Int. Journal of Human-Computer Studies, vol. 51, no. 1, pp. 31–70, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. J. E. Hale, S. Sharpe, and D. P. Hale, “An evaluation of the cognitive processes of programmers engaged in software debugging,” Software Maintenance: Research and Practice, vol. 11, no. 2, pp. 73–91, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. T. Roehm, R. Tiarks, R. Koschke, and W. Maalej, “How do professional developers comprehend software?” in ACM/IEEE Int. Conference on Software Engineering (ICSE), 2012, pp. 255–265. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. S. Owen, P. Brereton, and D. Budgen, “Protocol analysis: A neglected practice,” Commun. ACM, vol. 49, no. 2, pp. 117–122, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. J. Whalley and N. Kasto, “A qualitative think-aloud study of novice programmers’ code writing strategies,” in ACM Conf. on Innovation and Technology in Computer Science Education (ITiCSE), 2014, pp. 279–284. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. J.-P. Ostberg, J. Ramadani, and S. Wagner, “A novel approach for discovering barriers in using automatic static analysis,” in ACM Int. Conference on Evaluation and Assessment in Software Engineering (EASE), 2013, pp. 78–81. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. G. Fraser and A. Zeller, “Exploiting common object usage in test case generation,” in IEEE Int. Conference on Software Testing, Verification and Validation (ICST), 2011, pp. 80–89. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. S. Afshan, P. McMinn, and M. Stevenson, “Evolving readable string test inputs using a natural language model to reduce human oracle cost,” in Int. Conference on Software Testing, Verification and Validation (ICST), 2013, pp. 352–361. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. R. Santelices, P. K. Chittimalli, T. Apiwattanapong, A. Orso, and M. J. Harrold, “Test-suite augmentation for evolving software,” in IEEE/ACM Int. Conference on Automated Software Engineering (ASE), 2008, pp. 218–227. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Z. Xu, Y. Kim, M. Kim, G. Rothermel, and M. B. Cohen, “Directed test suite augmentation: techniques and tradeoffs,” in ACM Symposium on the Foundations of Software Engineering (FSE), 2010, pp. 257–266. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. M. Mirzaaghaei, F. Pastore, and M. Pezze, “Supporting test suite evolution through test case adaptation,” in IEEE Int. Conference on Software Testing, Verification and Validation (ICST), 2012, pp. 231–240. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Automated unit test generation during software development: a controlled experiment and think-aloud observations

    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
      ISSTA 2015: Proceedings of the 2015 International Symposium on Software Testing and Analysis
      July 2015
      447 pages
      ISBN:9781450336208
      DOI:10.1145/2771783
      • General Chair:
      • Michal Young,
      • Program Chair:
      • Tao Xie

      Copyright © 2015 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 the author(s) 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: 13 July 2015

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate58of213submissions,27%

      Upcoming Conference

      ISSTA '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader