chicken-hackers
[Top][All Lists]
Advanced

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

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


From: Peter Bex
Subject: Re: [Chicken-hackers] Re: [Chicken-users] Integrating unit tests into source code
Date: Thu, 14 Dec 2006 12:30:14 +0100
User-agent: Mutt/1.4.2.2i

On Thu, Dec 14, 2006 at 03:10:28AM -0800, Brandon J. Van Every wrote:
> 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.

True, but that never was a problem afaik.

> 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.

You do have a point.  If it is really supposed to be a core concept for
Chicken, we can't just use this code.
Still, I think contracts is the way to go, much more elegant than tests.
Tests can (and probably should) augment the contracts, of course.
The nice thing about contracts is that you can enable them for your
development code (assertions, basically), but disable them in
release code, also giving you validation of the calling code.

A contract basically says 'if you give me this kind of input, I can
guarantee that I will produce this kind of output'.  This goes two ways,
the caller can break the contract by providing bogus input and the
callee can break the contract by returning bogus output.

Tests are a lot more static.  They just say 'if I give this specific
input, this specific output needs to be returned'.  It only tests the
function itself and it's no use to perform the tests every single time
a function is called, so it doesn't give you any kind of run-time
protection.

> 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?

I don't really understand this part.  Anyway, even if we're not
using the exact code, we could use something like a similar syntax
or at least take the good ideas and let PLT keep the bad ideas :)

> Are there any BSD licensed Schemes worth poaching?

I hope someone else can answer this.

Please don't post to another list when replying to a thread.  It makes
it very hard to follow discussions.  Mutt and other threaded mailclients
can't display the thread tree correctly if the mails are in different
mailboxes, of course, and some people might not be subscribed to both
mailinglists and miss half the discussion.  I'm crossposting this in
the hope to move the thread back to chicken-users.

Regards,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: pgpf0fvVrvVPO.pgp
Description: PGP signature


reply via email to

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