Mint and DrJava Class Loader Issues

I’m still trying to integrate Mint into DrJava, and I’m running into a problem with the class loaders in Mint and DrJava.

If I understand the class loader inside the Interaction JVM correctly (a PathClassLoader, I believe), it can change the class path dynamically, and that way it can find classes with different source roots. Once a program runs, though, the program uses the normal system
class loader, which doesn’t necessarily have the same class path as the Interaction JVM class loader.

Now I need to find a way to access the Interaction JVM class loader, so I can set it as parent for Mint’s class loader, or I need to find a way to approximate this.

Share
Posted in DrJava, Mint | Leave a comment

Print This Post Print This Post  

DrJava with Mint Compiles on Windows, Mac and Linux

The DrJava built from my trunk-mint branch now manages to compile Mint programs on all three major operating systems: Windows, Mac and Linux.

I had to make a bugfix in the Mint compiler (I will make a new release soon), and I don’t quite know why we never ran into this. Perhaps the Sun JDK implements the compiler in a slightly different way than OpenJDK or Apple? We forgot to make the bracket statement case a no-op in the TreeScanner, and that caused an assertion, but only on Windows. I’m convinced, though, that this fix is correct, so I’m making it without investigating this difference further.

DrJava still cannot run Mint programs, but that shouldn’t be too difficult.

Update

The new release of the Mint compiler is available now: JavaMint-r14089 (with source).

The changes are minimal and only matter inside of DrJava or when used on the Linux command line.

Share
Posted in DrJava, Mint | Leave a comment

Print This Post Print This Post  

DrJava with Mint on Mac “Cosmetically” Closer

Sweet! DrJava with Mint on the Mac just came within reach, or at least as close as it is on the other operating systems. For some reason, when I ran DrJava under Soylatte and X11 earlier, no compilers showed up. I thought there were some more serious problems with running DrJava in that environment, but it was something quite trivial.

In revision 5078, I reverted a “cosmetic change” of x+y to x + y that had been done using a global search-and-replace. Unfortunately, the change was also done inside string constants, and thus regular expressions. And the regular expression \\d+ is not the same as \\d + .

Interestingly, the change doesn’t show up in SourceForge’s diff or my default svn diff (svn diff --diff-cmd diff -x -uw /path/to/file) because it’s whitespace only.

This is an example why I really despise cosmetic changes.

Share
Posted in DrJava, Mint, Ramblings | Leave a comment

Print This Post Print This Post  

Mint in DrJava is Tricky

I’ve been trying to get the Mint compiler to work inside DrJava. This has turned out to be more tricky than I thought.

The preempting class loader that we use to load different compiler adapters is still giving me headaches, and the fact that the “Mint SDK” is only a partial JDK (really only a replacement for the tools.jar file) means that I can’t use the same mechanism that is used to load a Java compiler to make the Mint compiler accessible. Instead, the Mint compiler needs to find Mint and a matching JDK… What exactly matches? Oh, I don’t really know right now.

Additionally, on the Mac Mint requires SoyLatte. We haven’t tested it with Apple’s implementation of Java 6 yet. Running DrJava with SoyLatte means running it in an X11 environment, and that means more headaches…

And all of this would only get us to compile Mint programs in the Definitions Pane. In the Interactions Pane, we would still only have Java. I’ve worked on this for a week and a half now, and I’m still far from being marginally successful. I think I should be able to get the Definitions Pane to work on Windows and Linux. But is that worth it?

Share
Posted in DrJava, Mint, Ramblings | Leave a comment

Print This Post Print This Post  

Updated CV and Resume

After attending an excellent workshop on converting CVs to resumes by the Rice Center for Student Professional Development, worked on improving my resume a bit.

First of all, I created two versions, a shorter resume (pdf) and a longer, complete curriculum vitae (pdf).

In the CV, I have included more information on my publications. Both documents still need work, but I’ll have a chance to improve them at future CSPD events.

I also changed the embedded PDF viewer from pdfmenot.com to the Google Document Viewer.

Share
Posted in Uncategorized | Leave a comment

Print This Post Print This Post  

Legal immigrants battle red tape

I noticed that the Houston Chronicle article I was interviewed for isn’t available on the Chronicle website anymore, so I wanted to re-post it on my blog.

From the Houston Chronicle, Jan. 9, 2009:

Legal immigrants battle red tape

Pakistan native Adeel Mehmood started building a life in Houston after the U.S. government granted him asylum more than two years ago.

He graduated from the University of Houston, settled into a home in Garden Oaks and saved money from his restaurant job to buy his dream car: a new Toyota Camry.

The 25-year-old still faithfully makes payments on the Camry — and on his insurance — even though the state of Texas in December denied his application to renew his driver’s license, citing a new policy that took effect Oct. 1 requiring specific documentation to prove an applicant’s legal immigration status.

Three months after the policy took effect, critics are pointing to a growing list of cases involving legal immigrants who have been significantly delayed or outright rejected in their efforts to get or renew licenses, despite being authorized to live and work legally in the U.S.

“I have always maintained my legal status,” Mehmood said. “It’s not fair to people who want to live here and follow the law.”

Under the policy change, only applicants who have documents showing they have permission to stay in the U.S. for at least six months are eligible for Texas driver’s licenses.

But immigration attorneys are reporting that people who meet that criterion — but are unable to produce documents required by the DPS to prove their legal status — are still being turned away.

For example, Mehmood said he was rejected by the DPS after being told his letter from U.S. Citizenship and Immigration Services granting him asylum wasn’t specifically listed on DPS’s list of acceptable forms.

The Texas chapter of the American Immigration Lawyers Association is pushing for revisions to the policy, adopted by the Texas Public Safety Commission in August, saying the list of acceptable DPS documents needs to be expanded to include several forms of legal status that allow for a six-month stay or longer in the U.S. They also are pushing the state to make allowances for delays in processing times sometimes caused by USCIS.

“This is going to end up impacting lots and lots of people,” said John Nechman, a Houston immigration attorney. “Every day there seems to be another example.”

Designed to curb fraud

Supporters of the new policy, including Gov. Rick Perry, said the state is safer because of the more stringent document checks, which are designed to stop illegal immigrants from getting licenses and to combat fraud and identity theft. The agency has issued more than 15,000 “visitor” licenses to immigrants statewide since October, said Tela Mange, a DPS spokeswoman.

Allan Polunsky, chairman of the Public Safety Commission, which oversees the DPS, said the policy change was not intended to deny legal immigrants the opportunity to drive.

“If there is a problem in the process, then it should and will be addressed,” Polunsky said. “We have to look at all the facts before we make any changes, but certainly we want to be fair.”

D. Jackson Chaney, an immigration attorney in Irving, said the DPS did not consult any immigration lawyers or experts when it put together the rule and left out several forms of legal status that allow immigrants to stay in the country beyond six months. The list includes refugees as well as some immigrants who were granted green cards before those documents had expiration dates.

“They’re being denied licenses on ridiculous grounds, frankly, because DPS simply does not know immigration law,” Chaney said. “It’s really a mess.”

Drivers License

Paperwork delay

In some cases, even though driver’s license applicants have immigration documents that appear to expire within six months, they may still have legal status from USCIS as long as they have a pending application for an extension, attorneys said. But it can sometimes take immigration officials six to 12 months or longer to process the paperwork, leaving applicants unable to drive legally for months at a time.

Mathias Ricken, a doctoral candidate and computer science instructor at Rice University, made four trips to the DPS office in November and December to get his temporary driver’s license approved.

Ricken, who is in the U.S. on a student visa from Germany, called ahead on Nov. 19 to find out what documents he needed, but each time he went to the office, he was asked for more. He eventually got approved for the license after presenting documents including: his Texas ID card, his German passport, three different immigration forms, a Social Security card, a certificate of enrollment, a tuition receipt and a signed and stamped letter from the director of Rice’s Office of International Students and Scholars.

The letter was not required, but Ricken thought it might help. “I think it’s right to require that you identify yourself in the proper way and show that you are in the country legally,” he said. “The problem is more in the details.”

Unusual case

The problem has turned into more than a nuisance for Mehmood.

His driver’s license expired in November. Mehmood has made multiple visits to DPS offices since then, each time carrying a thick three-ring binder of immigration documents and his work authorization.

Mehmood said he was told that his letter granting asylum and other immigration documents were not sufficient proof of his legal status. He also was told he was ineligible because his “I-94,” a standard U.S. customs form for foreigners, had no expiration date, which is common for asylees, who are allowed to stay in the U.S. indefinitely.

Mange, the DPS spokeswoman, said she would look into Mehmood’s case.

Note: I am a legal non-resident alien, not an immigrant.

Share
Posted in Pictures, Uncategorized | Leave a comment

Print This Post Print This Post  

I Am (4*weakly+strongly)/5 Optimistic

The POPL 2010 reviews of our Mint paper are in. We got four reviews of “weak paper, but I will not fight against it” and one review of “strong paper, I will champion it at the program committee meeting”.

We now have another day to submit minimal comments that address some misunderstandings. A lot of the comments are really useful, so thank you for your feedback, reviewers!

Share
Posted in Mint | Leave a comment

Print This Post Print This Post  

New Mint Benchmarks: Overhead of Boxing/Unboxing

I was working on the next tutorial for the Java Mint Blog, and in writing some new small programs realized that boxing and unboxing has a pretty large impact. It is much better to use primitive types. That also implies that we can’t use generics for the staged function.

This generic ILambda with R=Double, P=Double has bad performance:

Code> codePowerOf17 =
<| new ILambda() {
public Double apply(Double param) {
return `(spower(<|param|>,17));
}
} |>;
ILambda stagedPowerOf17 = codePowerOf17.run();

This non-generic ILambda_double_double where return type and parameter type are fixed to primitive double is much better:

Code primCodePowerOf17 =
<| new ILambda_double_double() { public double apply(double param) { return `(spower(<|param|>,17));
}
} |>;

% mint BoxingUnboxingExpense
power(2, 17)
       10818348
stagedPowerOf17.apply(2.0)
       10452177
primStagedPowerOf17.apply(2.0)
       43746

This is for 200 million iterations. With boxing/unboxing overhead, the staged function barely breaks even.

I rewrote the benchmarking code to put less emphasis on the boxing/unboxing and re-ran our benchmarks. A lot of them stayed the same, but some power and fib_let gained another factor of two!

power                   9.066x (up from 4.552)
fib_let                 8.834x (up from 4.107)
eval-fact               10.384x (up from 8.390)
loop-unroll             1.580x (slightly up from 1.439)
power_let               5.703x (about same)
partial-loop-unroll     0.965x (about same, 0.942x)
serialize               18.433x (about same)
mmult                   0.913x (slightly down from 1.180)
mmult-sparse            1.134x (slightly down from 1.469)
eval-fib                9.911x (slightly down 10.210)
Share
Posted in Mint | Leave a comment

Print This Post Print This Post  

Higher Order Functions in Java

In order to understand future examples, we first have to discuss how to use higher-order functions in Java, and how to write anonymous inner classes. This post will have nothing to do with multi-stage programming.

Let’s write a program that can print out data tables for different mathematical functions. For example, for a function that multiplies by two, f(x) = 2x, we want to print something like this:

x                      f(x)
       -5.0000000000       -10.0000000000
       -4.0000000000        -8.0000000000
       -3.0000000000        -6.0000000000
       -2.0000000000        -4.0000000000
       -1.0000000000        -2.0000000000
        0.0000000000         0.0000000000
        1.0000000000         2.0000000000
        2.0000000000         4.0000000000
        3.0000000000         6.0000000000
        4.0000000000         8.0000000000
        5.0000000000        10.0000000000

We can write a function like this:

public static void printTableTimesTwo(double x1,
double x2,
int n) {
assert n>1;

double x = x1;
double delta = (x2-x1)/(double)(n-1);
System.out.println("x f(x)");
System.out.printf("%20.10f %20.10f\n", x, x*2);
for(int i=0; i<(n-1); ++i) { x += delta; System.out.printf("%20.10f %20.10f\n", x, x*2); } }

The parameter x1 determines the lower end of the interval, x2 the upper end, and n determines how many values should be printed. n needs to be at least 2 to print out the values at x1 and x2. We can generate the table above with this call:

printTableTimesTwo(-5, 5, 11);

What if we want to print out the values of a different function, for example f(x) = x + 4? We can write a new function:

public static void printTablePlusFour(double x1,
double x2,
int n) {
assert n>1;

double x = x1;
double delta = (x2-x1)/(double)(n-1);
System.out.println("x f(x)");
System.out.printf("%20.10f %20.10f\n", x, x+4);
for(int i=0; i<(n-1); ++i) { x += delta; System.out.printf("%20.10f %20.10f\n", x, x+4); } }

This involves a lot of code duplication, though. The only parts that actually differ are the two occurrences of x*2 and x+4. How can we factor that difference out?

Let's write an interface that we can use for any kind of function that takes in one parameter and returns one parameter f(x) = y is an example of such a function.

public interface ILambda; {
public R apply(P param);
}

This interface is called ILambda and it has one method, apply. We used Java generics and didn't specify the return type and the type of the parameter; instead, we just called them R and P, respectively. A function that takes in a Double and that returns a Double, like f(x) = y, can be expressed using a ILambda. A function taking a String and returning an Integer would use ILambda.

Now we can write our f(x) = 2x and f(x) = x + 4 functions using ILambda:

public class TimesTwo implements ILambda {
public Double apply(Double param) { return param*2; }
}
public class PlusFour implements ILambda {
public Double apply(Double param) { return param+4; }
}

Now we can write one printTable method that takes in an ILambda called f representing the function, in addition to the parameters x1, x2 and n, as before:

public static void printTable(ILambda f,
double x1,
double x2,
int n) {
assert n>1;

double x = x1;
double delta = (x2-x1)/(double)(n-1);

// f.apply(x) just means what f(x) means in math!
double y = f.apply(x);
System.out.println("x f(x)");
System.out.printf("%20.10f %20.10f\n", x, y);
for(int i=0; i<(n-1); ++i) { x += delta; y = f.apply(x); System.out.printf("%20.10f %20.10f\n", x, y); } }

Note that when we want to print out the y-value, we just write f.apply(x), which looks very similar to f(x) in mathematics. It means exactly the same.

We can print out the tables for our two functions using:

printTable(new TimesTwo(), -5, 5, 11);
printTable(new PlusFour(), -5, 5, 11);

We have to create new objects for the functions: The first time we call printTable we pass a new TimesTwo object; the second time, we pass a new PlusFour object.

We can now define as many functions as we like without having to rewrite the printTable function. For example, we can easily write a square root function and use it very easily:

public class SquareRoot implements ILambda {
public Double apply(Double param) {
return Math.sqrt(param);
}
}

// ...

printTable(new SquareRoot(), -5, 5, 11);

The really neat thing is that we can even define a new function on-the-fly, without having to give it a name. We do that using anonymous inner classes in Java. Here, we call printTable and pass it a new object that implements ILambda.

printTable(new ILambda() {
public Double apply(Double param) {
return param*param;
}
}, -5, 5, 11);

We define a new ILambda from Double to Double without giving it a name. When we use anonymous inner classes, we need to fill in all the methods that are still abstract. Here, it is just the apply method.

The method printTable is now a "higher order function", because conceptually it is a function that takes another function as input.

Questions:

  1. What does the anonymous ILambda in the example above compute? What's the mathematical function it represents?
  2. How would you print a table for the function f(x) = x2 + 2x?

You can download the complete source code for the examples here:

(Re-posted from The Java Mint Blog)

Share
Posted in Mint | Leave a comment

Print This Post Print This Post  

Photos from My COMP 600 Practice Talk

Jennifer Harris was kind enough to video-tape my practice talk and make the recording available to me, and she did so in record time so I could watch myself before I went to Calgary. Thanks, Jennifer!

Here are some frames from the video:

Share
Posted in Concurrent Unit Testing, Graduate School, Pictures | Leave a comment

Print This Post Print This Post  

SIGCSE 2010 Paper Submitted

Now I’ll take a break, then I’ll proof-read it again. Then I’ll take a break, and then I’ll proof-read it again. And then I’ll take a break, and then I’ll proof-read it yet again… ;)

And after that, all I have left to do for this weekend is review some open source projects, integrate Mint into DrJava, and write a bit more on the Mint Blog.

But tomorrow I’ll hit the Houston Museum of Science. It’s Museum District Day!

Share
Posted in Concurrent Unit Testing, DrJava, Mint, Uncategorized | 1 Comment

Print This Post Print This Post  

850,000 Downloads of DrJava

DrJava hit 850,000 downloads today. We should be on track for the big one million by the time I graduate (knock on wood, both for DrJava and for graduating).

Share
Posted in DrJava | Leave a comment

Print This Post Print This Post  

Possible ConcJUnit Enhancement

I’m writing a paper about ConcJUnit, this time with an educational focus, and as usual, writing helps me in systematically covering the problem space. I shouldn’t spend a whole lot of time blogging now, because the paper submission deadline is approaching fast, but I want to make a more-than-just-mental note anyway.

ConcJUnit can emit “lucky” warnings if all child threads terminated before a test ended, but this was not enforced with a join. Daemon threads are exempt from this requirement, because they should shut down by themselves in a real program.

Now, what happens if I refactor my program and change something like this


public void someOperation() {
// ...
fail();
}

public void testFoo() {
new Thread() {
public void run() { someOperation(); }
}.start();
}

which will correctly warn me that the new thread wasn’t joined, into something like this:


public void testFoo() {
EventQueue.invokeLater(new Runnable() {
public void run() { someOperation(); }
});
}

This code puts the task on the event queue, but because the event thread is a daemon thread, ConcJUnit does not warn that the operation may not have had time to fail yet.

Perhaps I can enqueue a “token” event at the end of a test and wait for it to be processed?

Share
Posted in Concurrent Unit Testing | Leave a comment

Print This Post Print This Post  

Power Using a for Loop

Soon it will be possible to compile and run Mint programs in
DrJava. I just haven’t had time to finish this. In the meantime, here is a program that you can analyze. It is another program that calculates the power x^n.

import edu.rice.cs.mint.runtime.Code;

public class Power_For {
public static void main(String[] args) {
final double x = 2;
int n = 17;

Code c = <| 1.0 |>;
for(int i=0; i<n; ++i) {
c = <| `c * x |>;
}

System.out.println(c.run());
}
}

This time it uses a for loop. I don’t know if you have seen for loops, but the part

for(int i=0; i<17; ++i) { /* something here */ }

sets a variable i to 0, and repeats the part /* something here \*/ as long as i<n. Each time the loop is done with /* something here */, it will execute ++i, which will increase i by 1. So eventually i will be 17, and since n is 17, i is not < n anymore, and the loop exits.

We have a Code<Double> c that starts out with the code for 1.0:

Code<Double> c = <| 1.0 |>;

Then we have the aforementioned for loop. The code that gets executed
over and over in the loop body is

c = <| `c * x |>;

We are creating a new code value, and inside the code value, we’re splicing in c (initially 1.0) and multiplying it with x. Then we assign the new code value back to c. That means after the first
iteration of the loop, c will be the following:

<| 1.0 * x |>

After the second iteration, c will be

<| 1.0 * x * x |>

And so on. After the 17th iteration, it will contain the code

<| 1.0 * x * x * x * x * x * x * x * x * x * x * x * x * x
* x * x * x * x |>

When we run c with c.run() and print out the value, we will get 131072.0, which is 2 to the power of 17, as expected.

You can download the complete source code for the example here:

(Re-posted from The Java Mint Blog)

Share
Posted in DrJava, Mint | Leave a comment

Print This Post Print This Post  

Installing JavaMint on Windows

Here are some quick instructions on how to download and install Java Mint.

Windows

  1. You need to have Sun’s JDK 6 installed.
  2. Download the “binaries only” Java Mint zip file from the Java Mint implementation page. In this example, I have saved the file at C:\Program Files.
  3. Open an Explorer Window and find the zip file you saved in step 2.
  4. Right-click on the zip file and choose “Extract All…” and unpack all files in C:\Program Files. This will create a C:\Program Files\JavaMint directory. If you don’t see an “Extract All…” option in your context menu, you may need to download a program such as WinZip or WinRar first.
  5. Right-click on “My Computer” and select “Properties”. Go to the “Advanced” tab and press the “Environment Variables” button.
  6. Click on the “New” button in the “System variables” box.
  7. Enter as variable name: MINT_HOME
    and as variable value: C:\Program Files\JavaMint
  8. Find the Path variable in the “System variables” box, select it and click “Edit”.
  9. Go to the end of the text entered for “Variable value”, and add the following text:
    ;%MINT_HOME%\langtools\bin
    Be sure to enter the semicolon at the beginning of the added text.
  10. Press “OK” three times to close all three opened dialogs. Now you have added JavaMint to your path.

Now you can compile programs using mintc and run them using mint. Open a Command Prompt by clicking on the “Start” button, selecting “Run” and entering cmd and pressing “OK” (or search for the “Command Prompt” program in your Start Menu).

mintc Power.java
mint Power

There are samples in the C:\Program Files\JavaMint\langtools\mintTest directory.

(Re-posted from The Java Mint Blog)

Share
Posted in Mint | Leave a comment

Print This Post Print This Post  

Installing JavaMint on MacOS

Here are some quick instructions on how to download and install Java Mint.

MacOS

  1. You need to have Java 6 installed.
    Note: If you have a 32-bit Mac that does not have an Apple version of Java 6, you can use SoyLatte. Please install it in /usr/local/soylatte, i.e. the Java compiler should be /usr/local/soylatte/bin/javac.
  2. Download the “binaries only” Java Mint zip file from the Java Mint implementation page. In this example, I have saved the file on my desktop, i.e. at /Users/mgricken/Desktop.
  3. Open a console.
  4. Change into the /usr/local directory:
    cd /usr/local
  5. Unzip it as root. This means you have to type in your password:
    sudo unzip /Users/mgricken/Desktop/JavaMint-r13871-binaries.zip
  6. Set the MINT_HOME and PATH environment variables:
    export MINT_HOME=/usr/local/JavaMint
    export PATH=$PATH:$MINT_HOME/langtools/bin
  7. To make this permanent, edit your .bash_profile or .bashrc file and put the two lines from step 6 line at the end of the file.

Now you can compile programs using mintc and run them using mint.

mintc Power.java
mint Power

There are samples in the /usr/local/JavaMint/langtools/mintTest directory. You cannot compile them there, however, because the directory is read-only unless you are the root user. So unzip the Java Mint implementation zip file somewhere else, e.g. in your Documents directory.

The easiest way to experiment with Mint is to download DrJava with Mint. Here are more instructions on how to run DrJava with Mint.

Note: If you are using SoyLatte as your Java 6, please start DrJava with Mint from inside an X11 terminal window.

(Re-posted from The Java Mint Blog)

Share
Posted in Mint | 1 Comment

Print This Post Print This Post  

Back from Calgary

So I’ve been back from Calgary for nearly a week now, but I haven’t had time to write. The last week, and the conference, were pretty intense.

On Wednesday, August 26 I got up bright and early. I had already packed, so instead I could work on integrating ConcJUnit support into DrJava. I really did work until the last minute: Even at IAH Terminal A I was still making changes. I just figured the demo of ConcJUnit wasn’t very exciting from a visual perspective, so using it inside DrJava might make it a bit better. I think this was the right idea.

My flight had a short layover in Salt Lake City, Utah. The mountains seemed great from the air. Maybe some day I can spend some more time there. It did look rather dry there though; in fact, even the airport was lacking water fountains, and I couldn’t refill my water bottle for the flight to Calgary. I got to Calgary around 10 PM (11 PM CDT). I had just used carry-on luggage (although the airplanes were so small that I couldn’t in fact carry it with me), so getting my stuff didn’t take long.

The immigration examination was pretty thorough: The officer asked me what I was doing in Calgary (“I’ll speak at a conference.”), what conference it was (“PPPJ at the University of Calgary.”), and what kind of a conference it was (“It’s a computer science conference.”). She then asked what my status in the US was (“I’m an F1 international student.”) and “what I was taking”. I didn’t understand that question. I guess she was asking what classes I was taking. I finally responded with “I’m a computer scientist.” Customs, on the other hand, was very easy. I took a taxi to the hotel and then had some late-night McDonald’s. I hate getting fast food, but I didn’t want to search for restaurants that were still open at 11 PM.

On both Thursday and Friday I got up at 6:30, used the coffee maker in my room and got dressed, then headed down for the complimentary breakfast, which was pretty good. On Friday, though, it was swamped with Austrian tourists. I pretended not to understand them. Then, around 8:45, I headed to the conference venue. I got back around 9 PM on both days and then continued to work at home.

The conference was pretty small — it seemed like nearly everyone that was there was also presenting. The highlights for me were definitely Michael Ernst‘s tutorial on pluggable type-checking, Borys Bradel‘s presentation on trace-based parallelization of recursive Java programs, and the work by Danilo Ansaloni et al, particularly MAJOR.

Danilo’s MAJOR presentation was just before mine, and it was really an impressive demonstration of aspect-oriented programming for instrumenting programs. He shocked me by saying, as an aside, that in their aspect-oriented version of ReCrash they can also detect uncaught exceptions in all threads. They do this by applying an advice at a join point at the end of the Thread.run() method.

This seems a lot cooler than how I’m doing it, and I have to admit that I was stunned and that my presentation suffered. My approach, ConcJUnit, however, is simpler and uses standard Java, so it does have its merits.

The conference was enjoyable. I met some very smart, interesting and genuinely nice people. In addition to Borys, Danilo and Michael, I want to mention Ben Stephenson, the General Chair of the conference; Ondrej Lhotak, the keynote speaker; and Dave Hughes, chair of the CS department at Brock University and user of DrJava.

I did feel pretty tired afterward, though, and except for dinner downtown on Friday night, I didn’t have any time to go sightseeing. Consequently, the only pictures I took are from inside my nice hotel room and of a rather gigantic rabbit on the campus of the University of Calgary:

On Saturday morning, I got up at 4:30 and had coffee, then shared a taxi to the airport with David Hughes. The flight back via Minneapolis, Minn. was uneventful, and again I got a decent amount of work done. There was no free wireless network at either of the airports (at least none that I could get to work), so in Minneapolis I used tethering on my Palm Treo to submit my changes to Perforce and Subversion.

I thank my advisor and co-author Corky Cartwright for letting me attend this conference; the School of Engineering for partially supporting me; and the conference organizers and reviewers for their hard work.

Now I’m back, and I’ve spent the last few days improving the ConcJUnit integration in DrJava. As of yesterday, it is now possible to select a JUnit or ConcJUnit jar file and use it instead of the built-in JUnit. If ConcJUnit is used, the Java runtime library can also be processed at the touch of a button.

Share
Posted in Concurrent Unit Testing, Graduate School, Pictures | Leave a comment

Print This Post Print This Post  

Presentation: ConcJUnit: Unit Testing for Concurrent Programs

ConcJUnit: Unit Testing for Concurrent Programs

Where: The 7th International Conference on the Principles and Practice of Programming in Java (PPPJ 2009)
When: August 28, 2009

In test-driven development, tests are written for each program unit before the code is written, ensuring that the code has a comprehensive unit testing harness. Unfortunately, unit testing is much less effective for concurrent programs than for conventional sequential programs, partly because extant unit testing frameworks provide little help in addressing the challenges of testing concurrent code. In this paper, we present ConcJUnit, an extension of the popular unit testing framework JUnit that simplifies the task of writing tests for concurrent programs by handling uncaught exceptions and failed assertions in all threads, and by detecting child threads that were not forced to terminate before the main thread ends.

Share
Posted in Concurrent Unit Testing, Publications | Leave a comment

Print This Post Print This Post  

Practice Talk in COMP 600 Graduate Seminar

In our COMP 600 graduate seminar, I gave a practice talk for my upcoming presentation at PPPJ 2009.

I got some valuable feedback about the presentation and the slides, mainly that the blue background for the source code made it hard to read. Thanks for your help.

Share
Posted in Concurrent Unit Testing, Graduate School | Leave a comment

Print This Post Print This Post  

Presentation: ConcJUnit: Unit Testing for Concurrent Programs

ConcJUnit: Unit Testing for Concurrent Programs

Where: Rice University Computer Science Department, COMP 600 Graduate Seminar
When: August 24, 2009

In test-driven development, tests are written for each program unit before the code is written, ensuring that the code has a comprehensive unit testing harness. Unfortunately, unit testing is much less effective for concurrent programs than for conventional sequential programs, partly because extant unit testing frameworks provide little help in addressing the challenges of testing concurrent code. In this paper, we present ConcJUnit, an extension of the popular unit testing framework JUnit that simplifies the task of writing tests for concurrent programs by handling uncaught exceptions and failed assertions in all threads, and by detecting child threads that were not forced to terminate before the main thread ends.

Share
Posted in Concurrent Unit Testing, Publications | Leave a comment

Print This Post Print This Post