Suggestions on testing GWT applications

3 views
Skip to first unread message

Marco Bizzarri

unread,
Jun 5, 2007, 11:41:26 AM6/5/07
to Google Web Toolkit
Hi all.

I'm working on a GWT application, and I'm trying to write tests both
for the client part (using GWTTestCase) and for the server part (using
"normal" JUnit).

The server part have the usual issues you can find in testing (use or
not the database, create a suitable environment for the testing, and
so on).

The client part, instead, gives us many problem, because of:

- speed;
- consumption of memory;

The speed of the tests is indeed a problem, even though we could put
up with it, if we were able to resolve the problem of the consumption
of memory. Indeed, we're unable to run all our tests. When we arrive
at (more or less) 90 tests run, Eclipse runs out of memory.

Is there anyone who can provide suggestions on this topic?

Regards
Marco

Sumit Chandel

unread,
Jun 5, 2007, 3:49:37 PM6/5/07
to Google-We...@googlegroups.com
Hi Marco,

Sorry to hear that you've run into this problem.  Here are a couple of things I suggest to try and improve the situation and get your tests up and running.

1)  Use Test Suites, if possible.  As long as your test cases are in the same GWT module, executing a test suite that includes those cases rather than each test case individually has been known to drastically increase execution speed as well as reduce memory consumption.  If you haven't already done this, give it a try and it should make for better results.

2)  Try passing in the -Xmx1024 argument to allocate more memory to the JUnit process.  From previous experience I would be able to run a set of test cases that would otherwise block on memory shortage by passing in this argument.

Hope that helps,
-Sumit Chandel

Marco Bizzarri

unread,
Jun 6, 2007, 4:36:53 AM6/6/07
to Google Web Toolkit
On 5 Giu, 21:49, "Sumit Chandel" <sumitchan...@google.com> wrote:
> Hi Marco,

Hi Sumit, thanks for your answers.

> Sorry to hear that you've run into this problem. Here are a couple of
> things I suggest to try and improve the situation and get your tests up and
> running.
>
> 1) Use Test Suites, if possible. As long as your test cases are in the
> same GWT module, executing a test suite that includes those cases rather
> than each test case individually has been known to drastically increase
> execution speed as well as reduce memory consumption. If you haven't
> already done this, give it a try and it should make for better results.

No, we didn't use Test Suites. I've just run a small benchmark,
running tests (152) both with suites and with a configuration in
Eclipse which runs all tests inside a package. Results are of the same
order of magnitude (140 secs).

I'm not sure there can be much space for improvement, also because a
number of tests, strictly speaking, are not unit tests, but more
integration tests (therefore, they do talk with database, etc. etc.).


> 2) Try passing in the -Xmx1024 argument to allocate more memory to the
> JUnit process. From previous experience I would be able to run a set of
> test cases that would otherwise block on memory shortage by passing in this
> argument.

This actually worked! I added it to the JUnit configuration, and was
able to run all my tests.

> Hope that helps,
> -Sumit Chandel

Thanks again.

Regards
Marco

Sumit Chandel

unread,
Jun 6, 2007, 4:27:07 PM6/6/07
to Google-We...@googlegroups.com
On 6/6/07, Marco Bizzarri <Marco.B...@gmail.com > wrote:

On 5 Giu, 21:49, "Sumit Chandel" <sumitchan...@google.com> wrote:

Hi Sumit, thanks for your answers.

 You're welcome!  Glad to hear we got around the memory consumption issue.

I would agree with your assessment that it's likely the slowdown problem is related to the fact that some of the test cases are in fact integration tests.  While there isn't much we can do about that, we're working on support for profiling browser code that may be useful to you, when it's released.  If you're interested in checking that out, you can read up on it on the Contributor's forum:

http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/9252af8226df1ff1/d7d795bb5bd14721?lnk=gst&q=profiling&rnum=1#d7d795bb5bd14721

Thanks,
-Sumit Chandel
Reply all
Reply to author
Forward
0 new messages