in reply to Re^2: "Practices and Principles" to death
in thread "Practices and Principles" to death
All I was intending to reflect is that it seems that when it comes to testing, I see so much emphasis placed on things like metrics for metrics-sake, test suites that are "required" to be run even when the applications have long since outgrown the utility of those tests. But we are still required to do them because they are part of our policies that, themselves, never get questioned.
I agree. Many of the successful projects I've encountered regularly stop and ask themselves "Wait, is this thing we started to do a while back actually working? Is it helpful? Is it valuable?" If it's not, they stop doing it.
We should encourage people to reflect on their practices and their efficacy and to revise their processes based on that feedback.
I'm not sure bounding in like a bungee boss and saying "I'm here to challenge the status quo! The prevailing wisdom doesn't always work!" is the way to do that, which is why I responded to BrowserUk so strongly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: "Practices and Principles" to death
by BrowserUk (Patriarch) on Mar 01, 2008 at 04:05 UTC | |
I'm not sure bounding in like a bungee boss and saying "I'm here to challenge the status quo! The prevailing wisdom doesn't always work!" is the way to do that, which is why I responded to BrowserUk so strongly. Unfortunately, as is so often the case, you were so busy responding strongly, that you either: a) didn't bother to read what I wrote; or b) read it, and decided that it was easier (or perhaps, more entertaining) to take minutia of my posts and blow them out of proportion, than to deal with the argument itself. For example. Read back and you'll find that string eval was just supporting example to a wider point--accusation if you prefer--that, despite recognising the importance of test code, by using the Test::* modules to create test suites, I do not have a problem with the use of string eval--subject to sensible precations. As I've pointed out before, and I seem to recall but cannot find, you may have done similar, when you get down to base level, all Perl code is handled through string eval: use is require is do is eval. Only two things differ. The source of the string and the timing of the evaluation. Indeed, I've spoken up against the unthinking paranoia--"if you cannot trust the source of the code it can be dangerous; if you repeatedly evaluate the same code, it can be slow"--that surrounds string eval, being converted into "string eval is evil", on many occasions in this place. Provided the code being evaluated originates from within your own filesystem/organisation, and is provenanced with the same credentials, there is no greater risk between evaluating that code at runtime, and evaluating a perl source file at compile time. And provided that you do not evaluate identical code more than once, (think Memoize or a hash lookup), then it is no slower than doing the same thing at compile time. And far faster than trying to replicate the Perl parser using Perl code (C vs. Perl) or (for example) Parser::RecDescent. And it is this last point that I was making about Test::Builder's use of string eval. If you are, at the lowest level, going to kick the responsibility of performing a comparison test off to Perl's parser (via string eval), why bother with interspersing all the layers between those comparisons and the Perl parser? You mentioned that you had attempted a dispatch table solution but that string eval proved to be faster. You also challenged me (though I'm pretty sure it was more of a dare than a challenge), to suggest an alternative that would deal with all the edge cases and caveats that had been evolved into T::B. Well, here is an idea for you: Let Perl do it How? How about this? (And I know before posting that you will find a reason for not using it (based upon my crude implementation. Perhaps something to do with supporting ancient builds?):
To produce:
As far as I am able to discern, as the code will be run with the context of the calling code, the interpretation of any variables--be they tied, overloaded or whatever--should be identical to the way they would be interpreted if executed at the same point in the calling code. Assuming that you arrive at similar conclusions, no doubt you'll let me know if not, then go back and look at the shenanigans that similar code goes through before being passed back to string eval. And also consider the less than stellar syntax that it requires. One possible objection to this is that it cannot (easily; ignoring B::* for the moment), automatically produce a comment that shows the exact code. I have two answers to that:
But my primary objections to Test::*, are:
I do not expect a meaningful response to this, because that would require you to actually consider my arguments rather than using spoiling tactics, like exploiting a typo , to dismiss them. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
by chromatic (Archbishop) on Mar 01, 2008 at 06:57 UTC | |
I do not expect a meaningful response to this, because that would require you to actually consider my arguments rather than using spoiling tactics, like exploiting a typo , to dismiss them. I've long known that American isn't your native language. (The "Uk" in your nickname gives it away.)
This does not respect the level of the invoking code in the callstack. Every test function is exportable and composable, and as such has to set the level at which to print the call trace appropriately.
This prints to the wrong filehandle, so diagnostics might not appear in the output stream.
This doesn't check the test numbers for sanity. And also consider the less than stellar syntax that it requires. Besides the camel case, it's not too ugly. If you are, at the lowest level, going to kick the responsibility of performing a comparison test off to Perl's parser (via string eval), why bother with interspersing all the layers between those comparisons and the Perl parser? "Hey, if you're going to calculate the Fibonacci function in every Haskell tutorial, why bother writing a program? Why not just look it up in a book?" I'm sure you could trivialize any program to its least interesting part and dismiss it completely for being most uninteresting. I get it. You don't care about any of the other features Test::Builder provides. That's fine. I don't care. You don't have to use them. Those other features solve plenty of problems for plenty of other people using plenty of other languages and frameworks. You don't have to care about that, either. I can't understand why you do, but that's fine too. They remote me from the code being tested. Yes. That's the point. That's exactly why TAP exists, and it's why we can use the Perl test infrastructure to manage Parrot's tests, for example, which are written in Perl 1, Perl 5, Perl 6, Tcl, Lua, Pheme, C, Ruby, PIR, PASM.... Most damning, they prevent me from using the full power of perl to construct my test suite because I am always having to service the needs of the test tool infrastructure by reducing all my tests to simple yes/no answers. That's half true. It's true in that all good tests ultimately have a yes or no answer. It's false in that the entire point of extracting Test::Builder is so that people could use the full power of Perl to construct test suites without having to service the needs of the test tool infrastructure and without having to worry about the interaction of other parts of the test suite they might also want to use. | [reply] [d/l] [select] |
| |
by shmem (Chancellor) on Mar 01, 2008 at 13:11 UTC | |
--shmem
| [reply] [d/l] |
|
Re^4: "Practices and Principles" to death
by ack (Deacon) on Mar 01, 2008 at 01:47 UTC | |
Wow! Outstanding points! I, too, am not much for that "bull in the china closet" strategy for trying to change the world; but I also realize (probably because of many of my own frustrations with the process) that sometimes the insensibilities we're faced with just get to be too much...and we end up railing...witness my own exagerations that you so aptly pointed out. So I think I took his forcefullness more in the line of venting frustrations than the approach that he would take in the work-place. But then again I am often accused of being too optimistic about people. Your comments strike a particularly strong, sympathetic chord with me...as you would probably guess. More importantly, you summarized what I was trying to say in a much more succinct way...than my own long-winded writing. Thank, you. So here is my question: How does one help encourage/incite people to 'think'? That is my daily challenge...and quest.
ack
Albuquerque, NM
| [reply] |
by chromatic (Archbishop) on Mar 01, 2008 at 06:41 UTC | |
How does one help encourage/incite people to 'think'? To some degree, you can't. To the degree you can, I find that imitating Ward Cunningham is almost always the most effective approach. Ward has an amazing way of asking, "Hm, well what if you were to _____?" where the fill-in-the-blank-spot is almost always something so simple and non-offensive that anyone remotely thoughtful starts thinking when he or she hears it. Unfortunately, I've met very few people who have that staggering ability to simplify a problem to its simplest form. I don't have it. Ward does. | [reply] |