[racket] Racket unit testing, was Re: date format conversion
On Sun, Feb 13, 2011 at 3:20 AM, Stefan Schmiedl <s at xss.de> wrote:
> On Sat, 12 Feb 2011 21:40:48 -0500
> Neil Van Dyke <neil at neilvandyke.org> wrote:
>
>> prad wrote at 02/12/2011 08:54 PM:
>> > my son helped me understand what it was doing after we looked check-expect up. so this runs a function for you and checks to see that the result is really what you say it is going to be!
>> >
>> > that's pretty useful, so a second thx!
>> >
>>
>> This use of "check-expect" is what's known as *unit testing*, and is a
>> very popular practice for good software development nowadays.
>
> Are there specific reasons or situations when using
>
> (require test-engine/racket-tests)
>
> is "superior" to using the test framework provided in
>
> (require rackunit) ?
No apriori reason, no. The two evolved independently,
test-engine/racket-tests was originally designed as part of the
teaching languages and so makes design decisions that are better
suited there (specifically for showing the results of test case
failures). rackunit was designed for the full languages and I believe
it has more features for putting tests together into test suites and
support for adding your own kind of test cases and extending existing
ones.
And there is also a third unit test framework that Eli wrote that
takes the position that it should be minimal, punting things like test
suites into Racket itself (by using functions, say). I'm not sure if
that last one is included in the documentation.
There was an attempt to try to bring these three together but it
turned into lots of committee-like meeting/email discussions and so
for now, we just have multiple offerings.
Robby