Black-box and white-box testing
Tim Penhey
tim.penhey at canonical.com
Mon Mar 18 03:01:59 UTC 2013
On 18/03/13 16:00, David Cheney wrote:
>> 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
Sure, and this is what is happening currently. I just think it is
better to have a cleaner separation.
>> 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.
I'd be happy to have this deferred until Oakland. But it was mentioned
in a review, so I brought it up.
Tim
More information about the Juju-dev
mailing list