<div dir="ltr">+1<br><br> '...<i>Black-box testing is about playing the role of client without any other advantages</i>...'   (and dependencies!  ;-)<br><br><br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 27, 2016 at 12:12 PM, Andrew Lee Rubinger <span dir="ltr"><<a href="mailto:alr@redhat.com" target="_blank">alr@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Sep 27, 2016 at 12:03 PM, Thomas Mäder <span dir="ltr"><<a href="mailto:tmader@redhat.com" target="_blank">tmader@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi folks,<br>
<br>
<a href="https://github.com/almighty/almighty-core/pull/249" rel="noreferrer" target="_blank">https://github.com/almighty/al<wbr>mighty-core/pull/249</a> proposes separating whitebox (use whatever code you want) and blackbox (use public API only) tests into separate files as a general guideline.<br>
<br>
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.<br></blockquote><div><br></div></span><div>I am not taking a position, but would like to point out that blackbox tests calling upon a public API have the benefit of fewer dependencies.  If you break them into a module that does not know about internal dependencies, you can have high assurance that you are properly acting as a user of the software and not accidentally depending upon internals.</div><div><br></div><div>This is the technique I've employed with some success over the years, and I've separated things out for the reason mentioned above.  Black-box testing is about playing the role of client without any other advantages.</div><div><br></div><div>S,</div><div>ALR</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
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.<br>
<br>
Also, most packages I've seen don't seem to do it (argument by authority ;-))<br>
<br>
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?<br>
<br>
What's you're opinion?<br>
<br>
/Thomas<br>
<br>
______________________________<wbr>_________________<br>
almighty-public mailing list<br>
<a href="mailto:almighty-public@redhat.com" target="_blank">almighty-public@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/almighty-public" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/almighty-public</a><br>
</blockquote></span></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr">Red Hat Developer Programs Architecture<div>@ALRubinger</div></div></div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
almighty-public mailing list<br>
<a href="mailto:almighty-public@redhat.com">almighty-public@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/almighty-public" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/almighty-<wbr>public</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Len DiMaggio (<a href="mailto:ldimaggi@redhat.com" target="_blank">ldimaggi@redhat.com</a>)<br>JBoss by Red Hat<br>314 Littleton Road<br>Westford, MA 01886  USA<br>tel:  978.392.3179<br>cell: 781.472.9912<br><a href="http://www.redhat.com" target="_blank">http://www.redhat.com</a><br><a href="http://community.jboss.org/people/ldimaggio" target="_blank">http://community.jboss.org/people/ldimaggio</a><br><br><img src="http://www.redhat.com/g/logos/RedHat_JBoss_logo.png"><br></div></div></div></div>
</div>