[Scons-users] best practices: unit tests

R0b0t1 r030t1 at gmail.com
Thu Feb 1 22:33:10 EST 2018


On Thu, Feb 1, 2018 at 8:19 PM, Mats Wichmann <mats at wichmann.us> wrote:
> On 02/01/2018 04:11 PM, R0b0t1 wrote:
>
>> Unit tests are a mixed bag.
>
> Yeah, I know nearly all the arguments. Made a lot of them myself :)  But
> that's how modern projects work: the founders lay down TDD-style "thou
> shalt not write an API without unit tests" rules.  It's not my call to
> change those requirements, and I think they're actually fine: API tests
> work on verifying documented behavior and don't have the same
> variability problems you cite.
>

But they don't. API tests verify that the input selected gives the
output in the test. It is not a description that holds for all valid
input.

There is an even larger problem, which is that even if you can prove
that a program is "type safe" all you have done is prove that it is
logically consistent within some theoretical framework. Even if you
can prove it adheres to a specification, you still haven't proved that
the specification reflects what you actually want to happen.

>> It sounds like referring you to an existing system would help - so,
>> you might look at Ant and Maven and the structure of large Java
>> projects.
>
> Sure, you can depend on external stuff.  The project I'm on does (in
> particular, the java additions do make use of Maven, but I don't touch
> those bits, so...).  The question was about doing this in scons, since
> this is an scons list. If the best practice is: don't try to do it in
> scons, that's fine, I was just trying to flush out opinions.
>

Sorry, I wasn't suggesting you rely on Ant/Maven. But for e.g. Python
you just use the unittest module, or Nose and py.test and then run it.
With Java projects, the tests/ directory is usually just complete
programs that run. It may be one program. It doesn't matter which
build system you are using.

The answer is very language specific.

Cheers,
     R0b0t1


More information about the Scons-users mailing list