Forking Java GUI Apps

From: Amir Michail (amichail_at_gmail.com)
Date: 09/24/04


Date: 23 Sep 2004 21:41:21 -0700

Although forking a Java GUI app may seem very strange, we would like to
do this to improve bug prediction in the "Stabilizer", a system for
helping users avoid bugs in GUI applications:

http://stabilizer.sf.net

When we get an input event, we use machine learning to predict whether
a bug is likely given past "bug" and "not bug" reports. If a bug is
likely, the user will be given a warning and the option of aborting the
input event, thus avoiding the bug.

To improve bug prediction, we would like to see the code that would
execute after the event. That's why we would like to fork a child to
see what would execute without committing the parent to that action. If
a bug is likely given the execution of the child, then we can give the
user a warning. The user could then abort the action and the parent
would not process the event at all, thus avoiding the bug. Fork is used
so that the child execution does not affect its parent.

So the idea is that a Java GUI app would fork a child on every input
event. However, the child must not communicate with the X server in any
way -- only the parent can do so.

So we need some way to ignore all X calls from the child. Another
possibility is to terminate the execution of the child upon the first X
call.

The execution of the child need not be perfect, but it should be good
enough to enhance bug prediction.

Any ideas on how we could prevent the child from communicating with the
X server (without changing the child code)?

Amir

P.S. We use the Java native interface to provide access to fork. It
works fine with non-GUI apps provided we use green (i.e., non-kernel)
threads.



Relevant Pages