views:

107

answers:

2

Is there an existing tool for Java that is similar to Microsoft's CHESS? Or is the CHESS source code open, so that I might try to convert it into Java?

+3  A: 

If you just want to check your java program, have you considered doing it the other way around: convert java to managed code (http://www.ikvm.net/), and run it with chess?

There are quite a few static analysis tools for java, for example findbugs, that can help you find concurrency problems based on looking at your source code, but I haven't seen anything that would actually attempt to run an application.

ankon
+1: An interesting idea. IKVM is an (early) implementation of a JVM and the Java class libraries on .NET.
Jim Ferrans
That's interesting; thanks for the suggestion. But is the Java memory model similar to that of .NET's? I'm worried that running Java code on .NET may cause different issues to emerge...
Hosam Aly
Hosam: Most Java code probably doesn't rely on the exact memory model specifics to run correctly. So I think it's unlikely that your tests fail on those things. Remember that the memory model is to a large part an implementation detail, even for Java (though many things are specified, indeed, but normal programs rarely need to rely on that).
Joey
+3  A: 

Google's Thread Weaver provides a somewhat similar capability for Java. From the Thread Weaver project page:

Thread Weaver is a framework for writing multi-threaded unit tests in Java.

It provides mechanisms for creating breakpoints within your code, and for halting execution of a thread when a breakpoint is reached. Other threads can then run while the first thread is blocked. This allows you to write repeatable tests that can check for race conditions and thread safety.

antrix
I didn't know about it. I guess CHESS is more comprehensive, but thanks for the information!
Hosam Aly