lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Peter Aronoff once stated:
> steve donovan <steve.j.donovan@gmail.com> wrote:
> > I suppose (like Sean) I don't appear to want these ;)  Look, I'm not
> > knocking the idea but I like tests simple - they don't talk, unless they
> > break. If they break I sort it out immediately. I don't gain any
> > satisfaction in seeing pages of pretty green output with the occasional
> > outbreak of red. The statistics which are ultimately meaningful are about
> > _coverage_ and that's outside the scope of a test framework.
> 
> You don’t have to want these things. (You also don’t have to want your
> tests run in a randomized order, which some test frameworks now do to help
> increase test isolation.) But not wanting something or writing your own
> minimal library is very different from saying “I don’t know why these
> exist.” That seems either disingenuous or silly, and Adam’s example shows
> why.

  I did not feel my question was disingenious or silly, as I *really* did
not know why* anyone even bothers with testing frameworks.  While Alexey
provided *an* answer (well, four really), they didn't explain to me *why* a
framework is needed, as the four items he mentioned could be done without a
framework.  It is indeed, Adam's answer that provides, to me, some cases I
did not consider at all (like the randomized order case---question: does
*any* Lua testing framework provide *that* functionality?) [1].

  Just because *you* know does not mean *everybody* knows.

> Imagine someone says, “I don’t understand why people write logging modules
> since the print function already exists.” In all likelihood, the person
> knows perfectly well *why* people write logging modules. The person just
> wants an opportunity to say how much smarter they are than everyone else or
> to judge everyone else’s work, etc. It’s not a good look.

  Or the person has never worked in an environment with centralized logging
for diagnosis or audits.  

  -spc (Or sometimes, you know, the Emperor has no clothes ... )

[1]	I was so intrigued with running the tests in a random order that I
	took five minutes to test that with our regression test at work
	(test written in Lua, testing a component written in Lua).  Glad to
	say the tests passed.

	And no, I do not use an existing test framework for this [2].

[2]	Even though I need to create 10,660 files before running the 7,776
	tests, and to run the 7,776 tests requires running four other
	programs (in addition to the program being tested and the test
	program---and of the four additional programs, three are mock
	versions of the real thing).

	To be fair, I have a program that generates the 10,660 files
	required for the test, and a separate program that runs everything,
	including the tests.  Yes, you can even run a single test if need
	be.