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.
- Jsr 166: Concurrency utilities. http://www.jcp.org/en/jsr/detail?id=166, 2004.Google Scholar
- Junit testing framework. http://www.junit.org, 2007.Google Scholar
- Multithreadedtc. http://code.google.com/p/multithreadedtc/, 2007.Google Scholar
- Swat4j. http://www.codeswat.com, 2007.Google Scholar
- M. Albrecht. Using multi-threaded tests. http://groboutils.sourceforge.net/testingjunit/ using mtt.html, September 2004.Google Scholar
- C. Beust and A. Popescu. Testng: Testing, the next generation. http://www.testng.org, 2007.Google Scholar
- R. H. Carver and K.-C. Tai. Replay and testing for concurrent programs. IEEE Softw., 8(2):66--74, 1991. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- P. B. Hansen. Reproducible testing of monitor. Softw., Pract. Exper., 8(6):721--729, 1978.Google ScholarCross Ref
- B. Long. Testing Concurrent Java Components. PhD thesis, The University of Queensland, July 2005.Google Scholar
- B. Long, D. Hoffman, and P. Strooper. Tool support for testing concurrent java components. IEEE Transactions on Software Engineering, 29(6), 2003. Google ScholarDigital Library
- L. Wildman, B. Long, and P. A. Strooper. Testing java interrupts and timed waits. In APSEC, pages 438--447, 2004. Google ScholarDigital Library
Index Terms
- Unit testing concurrent software
Recommendations
Unit testing for concurrent business code
PADTAD '10: Proceedings of the 8th Workshop on Parallel and Distributed Systems: Testing, Analysis, and DebuggingPerforming unit testing on concurrent programs is a known challenge. Several solutions have been proposed for the challenges, that provide only a partial answer. We argue that there are two kinds of concurrent code writing, namely concurrency protocols ...
Coverage Based Testing for Concurrent Software
ICDCSW '08: Proceedings of the 2008 The 28th International Conference on Distributed Computing Systems WorkshopsConcurrent programming is playing key roles for improving software performance since multi-core processors are used on various computing system. However, there may be not standard methodology for testing concurrent program. Especially, it would be ...
Accurate and efficient runtime detection of atomicity errors in concurrent programs
PPoPP '06: Proceedings of the eleventh ACM SIGPLAN symposium on Principles and practice of parallel programmingAtomicity is an important correctness condition for concurrent systems. Informally, atomicity is the property that every concurrent execution of a set of transactions is equivalent to some serial execution of the same transactions. In multi-threaded ...
Comments