[racket] Testing "impossible" branches in the code

From: Mikko Tiihonen (mikko.tiihonen at tmtiihonen.fi)
Date: Wed Apr 16 17:01:37 EDT 2014

Forwarding a copy to the list...

> Lähettäjä: Mikko Tiihonen <mikko.tiihonen at tmtiihonen.fi>
> Aihe: Re: [racket] Testing "impossible" branches in the code
> Päivämäärä: 16. huhtikuuta 2014 21.07.39 UTC+3
> Vastaanottaja: Matthias Felleisen <matthias at ccs.neu.edu>
> 
> That's right :) Racket's contract system will probably be very suitable for my purposes. I plan to map the dependencies between the functions and arrange independent functions into submodules so that I can write contracts for them. I presume that the code will also be prettier after that...
> 
> Cheers,
> 
> -Mikko
> 
> Matthias Felleisen <matthias at ccs.neu.edu> kirjoitti 15.4.2014 kello 23.49:
> 
>> 
>> On Apr 15, 2014, at 4:02 PM, Mikko Tiihonen <mikko.tiihonen at tmtiihonen.fi> wrote:
>> 
>>> as I dissected the code it became clear to me that my implementation had been far from clean. One of the problems was that the responsibility for checking return values was not in the function returning the value, but in the calling function.
>>> 
>>> The main thing seems to be that I need to check return values for type and also for range. After some refactorings I have transferred the responsibility for checking these values so that testing became easier. Also, It starts to look like typed Racket would be an appropriate solution for making the code more robust.
>> 
>> 
>> It sounds like you are reinventing contracts. Are they powerful enough to give you what you want?
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.racket-lang.org/users/archive/attachments/20140417/7f03e049/attachment.sig>

Posted on the users mailing list.