Black-box and white-box testing
David Cheney
david.cheney at canonical.com
Mon Mar 18 03:00:22 UTC 2013
> This then leads to a name clash when wanting to test both internal
> functions, and the public interface using real imports for the same file.
I'm not sure what the name clash is you are talking about, test files
have to end in _test.go, but there is nothing stopping you have
_internal_test.go, or _external_test.go, or whatever makes the most
sense in the local context
> Proposal
> ========
>
> 1) Test files that are in the same directory become white-box tests,
> living in the same package as the code.
>
> 2) Each directory containing source, gains a "tests" subdirectory that
> contains the black-box tests for that package. The package for the
> files in that directory is called "tests".
>
> This way we have clear delineation between the white-box tests and the
> black-box tests.
>
> Comments? Screams?
Can you live with the way it is til Oakland? Of all the things that are
broken at the moment, this doesn't feel like the most broken.
Dave
More information about the Juju-dev
mailing list