
igloo:
On Sat, May 31, 2008 at 10:44:40AM +0200, Krasimir Angelov wrote:
I was silent for some time but in this time I created QuickCheck tests for Data.Tree.Zipper which achieve 100% coverage with HPC. I also created a ticket for it: Ticket #2324
http://hackage.haskell.org/trac/ghc/ticket/2324
The attached file is the current implementation and it contains the version updated from Iavor Diatchki. It has the advantage that it also works with forests, not just with trees.
Initially I thought that complete testsuite for such a simple module might be overkill but actually I found a bug :-) in the splitChildren function which is now fixed.
So just to check, this proposal is to add Data.Tree.Zipper to containers and the QC tests to the testsuite, right?
As I've explained before[1], I don't think that QuickCheck tests are a good way to test libraries: They tend to test the same inputs (e.g. []) or equivalent inputs (e.g. "insert 2 [3]" and "insert 3 [4]") many times, meaning it takes much longer to get the same level of testing as a few well-chosen unit tests. When you multiply this by all the libraries the testsuite is meant to test, this is a significant amount of time.
I also don't think that adding the tests but not running them automatically is a good idea, as they will most likely just bitrot.
Adding a unit test for the bug you found is certainly a good idea, though!
[1] http://www.haskell.org/pipermail/libraries/2008-April/009594.html
You're on your own on this one, Ian. QuickCheck is a cheap, simple way to get good coverage, that's why Haskell library writers use it. Please include tests, Krasimir! -- Don