Wednesday, May 6, 2009

Pop another level

I'm trying to reverse engineer a surface definition from (essentially) its data structure. To do so, I've defined a skeleton surface type to hold that data structure (a few hours' work) with the goal of being able to visually look at that data structure along with the edges trimming the surface.

Only problem is, now that I've got it this far, I see that many of those edges are specified using a curve type we also don't support. So I need to reverse engineer the curve's definition successfully before I can work on the surface's definition. Maybe.

This brings up a question I've been pondering. How do you unit test something when you don't know what it is supposed to do? Certainly I can come up with useful tests for a (say) offset surface curve. But how can I tell that my reverse engineering of the file's data structure to that curve type is the correct interpretation of the data structure, other than throwing a lot of real world data at it and seeing if the result looks plausible?


  1. I use WordPress for my blogging and the syntax highlighting of code is done with CodeColorer.