<p>What's the best way to unit test large data sets?  Some legacy code that I'm maintaining has structures of a hundred members or more; other parts of the code that we're working on create or analyze data sets of hundreds of samples.</p>

<p>The best approach I've found so far is to serialize the structures or data sets from disk, perform the operations under test, serialize the results to disk, then diff the files containing the serialized results against files containing expected results.  This isn't terribly fast, and it violates the "don't touch the disk" principle of unit testing.  However, the only alternative I can think of (writing code to initialize and test hundreds of members and data points) seems unbearably tedious.</p>

<p>Are there any better solutions?  </p>

This is still a viable approach. Although, I would classify this as a functional test, or just not a pure unit test. A good unit test would be to take a sampling of those records that gives to a good distribution of the edge cases you may encounter, and write those up. Then, you have your last "acceptance" or "functional" test with your bulk test on all the data.
I have use this approach when testing large amounts of data, and i find it works well enough because the small units are maintainable, and then I know that the bulk test works, and it's all automatic.