[almighty] White/Blackbox tests

Thomas Mäder tmader at redhat.com
Tue Sep 27 16:03:20 UTC 2016


Hi folks,

https://github.com/almighty/almighty-core/pull/249 proposes separating 
whitebox (use whatever code you want) and blackbox (use public API only) 
tests into separate files as a general guideline.

I feel separating the two tests does not add any value, it just makes 
adding tests more complicated. I'm not saying that we can't break up 
huge tests into multiple files, just that whitebox vs. blackbox is not a 
useful criterion to do so. And even if that separation might make sense, 
I feel it only does so in a limited number of cases and should not be a 
mandated or recommended practice.

Also, the proposed naming policy leads to_very_long_file_names.go which 
for me makes it harder to find the files I am looking for.

Also, most packages I've seen don't seem to do it (argument by authority 
;-))

As an example, I don't think the tests in the models package have gained 
in clarity for being separated into whitebox and blackbox tests. If can 
make testing the API much simpler by calling an internal function, do I 
have to refrain from doing so?

What's you're opinion?

/Thomas




More information about the almighty-public mailing list