Black-box and white-box testing
John Arbash Meinel
john at arbash-meinel.com
Mon Mar 18 04:18:42 UTC 2013
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 2013-03-18 5:11, Tim Penhey wrote:
> Hi all,
>
> We have two types of tests in the juju-core codebase at the moment,
> and I'd like to get some general agreement on how we lay out tests,
> and what types of tests are found where.
...
> Proposal ========
>
> 1) Test files that are in the same directory become white-box
> tests, living in the same package as the code.
To start with, my understanding is that white-box tests *have* to sit
in the same directory. Otherwise even if they had the same package
name, they would still not be the same package. (The full path is the
*actual* name.)
So that seems pretty obvious. Especially test files are named like the
module they are testing (foo_test.go can pretty clearly be a whitebox
tests of foo.go)
>
> 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?
>
> Tim
>
I would be fine if we just did it via filenames foo_external_test or
foo_blackbox_test, etc. I probably wouldn't just call the directory
'tests' since that still sounds like all tests should be there (and we
can't put whitebox tests there.) But that is mostly bikeshedding. So I
care more that we have something consistent, and then I'm happy enough.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlFGlaIACgkQJdeBCYSNAANrPACgjyT2AHr8Zyr/PsutXfWu5Vt2
GNsAoMijXA0AIf2UOi74FkKI6I7WYIv2
=zaE6
-----END PGP SIGNATURE-----
More information about the Juju-dev
mailing list