skip to main content
10.1145/3611643.3613865acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article
Open Access

Rotten Green Tests in Google Test

Published:30 November 2023Publication History

ABSTRACT

Executable unit tests are a key component of many software engineering methodologies. A “green” test is one that is reported as passing (successfully testing some software feature). However, it is common for a test harness to assume that a test has passed when, in fact, it has merely not reported a failure. In this gap, where the “excluded middle” lives and thrives, we find the Rotten Green Test: A test that looks like it does something useful, but in fact does not.

Google Test, a popular open-source test framework for C++ software, has been enhanced to detect rotten green tests. This enhancement follows the lead of similar work done for the Pharo language, but in a framework more applicable in industry, and with no requirement for test modifications or an external tool. The enhanced Google Test has detected 183 rotten assertions in the LLVM project’s unit tests, and even found one in Google Test’s own internal test suite. The enhancement may report false positives from parameterized tests where assertions are conditioned on the parameter, and currently does not detect rotten assertions in helper methods.

References

  1. G. Mezaros, S. M. Smith and J. Andrea, "The test automation manifesto," in Proceedings of the Third XP and Second Agile Universe Conference, 2003. Google ScholarGoogle Scholar
  2. D. Astels, Test-Driven Development--A Practical Guide, Prentice-Hall, 2003. Google ScholarGoogle Scholar
  3. J. Delplanque, S. Ducasse, G. Polito, A. P. Black and A. Etien, "Rotten Green Tests," in IEEE/ACM 41st International Conference on Software Engineering, Montréal, Québec, Canada, 2019. Google ScholarGoogle Scholar
  4. A. P. Black, S. Ducasse, O. Nierstrasz, D. Pollet, D. Cassou and M. Denker, Pharo by Example, Kehrsatz, Switzerland: Square Bracket Associates, 2009. Google ScholarGoogle Scholar
  5. Google, "GoogleTest ," 2023. https://github.com/google/googletest. Google ScholarGoogle Scholar
  6. The LLVM Project, "Clang: a C language family frontend for LLVM," 2023. [Online]. Available: https://clang.llvm.org. Google ScholarGoogle Scholar
  7. The LLVM Project, "The LLVM Compiler Infrastructure," 2023. [Online]. Available: https://llvm.org. Google ScholarGoogle Scholar
  8. Google, "Bazel," https://bazel.build/. Google ScholarGoogle Scholar

Index Terms

  1. Rotten Green Tests in Google Test

    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 2023: Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering
      November 2023
      2215 pages
      ISBN:9798400703270
      DOI:10.1145/3611643

      Copyright © 2023 Owner/Author

      This work is licensed under a Creative Commons Attribution 4.0 International License.

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 30 November 2023

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate112of543submissions,21%
    • Article Metrics

      • Downloads (Last 12 months)71
      • Downloads (Last 6 weeks)10

      Other Metrics

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader