[kaffe] Testing for 1.1.0 release

Stuart Ballard stuart.ballard at corp.fast.net
Tue May 20 09:41:01 PDT 2003

Dalibor Topic wrote:
> Hi Stuart,
> I've started to merge Classpath's collection classes into kaffe, so I'd be glad
> for more test cases ;) While it may not get ready for 1.1, it should allow
> kaffe to run japitools soon ...

Okay, well, the test is attached.

The purpose of the test is to verify that the implementations of all 
concrete methods in Abstract* are implemented the same way in terms of 
which virtual methods they call on their subclasses. This ensures 
(hopefully) that when client code subclasses Abstract* directly and 
overrides certain methods, the behavior will be the same between Sun's 
implementation and ours. I have no idea how close any free 
implementation comes to passing this test, because I've never tried!

This may be a fairly controversial test: the exact behavior of the 
Abstract* methods may not be fully documented, so it may not be 
"correct" for client code to rely on the subtleties of it. In defense of 
the test, I'd point out that getting correct behavior by inheriting from 
a black-box superclass is almost impossible to achieve without 
"guessing" the behavior and confirming it by experimentation. I have 
real-world code which was written this way and it never occurred to me 
that I was making it non-portable by doing so - and I probably think 
about portability issues more than most people! This code seems to fail 
on at least some free VMs due to these issues.

To run the test, unzip it into a directory and run "./abbash java" and 
"./abbash kaffe". (You may have to modify the abbash script if you don't 
want to use jikes or if kaffe doesn't implement the "-cp" flag; it also 
requires perl). This will generate various *.java.out and *.kaffe.out 
files which can be compared to find differences in the implementations. 
Much of the java source code it uses will also only be there *after* 
running it, as it's generated by the perl script from util.japi (a very 
stripped down japi file from jdk1.4 which only contains the parts I'm 
interested in).

I suspect that some thought may be needed in deciding exactly how 
perfectly we *need* to pass these tests. The output includes every 
method that is called (to the greatest extent that I could figure it 
out), and some of these may legitimately be implementation dependent, 
especially once you get to deeper levels of nesting.

Oh, one more thing: The test runs modified versions of ListBash, SetBash 
and MapBash from javacollections.org. They're modified to be 
deterministic by seeding the random value at zero every time. ListBash 
is further modified to make it behave correctly when asked to test an 
list with an odd number of elements, which it didn't originally.


Stuart Ballard, Senior Web Developer
FASTNET - Web Solutions
(215) 283-2300, ext. 126
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abbash.tar.gz
Type: application/x-tar
Size: 7272 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/20030520/50d75bd7/attachment-0002.tar 

More information about the kaffe mailing list