A Framework for Testing Concurrent Programs

http://www.cs.rice.edu/~mgricken/research/concutest/intro.shtml


Incremental, test-driven development is sweeping the software industry, supplanting more monolithic approaches to software development. Test-driven approaches to software development like Extreme Programming elevate testing from an ancillary activity to an integral part of the programming process. Tests for a program unit are written before the code, driving the design of the program and catching bugs early in its development. These tests form an integral part of the program code base, facilitating program reliability, continual integration, and refactoring.

In our recent experience developing production programs in Java, unit testing has proven effective in assuring the reliability of code with a single thread of control. Open source testing frameworks like JUnit work well in this context. Unfortunately, we have found unit testing is much less effective at assuring the reliabilty of code with multiple threads of control, often simply because the the testing framework silently ignores failures in auxiliary threads. Since thread scheduling is non-deterministic, a unit test can succeed on one run and fail on the next. Moreover, the scheduling characteristics of the test platform can skew test results, hiding synchronization bugs until the program is run on a different platform.

Java libraries and user programs furthermore frequently make assumptions about the threading context in which they execute, but these assumptions are rarely enforced by the actual code and typically only appear in program documentation or white papers, if at all.

To make development of concurrent programs easier, we are developing:

  1. ConcJUnit: An extension of the JUnit framework, actively supporting the developer by treating tests that could silently ignore failures in auxiliary threads as test errors;
  2. Thread Checker: A lightweight annotation language, which can be used to specify and check the threading invariants of both existing and new code;
  3. Schedule-Based Execution: A testing framework that can execute unit tests according to a specified set of recorded or generated schedules, elevating the unit testing of concurrent programs to a rigorous, deterministic process.

There is more information available about the components on their respective pages:


Supplemental material



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章