Archive for the 'Concurrent Unit Testing' Category

Short, Non-Technical Talks Are Hard

February 25th, 2010, 6:43 pm by Mathias

I just gave my talk Testing Concurrent Programs, A 7-Minute Jargon-Free Introduction to the students of the Thesis Writing Seminar of the School of Engineering here at Rice. It went very well, but I’ve got to say that this was probably the most difficult talk I’ve had to prepare.

It is a 7-minute talk to an [...]

Print This Print This   Email This Email This

<clinit> in The Thread of First Use

February 16th, 2010, 11:21 pm by Mathias

Question: In which thread does <clinit> run?

Answer: <clinit> is being executed in whatever thread uses the class first.

123456789101112131415161718192021222324252627282930313233343536package testers;

import java.awt.EventQueue;

public class CLInit {     public static void main(String[] args) throws Exception {         new CLInit2().doSomething();         EventQueue.invokeAndWait(new Runnable() {             public void run() {         [...]

Print This Print This   Email This Email This

<clinit> in Which Thread?

February 16th, 2010, 1:58 am by Mathias

Question: In which thread does <clinit> run?

Answer tomorrow.

Print This Print This   Email This Email This

The Free Java Book

February 15th, 2010, 1:32 pm by Mathias

Corky just informed me that there is a talk by Daniel L. Schuster at SIGCSE 2010 about Java, games, and the Free Java Book. I’ll definitely check out the talk and the book. I’ll also examine how concurrency is handled in the ACM Java Library.

Daniel is kind enough to state the following in his book:

Dr. [...]

Print This Print This   Email This Email This

Java Bug 4396719 Work-Around?

January 31st, 2010, 12:00 pm by Mathias

It seems like I can get around the garbage collector bug if I use -XX:+UseConcMarkSweepGC JVM argument.

Now I’m having more Soot problems, but they actually make sense. In addition to being cross-platform, DrJava is also “cross-JDK version”: We support JDK versions 5 and 6 and OpenJDK version 6. In the past, we also supported JDK [...]

Print This Print This   Email This Email This

Soot Build Instructions

January 30th, 2010, 7:39 pm by Mathias

While trying to create a call graph of DrJava using Soot, I ran into some problems that were supposed to have been fixed in the Soot nightly builds already. Unfortunately, the nightly builds I could find were all many months old. So I built Soot from scratch from the Subversion repository, which wasn’t an easy [...]

Print This Print This   Email This Email This

A HotSpot Java Error, a Bus Error and a Segmentation Fault

January 30th, 2010, 3:10 pm by Mathias

When I run Soot to create a call graph of DrJava, I get the aforementioned HotSpot Java error on Windows with Java 1.6.0_18.

On Mac OS X 10.4 with Java 1.5.0_19, I get a “Bus error” (Java exit status 138). On Red Hat Enterprise Linux 5 with Java 1.6.0_18, I get a “Segmentation fault” (Java exit status [...]

Print This Print This   Email This Email This

More Details on Soot and -allow-phantom-refs

January 29th, 2010, 11:24 am by Mathias

In the previous post I mentioned that I’m trying to create a call graph of all of DrJava using Soot. Since DrJava is a cross-platform application, there are classes that get compiled and used only on certain operating systems. The classes in the com.apple.eawt package, for instance, are only used on the Mac.

That means that [...]

Print This Print This   Email This Email This

Java Bug 4396719 – Mark Sweep stack overflow on deeply nested Object arrays

January 29th, 2010, 6:39 am by Mathias

I’m trying to create a call graph of all of DrJava using Soot. DrJava is a cross-platform application that has some classes that get compiled and used only on certain operating systems; for example, the com.apple.eawt package is only used on the Mac. That means that Soot doesn’t normally find these classes when generating the [...]

Print This Print This   Email This Email This

Another Possible Improvement

January 12th, 2010, 5:04 pm by Mathias

On the other hand, I think I can re-enable checking if the event thread has finished and generating EventThreadStillProcessingErrors in the “update” Runnable that sets the test thread group the event thread uses, at least in certain cases.

It is possible that test A has generated the EventThreadStillProcessingError by putting a long Runnable aRunnable on the [...]

Print This Print This   Email This Email This

Another Possible Problem

January 12th, 2010, 4:29 pm by Mathias

I think I have just realized that this still isn’t good enough. Now we know that there aren’t any more events, but it is conceivable that a Runnable executing just before the token Runnable has started new threads. Those threads could fail, or add new “token” Runnables. It seems like the whole thing needs to [...]

Print This Print This   Email This Email This

New Release of ConcJUnit: 20100112

January 12th, 2010, 4:28 pm by Mathias

I’ve just made a new release of ConcJUnit: 20100112. This release contains an important addition that I had been thinking about for a while.

ConcJUnit already detected failures and uncaught exceptions in the event thread, but since the event thread is a daemon thread started by the system, it is not part of the “join” and [...]

Print This Print This   Email This Email This

Submitted Publication Version of SIGCSE 2010 Paper

December 4th, 2009, 5:10 pm by Mathias

I just submitted the publication version of our SIGCSE 2010 paper, Test-First Java Concurrency for the Classroom.

Now I’m waiting for the copyright form to be sent, and I’m wondering why that’s not done automatically…

Print This Print This   Email This Email This

Another Sample Bug for Yield

December 2nd, 2009, 5:34 pm by Mathias

I coded up two more examples to test the yield strategy. The “split synchronized” example doesn’t work that well (yet), because it fails even without the added yields. I’m looking for common bugs that aren’t obvious.

123456789101112131415        Thread remover = new Thread() {             public void run() {     [...]

Print This Print This   Email This Email This

Getting Back on That Concurrency Horse

December 2nd, 2009, 12:16 pm by Mathias

After a lot of work on Mint, I’m now focusing on the concurrent unit testing project again. I had to fight some apparent code rot, which was probably caused by changes from Java 5 to Java 6, but now everything is working again.

I have a nice example that shows that double-checked locking is broken. With [...]

Print This Print This   Email This Email This

Paper: Test-First Java Concurrency for the Classroom

October 24th, 2009, 3:47 pm by Mathias

Test-First Java Concurrency for the Classroom

41st Technical Symposium on Computer Science Education (SIGCSE 2010)

Concurrent programming is becoming more important due to the growing dominance of multi-core processors and the prevalence of graphical user interfaces (GUIs). To prepare students for the concurrent future, instructors have begun to address concurrency earlier in their curricula. Unfortunately, test-driven development, [...]

Print This Print This   Email This Email This

SIGCSE Paper Accepted!

October 24th, 2009, 1:56 pm by Mathias

The paper that I submitted to SIGCSE a month and a half ago, “Test-First Java Concurrency for the Classroom”, got accepted!

That means I’m going to Milwaukee in March.

Update:

I just realized that if my other paper currently under review also gets accepted, it will get a little stressful:

March 9-12, 2010: CSEE&T in Pittsburgh March 10-13, 2010: SIGCSE [...]

Print This Print This   Email This Email This

Today’s Loose Ends

October 20th, 2009, 12:02 am by Mathias

I’m in the process of wrapping up today’syesterday’s loose ends:

I made a new ConcJUnit release, 20091019, containing the files for versions 3.8.2 and 4.7, as described at the end of the last post. There is a new version of DrJava with Mint, DrJava-r5121-Mint-r14186. It is too big to [...]

Print This Print This   Email This Email This

Two Confusing Errors

October 19th, 2009, 3:43 pm by Mathias

A while ago, I was told by our one-and-only client of Mint that the version of DrJava with Mint does not display Mint as a compiler, even though it is included in the jar file and therefore should be available. I couldn’t reproduce this, so I set it aside for a while.

Yesterday I realized that [...]

Print This Print This   Email This Email This

AWT Exception Handler Cannot Be Reset After Exception

October 15th, 2009, 3:00 pm by Mathias

When testing ConcJUnit some more from inside DrJava, I noticed some weird behavior. I had a JUnit 3.8.2 version of a test, and an equivalent JUnit 4 version. Run independently, they behaved as expected (which in my line of work usually means the tests failed), but if I ran them in sequence, then the second [...]

Print This Print This   Email This Email This