Thomas Zander
KDE
Bindings Generator
Posted by Thomas Zander
 in KDE, Bindings Generator
 on Wednesday, June 11, 2008 @ 19:00

As many of you know, I’m an OpenDocument fan, I love working on making KOffice rock, which is something I do at every opportunity. The work I do is mostly outside of the KOffice repository nowadays and others are picking up the slack. One really cool development is that I found some people willing to put some corporate funding into making our ODF compliance rock!

If you want to write some software and you want to maintain it for various years the best way to do this is to have regular testing in place to ensure that with further development the features you released in a previous release didn’t break. This is a common practice and the quality of your release is directly linked to the amount of testing you do. In the open source world the many users tend to work as testers, which is a concept that generally works pretty well. A much better solution is to have auto-tests. This is basically a program that does a certain task and checks the outcome for the expected values.

In KOffice we are working on improving out ODF compliance by first writing a test, and then making sure that the feature gets implemented. Before committing all tests ever written are ran and only when all of them (still) pass we can say the new feature is done. It should become obvious to anyone reading this that writing new software like this will create better software that is easier to maintain over time. Especially in open source where new people come and go on a regular basis.

I’m therefor extremely happy to report that Girish Ramakrishnan has so far created and made passing 51 61 OpenDocument Format loading tests. This in effect means we have lots of ODF features we researched what they should do (by reading the ISO specification) and then make sure we actually do that. Now and years from now they will do what they are meant to do.

The features we are testing are, for example, lists. That a document that is meant to have a numbered list with any sort of complex numbering load and show correctly. But sometimes we have some quite different test, things that KOffice never did before. In that case new features have to be added to KOffice. One such feature is the dropcaps. This is a feature that people that write newspaper style documents will love. Let me show a screenshot which explains it best. :)

For this new feature we have yet to add some dialogs to configure this, so to try it out I started OOo and loaded the odt doc in KWord. Which I admit is a pretty cool way to show how far we have come in the interoperability area :D

Update; updated number of passing tests.

6 Responses to “Testing typography”

» Posted by mat69
 on Wednesday, June 11, 2008 @ 21:23

That’s fantastic!
Being able to use odf documents with KOffice or OOo without differences in the result is something I am really waiting for. So every step closer to that goal is highly appreciated.

» Posted by girish
 on Thursday, June 12, 2008 @ 07:05

Thanks for writing about this, Thomas. Your help has been invaluable to us.

For those interested, the tests are written using Kent’s Qt4 QScript binding generator (no technical reason, only because we can). You can find the tests at http://websvn.kde.org/trunk/koffice/libs/kotext/opendocument/tests/ . Currently, we have around 61 tests. We have now moved on to testing/implementing writing of ODF documents (change 819211). Also, I didn’t write the drop-caps feature, it was implemented by Roop, you can find his blog at http://blog.forwardbias.in/2008/06/drop-caps.html

» Reply from Thomas Zander
 on Thursday, June 12, 2008 @ 08:38
Thomas Zander

Thanks Girish, I didn’t notice the blog of Roop before. Luckely we didn’t really cover the same subject matter :)

» Posted by Repre Hendor
 on Thursday, June 12, 2008 @ 19:20

“A much better solution is to have auto-tests.”

No amount of auto-testing can find bugs that only users can find.

I’m not against auto-tests, not at all. But it is not “one or the other”, and not not “one is better than the other”. You need both, and both complement each other.

» Posted by blueget
 on Sunday, June 15, 2008 @ 20:56

That’s really, really cool. As soon as KOffice 2 is out, I’ll switch to it and abandon that bloated OpenOffice Thingie.

» Posted by Jason
 on Monday, June 23, 2008 @ 20:38

Will this also fix rendering to printer devices?

The few printing operations I’ve tried have turned out to be extremley poor (Using QTextDocument::print()) - not every letter was the same, spacing was inconsistent. I’ve not tried to print on Qt 4.4 yet though…



© 2008 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners.