«« audioman dot re-org The Code is the BVA? »»
blog header image
History Repeating Repeating

On the id3v2test project I'm generating unit tests from XML. Since the generation is automatic and effortless, it opens the door for interesting things.

For example, in the id3v2 specifications there are many frame types. Each frame type consists of fields where data is stored. I made my own list of these fields from the spec and put them in a clearer format.

As you can see, a lot of the same field types are used over and over, so I can save a lot of effort by only making one set of tests for each field type.

This is an acceptance test suite so I'll have to generate the field type tests every time I see that field type in a frame type. The reason is that I don't know how the id3v2 library that's being tested is implemented. I can't just assume that because a field type is handled correctly in one frame type it's handled correctly in another. I have to test every variation and permutation explicitly. But luckily for me, the XML tests and generation code lets me do that quite easily.

While this strategy might generate a very large test suite, it seems like the easiest and best way.

update: Here are the field types...

AttachedPictureType
ByteBuffer
ChannelType
CompressionType
DeliveryMethod
EncodedDate
EncodedFlags
EncodedFloat
EncodedInteger
EncodedString
EncodedStringList
EncodedSymbol
ImageMimeType
InterpolationMethod
Language
LyricContentType
TextEncoding
TimeStampFormat
TimingEventType

Posted at October 04, 2004 at 05:07 PM EST
Last updated October 04, 2004 at 05:07 PM EST
Comments
Google
 
Search scope: Web ryanlowe.ca