skip to main content
10.1145/2786805.2786858acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Assertions are strongly correlated with test suite effectiveness

Published:30 August 2015Publication History

ABSTRACT

Code coverage is a popular test adequacy criterion in practice. Code coverage, however, remains controversial as there is a lack of coherent empirical evidence for its relation with test suite effectiveness. More recently, test suite size has been shown to be highly correlated with effectiveness. However, previous studies treat test methods as the smallest unit of interest, and ignore potential factors influencing this relationship. We propose to go beyond test suite size, by investigating test assertions inside test methods. We empirically evaluate the relationship between a test suite’s effectiveness and the (1) number of assertions, (2) assertion coverage, and (3) different types of assertions. We compose 6,700 test suites in total, using 24,000 assertions of five real-world Java projects. We find that the number of assertions in a test suite strongly correlates with its effectiveness, and this factor directly influences the relationship between test suite size and effectiveness. Our results also indicate that assertion coverage is strongly correlated with effectiveness and different types of assertions can influence the effectiveness of their containing test suites.

References

  1. Apache commons lang. http://commons.apache.org/proper/commons-lang/.Google ScholarGoogle Scholar
  2. Asterisk-java. https://blogs.reucon.com/asterisk-java/.Google ScholarGoogle Scholar
  3. Clover. https: //www.atlassian.com/software/clover/overview/.Google ScholarGoogle Scholar
  4. JavaParser. https://code.google.com/p/javaparser/.Google ScholarGoogle Scholar
  5. JavaSlicer. https://www.st.cs.uni-saarland.de/javaslicer/.Google ScholarGoogle Scholar
  6. JFreeChart. http://www.jfree.org/jfreechart/.Google ScholarGoogle Scholar
  7. Lambdaj. https://code.google.com/p/lambdaj/.Google ScholarGoogle Scholar
  8. Pit. http://pitest.org.Google ScholarGoogle Scholar
  9. SLOCCount. http://www.dwheeler.com/sloccount/.Google ScholarGoogle Scholar
  10. Urban airship java library. http://docs. urbanairship.com/reference/libraries/java/.Google ScholarGoogle Scholar
  11. J. H. Andrews, L. C. Briand, and Y. Labiche. Is mutation an appropriate tool for testing experiments? In Proceedings of the International Conference on Software Engineering, ICSE, pages 402–411. ACM, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. H. Andrews, L. C. Briand, Y. Labiche, and A. S. Namin. Using mutation analysis for assessing and comparing testing coverage criteria. IEEE Trans. Softw. Eng., 32:608–624, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. L. Briand and D. Pfahl. Using simulation for assessing the real impact of test coverage on defect coverage. In Proceedings of the International Symposium on Software Reliability Engineering, ISSRE, pages 148–157. IEEE Computer Society, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. X. Cai and M. R. Lyu. The effect of code coverage on fault detection under different testing profiles. In Proceedings of the International Workshop on Advances in Model-based Testing, A-MOST, pages 1–7. ACM, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Daran and P. Thévenod-Fosse. Software error analysis: A real case study involving real faults and mutations. In Proceedings of the ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA, pages 158–171. ACM, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. P. G. Frankl and O. Iakounenko. Further empirical studies of test effectiveness. In Proceedings of the 6th ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE, pages 153–162. ACM, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. P. G. Frankl and S. N. Weiss. An experimental comparison of the effectiveness of the all-uses and all-edges adequacy criteria. In Proceedings of the Symposium on Testing, Analysis, and Verification, TAV4, pages 154–164. ACM, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. P. G. Frankl and S. N. Weiss. An experimental comparison of the effectiveness of branch testing and data flow testing. IEEE Trans. Softw. Eng., 19:774–787, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. R. Gopinath, C. Jensen, and A. Groce. Code coverage for suite evaluation by developers. In Proceedings of the International Conference on Software Engineering, ICSE, pages 72–82. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. L. Inozemtseva and R. Holmes. Coverage is not strongly correlated with test suite effectiveness. In Proceedings of the International Conference on Software Engineering, ICSE, pages 435–445. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. R. Just, D. Jalali, L. Inozemtseva, M. D. Ernst, R. Holmes, and G. Fraser. Are mutants a valid substitute for real faults in software testing? In Proceedings of the ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE, pages 654–665. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. A. S. Namin and J. H. Andrews. The influence of size and coverage on test suite effectiveness. In Proceedings of the International Symposium on Software Testing and Analysis, ISSTA, pages 57–68. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. C. Pacheco, S. K. Lahiri, M. D. Ernst, and T. Ball. Feedback-directed random test generation. In Proceedings of the International Conference on Software Engineering (ICSE), pages 75–84. IEEE Computer Society, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. D. Schuler and A. Zeller. Assessing oracle quality with checked coverage. In Proceedings of the International Conference on Software Testing, Verification and Validation, ICST, pages 90–99. IEEE Computer Society, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Assertions are strongly correlated with test suite effectiveness

      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
        ESEC/FSE 2015: Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering
        August 2015
        1068 pages
        ISBN:9781450336758
        DOI:10.1145/2786805

        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: 30 August 2015

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate112of543submissions,21%

        Upcoming Conference

        FSE '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader