[erlang-questions] Unit testing code - whence?

Gianfranco Alongi gianfranco.alongi@REDACTED
Wed Jul 6 07:56:28 CEST 2011


I disagree.
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

On 6 Jul 2011 06:33, "Jon Watte" <jwatte@REDACTED> wrote:

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.

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.

Works for me/us! Your mileage may vary.

Sincerely,

jw


--
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.



On Tue, Jul 5, 2011 at 2:27 PM, Alex Arnon <alex.arnon@REDACTED> wrote:

> >
> > Hi List,
> >
> > What are the conventions regarding placement of unit test code and
> invocation?
> > Co...
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>

_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110706/239aaaba/attachment.htm>


More information about the erlang-questions mailing list