[Haskell-cafe] The instability of Haskell libraries

Mads Lindstrøm mads.lindstroem at gmail.com
Sat Apr 24 06:18:53 EDT 2010


Hi

On Sat, 2010-04-24 at 19:47 +1000, Ivan Lazar Miljenovic wrote:
> Mads Lindstrøm <mads.lindstroem at gmail.com> writes:
> > You could automatically generate QuickCheck tests for many pure
> > functions. It will not catch every API change, but it would catch some.
> > It would have caught the API change that John mentioned.
> 
> As in comparing the old and the new functions?

Yes

> 
> > But automatically generating QuickCheck tests to test if funOld ==
> > funNew, would require quite a bit work. But better than everybody having
> > to write unit tests, as other have proposed.
> 
> Agreed; however, this has its own problems: you have to load up two
> versions of the same library and compare each pair of functions.
> 
> Note that even this comparison isn't really legitimate: what happens if
> there was some edge/corner case that the old version didn't handle
> properly and thus the new one fixes it?  The QC tests would say that
> they are different, even though they are actually the same.

But that would be an API change. It is of cause a question of how strict
we want to be. I have seen several times that commercial software
developers denies changes bugs, as the fix would constitute API changes.
We obviously do not want to go there, but we could bump the version
number as it would require little work.

> 
> Even if we could get around this, there remains another problem:
> automatically generating the kind of input each function expects (how do
> you encode pre-conditions automatically for such a tool to pick up?
> What about pure parsing functions?).
> 

Yes, for some functions it would be useless. Library developers could
specify test-input in these cases. This would require work of each
library developer, but still less than writing unit tests.

/Mads




More information about the Haskell-Cafe mailing list