chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] Re: [Chicken-users] Integrating unit tests into source


From: Brandon J. Van Every
Subject: [Chicken-hackers] Re: [Chicken-users] Integrating unit tests into source code
Date: Thu, 14 Dec 2006 03:10:28 -0800
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Peter Bex wrote:

It might be useful, but typically tests are much bigger than a single
sexpr.  If you really want to test a function well, you'll have to
write tests around all the corner cases and weird combinations.
How bigger a function is, the more tests you'll need.  I'm not sure
I'd want to clutter up my code with tests like that.

I like the idea of 'contracts' a lot more.  PLT scheme has a library
for those.  See http://www.ccs.neu.edu/home/matthias/Tmp/contracts.html
for a draft manual/guide on how to use them.  Contracts specify the
how a function should behave.  With a library like this you don't
need to hack the core compiler either.

The major difference between contracts and tests is that contracts
are of a declarative nature while tests are more like exhaustive
example uses of a function and what the result ought to be.

Also, if we're lucky we can snarf the existing PLT code and modify
it, which would save a lot of work.

Bear in mind that PLT Scheme is LGPLed, as is the mzlib containing contracts.ss.
http://download.plt-scheme.org/doc/mzlib/mzlib-Z-H-54.html#node_chap_Temp_9
That means it could only be snarfed as an egg. If contract programming is meant to be "core" to the way people use Chicken - which seems to be what Felix has in mind - then I'd say it's an unacceptable license pollution.

Of course, LGPL code can be gradually "whittled down," taking on more and more functionality in either toplevel or parallel libraries, so long as you're writing your own code and not cutting and pasting their code. But, it takes time to whittle things down, and someone has to actually do that. In the real world, who will?

Are there any BSD licensed Schemes worth poaching?


Cheers,
Brandon Van Every





reply via email to

[Prev in Thread] Current Thread [Next in Thread]