Abstracting the blogosphere

Abpost .n. Abstract of a post

Testing Concurrent Programs

Posted by suntzu on October 5, 2006

In a recent article titled “Testing Concurrent Programs, Brian Goetz writes about testing concurrent code and explains why it is not for faint of hearts. The first step toward testing the behavior of concurrent programs is to isolate concurrency to well-defined portions of the code, such as into workflow managers, resource pools, or work queues.

Enforcing thread-safety of objects inside those concurrent constructs is the responsibility of the application. The best way to achieve thread safety of objects interacting with concurrent program elements is to make those objects immutable. If an immutable object interface is not feasible, Goetz suggests making such objects effectively immutable:

Goetz also makes a few suggestions for testing classes whose states are modified by concurrent threads. The most interesting suggestion is to take into account the probabilistic nature of concurrent errors in testing

A good post.  Must read


Sorry, the comment form is closed at this time.

%d bloggers like this: