art with code

2009-01-15

Prelude.ml: first pass of array tests complete

The power of copy&paste coupled with search&replace brought about the completion of the first pass of prelude.ml array tests. What remains is porting those to PreString and Bytestring, plus the rest. PreArray has a 1:4 code:tests ratio, which sounds pretty ridiculous. With that ratio, the rest of prelude.ml is still 4900 lines of tests short, about half of them (== PreString & Bytestring) should be adaptable from PreArray.

The list-to-array adaptation trudged along at around 900 lines per day, so completing PreString and Bytestring should be doable by next week. Then the rest at a slower pace, for full tests by the end of the month? And tag 1.0 then.

The unit tests are turning writing a 2000-line library into writing a 10000-line library. That's a huge amount of boilerplate. There must be some better way to assert that a piece of code works correctly. And my tests aren't even complete, I'm mostly testing the easy high-impact things like "does indexing work right?"; "does this do what it should for this small array?" and not the subtler things ("if the sum of this array overflows int, the 'average' function doesn't work right.") Not to mention performance and memory use.

No comments:

Blog Archive