skip to main content
10.1145/1321631.1321722acmconferencesArticle/Chapter ViewAbstractPublication PagesaseConference Proceedingsconference-collections
poster

Unit testing concurrent software

Published:05 November 2007Publication History

ABSTRACT

There are many difficulties associated with developing correct multithreaded software, and many of the activities that are simple for single threaded software are exceptionally hard for multithreaded software. One such example is constructing unit tests involving multiple threads. Given, for example, a blocking queue implementation, writing a test case to show that it blocks and unblocks appropriately using existing testing frameworks is exceptionally hard. In this paper, we describe the MultithreadedTC framework which allows the construction of deterministic and repeatable unit tests for concurrent abstractions. This framework is not designed to test for synchronization errors that lead to rare probabilistic faults under concurrent stress. Rather, this framework allows us to demonstrate that code does provide specific concurrent functionality (e.g., a thread attempting to acquire a lock is blocked if another thread has the lock).

We describe the framework and provide empirical comparisons against hand-coded tests designed for Sun's Java concurrency utilities library and against previous frameworks that addressed this same issue. The source code for this framework is available under an open source license.

References

  1. Jsr 166: Concurrency utilities. http://www.jcp.org/en/jsr/detail?id=166, 2004.Google ScholarGoogle Scholar
  2. Junit testing framework. http://www.junit.org, 2007.Google ScholarGoogle Scholar
  3. Multithreadedtc. http://code.google.com/p/multithreadedtc/, 2007.Google ScholarGoogle Scholar
  4. Swat4j. http://www.codeswat.com, 2007.Google ScholarGoogle Scholar
  5. M. Albrecht. Using multi-threaded tests. http://groboutils.sourceforge.net/testingjunit/ using mtt.html, September 2004.Google ScholarGoogle Scholar
  6. C. Beust and A. Popescu. Testng: Testing, the next generation. http://www.testng.org, 2007.Google ScholarGoogle Scholar
  7. R. H. Carver and K.-C. Tai. Replay and testing for concurrent programs. IEEE Softw., 8(2):66--74, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J.-D. Choi and H. Srinivasan. Deterministic replay of java multithreaded applications. In SPDT '98: Proceedings of the SIGMETRICS symposium on Parallel and distributed tools, pages 48--59, New York, NY, USA, 1998. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. O. Edelstein, E. Farchi, Y. Nir, G. Ratsaby, and S. Ur. Multithreaded java program test generation. IBM Systems Journal, 41(1):111--125, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. P. B. Hansen. Reproducible testing of monitor. Softw., Pract. Exper., 8(6):721--729, 1978.Google ScholarGoogle ScholarCross RefCross Ref
  11. B. Long. Testing Concurrent Java Components. PhD thesis, The University of Queensland, July 2005.Google ScholarGoogle Scholar
  12. B. Long, D. Hoffman, and P. Strooper. Tool support for testing concurrent java components. IEEE Transactions on Software Engineering, 29(6), 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. L. Wildman, B. Long, and P. A. Strooper. Testing java interrupts and timed waits. In APSEC, pages 438--447, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Unit testing concurrent software

    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
      ASE '07: Proceedings of the 22nd IEEE/ACM International Conference on Automated Software Engineering
      November 2007
      590 pages
      ISBN:9781595938824
      DOI:10.1145/1321631

      Copyright © 2007 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: 5 November 2007

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • poster

      Acceptance Rates

      Overall Acceptance Rate82of337submissions,24%

      Upcoming Conference

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader