I'm really new to TDD, so I guess this question is pretty basic.We're building a website, and part of the functionality is generating some files (binary files: Excel, PDF, whatever). How should I test this feature?I've think about creating some static files and compare those with the generated ones, but a binary comparison isn't reliable (the files can have the same content but different checksums), and, if I understood TDD correctly, a logic comparison isn't a good idea, since I should use basically the same algorithm I use to generate the files, so I wouldn't be really testing anything.How are this kind of things usually dealt with?
TDD: how to test file outputs?
agile;tdd
I've done this by using a library to parse the files.  Sounds like you already have one available so you should use this.Even if you could compare the entirety of the binary files, I wouldn't recommend this.  Lets say you've got 100 tests that are testing various things by comparing the entire binary output.  Then a new requirement comes in that the title of each file should be changed from Foo to Bar.  Assuming all your output files were outputting a title of Foo, you've now got 100 broken tests you have to fix.  A better way is to only test one thing in a test that doesn't overlap with the other tests.  In this context, only a few tests should be responsible for checking the title.  Then if the same requirement comes in, only those few tests would need to be changed.