[GSOC] Data model unit testing

John Ralls jralls at ceridwen.us
Thu Apr 7 13:44:45 EDT 2011


On Mar 31, 2011, at 1:20 AM, Christian Stimming wrote:

> Zitat von John Ralls <jralls at ceridwen.us>:
> 
>> I'm making good progress on the Gir2Umi program, so I hope to have a skeleton UML model in another week or so. Once we have that we can assess how much hand-modelling we need to do.
>> 
>> There's no real priority within LibQof. It's at the middle of Gnucash and in the way of some important changes that we need to make, and we need to be sure that we don't break anything when we make those changes. That's what the tests are for. It seems to me that that should make a pretty clear goal for your application, too.
> 
> Indeed. Thanks for the UML modelling work - I'm curious how this is going to look like when it's ready :-)
> 

I've got the first try ready. You can download it at 

https://github.com/jralls/gnucash/raw/introspection/src/libqof/qof/Qof-1.xmi

It loads happily into argouml and almost-happily into umbrello. In umbrello, the enumeration values don't show up because of a difference in the way argouml (actually, Oracle's jmi java library which argo uses) and umbrello interpret the UML DTD. To get umbrello to recognize the enumeration values, run

sed -i"" '/Enumeration.literal/ d' Qof-1.xmi

after you download the model.

There aren't any graphical elements in the model (those are incompatible between the two) and the classes are so huge that it's not really practical to make a picture. Class inheritance is shown (not that there's much: QofBook inherits from QofInstance and QofInstance from GObject.) Associations aren't included, but umbrello infers them automatically from attribute types.

The reason that there aren't any associations is that I used SAX in a perl program to process the gir file, and realized today that it's the wrong tool because it's sequential on the gir order of elements, so I need to rewrite it using DOM, which allows me to work through the tree in a more logical order and perhaps more importantly to adjust existing elements in the output. That's something I need to do to deal properly with a few issues (though associations for argouml aren't one of them, they're blocked by one).

Regards,
John Ralls



More information about the gnucash-devel mailing list