And now, let’s test

I think this is a common problem when working on a program and its backend implementation in parallel. Whenever I come to need a new function in JulTagger, I need to start hacking at RubyTag++. Unfortunately, it’s not difficult to hose the whole package when doing a change, so I’ve decided to start adding a series of regression tests.

But this is not news, I already blogged about my fights with cmake to have it running my tests.
At the end I decided to do it in a strange way: every ruby script is responsible for decompressing and converting the wave file to the compressed file I need it to.

Now, the problem is to write a sufficiently complete test suite, I do have 10 tests, but I miss entirely tests on flac files, as I don’t seem to be able to set the tags correctly with either the flac or metaflac commands. I also miss lots of extended tests, and there’s no tests about mp3 headers right now.

Of course writing these tests has to be done in parallel with adding of new classes and functions to RubyTag++, and indeed yesterday I added MPC support just to add the tests, although I didn’t have much to do with them (that’s also the reason why I merged musepack-tools here and on farragut – I ran the tests on both Linux and FreeBSD – and why I did keyword a few packages with it).

Now the tests are really just partial, tests if tags are being loaded correctly, if the tags types are reported correctly, and so on. I’d like to get some help, so I’ll try to write some documentation about RubyTag and the generator script so that if anybody wants to help, he’ll know how to do it. After that, it should be pretty straightforward to avoid adding bugs when the tests all passed.

By the way: the only test right now that fails is related to mp3 tags, for some reason TagLib::MPEG::File::ID3v2() function returns a TagLib::APE::Tag instance instead, and that might as well be an error in my generator script, or an error in TagLib itself, for what I can tell. Sigh.

Anyway, today I don’t feel that well, and I’m unable to go out as I should and would have done, this mean that my mood will be very very unstable in the next hours at least.

Really, I should drop the coke entirely..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s