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

Re: Little Languages for Testing?



>>>>> "Eric" == Eric Kidd <eric.kidd@pobox.com> writes:

    Eric> * If it were possible to declare unit tests in the same file
    Eric> as the source code--without code bloat--would this lead to
    Eric> better or worse programs?

I've often wanted to do that, and in fact once wrote some Scheme code
in which each file defined a few functions, and then tested them.
Thus when I ran the whole program, the first thing it would do would
be to run all the tests, and while developing a module, I'd test that
module by simply invoking it as a script from the command line.
Crude, but it worked.

Something tells me this method wouldn't scale, but oh well.
 
-- 
Asking the Iraqi people to assume Saddam's debts
is rather like telling a man who has been shot in the head
that he has to pay for the bullet.
        -- James Surowiecki