<p>I disagree. <br>
Putting your tests in another module will actually force you to think more of your design, making the application/lib more testable without being necessarily more "open". Another huge win is that you will have a cleaner implementation module. And you will be able to easily mix and match revisions of code and tests. /G</p>

<p><blockquote type="cite">On 6 Jul 2011 06:33, "Jon Watte" <<a href="mailto:jwatte@gmail.com">jwatte@gmail.com</a>> wrote:<br><br>Unit tests in a different module means you have to open your module up a lot more than if the tests are in the same module.<div>
<br></div><div>Generally, I write the code, then I include_lib eunit.hrl, then I write the unit tests. That can all be wrapped in conditional compilation if you need to. However, when just developing new functions, I typically put the tests right by the functions they're testing, and only when I'm done do I move them to the end of the file.</div>

<div><br></div><div>Works for me/us! Your mileage may vary.</div><div><br></div><div>Sincerely,</div><div><br></div><div>jw</div><div><br clear="all"><br>--<br>Americans might object: there is no way we would sacrifice our living standards for the benefit of people in the rest of the world. Nevertheless, whether we get there willingly or not, we shall soon have lower consumption rates, because our present rates are unsustainable. <br>

<br>
<br><br><div class="gmail_quote"><p><font color="#500050">On Tue, Jul 5, 2011 at 2:27 PM, Alex Arnon <<a href="mailto:alex.arnon@gmail.com">alex.arnon@gmail.com</a>> wrote:</font></p><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p><font color="#500050">><br>> Hi List,<br>><br>> What are the conventions regarding placement of unit test code and invocation?<br>> Co...</font></p>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></p>