[erlang-questions] I Hate Unit Testing...

Steve Davis <>
Wed Jan 28 15:12:29 CET 2009


Hi Richard,

Thanks very much for your thoughts.

Richard Carlsson wrote:
 > Honestly?

Honesty is always at the heart of the most useful feedback!

 > simplest possible use of eunit for the terminally lazy...

I've used JUnit and NUnit and indeed EUnit too. The real issue is "how 
much" I use them... or don't. All these frameworks are super-powerful 
and well featured BUT they all require coding (including Quviq's solution).

That *is the barrier* to me (and apparently most coders) bothering with 
unit tests when stuck in the heat of things.

I really am that lazy (or maybe just that stupid) that I don't want to 
change gear into writing (and debugging) a test module. Even when I do 
actually pull my finger out, I generally delay doing it by which time I 
have forgotten half of what the module was really intended to do (i.e. 
the detail of the spec), and so I have to remember all that and it 
becomes a big chore.

OTOH, I *may* be bothered to add to a text file:
hex(4) = "4"

But from experience, I know that I'll just not bother to write:
-module(test_myapp).
-include_lib("eunit/include/eunit.hrl").

my_test() ->
     "4" = hex(4),
     ...etc

On another note, someone mentioned Cucumber... well hmmph. That's all 
very nice for your corporate stakeholders, but it's waaaaayyy too 
verbose for any developer I know to be bothered with.

With respect,

/s



More information about the erlang-questions mailing list