Re: [pear-webmaster] Re: [PEAR-DEV] Services_Digg not valid?
| From: | Gregory Beaver | Date: | Sun, 20 May 2007 22:31:41 +0000 |
| Subject: | Re: [pear-webmaster] Re: [PEAR-DEV] Services_Digg not valid? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.pear.webmaster |
| Request: | Send a blank email to pear-webmaster+get-5916@lists.php.net to get a copy of this message | ||
Helgi Þormar wrote:
> On 5/20/07, *Gregory Beaver* <greg@chiaraquartet.net
> <mailto:greg@chiaraquartet.net>> wrote:
>
> David Coallier wrote:
> > Helgi for you, even with the error it generated, I am glad that you
> > remvoed DB_Storage from pearweb, we can now have a fully-blown MDB2
> > setup. And what about DBDO ? Have you removed it yet ? Anyone did ?
>
> Anyone who does this without full regression tests in place to
> prove the
> correctness will do so over my dead stinking body.
>
>
> True enough, I'm in no rush to remove DBDO
>
> Sincerely,
> Greg
>
> P.S. Write those dang tests!! :)
>
>
> Dunno, can't say I like how it's structured, I just can't see the
> point in testing the queries this way oppose to just checking if we
> get an SQL error back (which we can add to each function and throw
> back for the tests to catch) when we try the function ... just looks
> overly complicated to me.
Hi,
It may not be obvious, but the new system will work on a computer that
does not have any database installed at all. The database is entirely
fictitious, which means we have the ability to test not just which
queries are returned, but how the code will respond to database errors
that are impossible to reproduce consistently (such as the database
being down).
The extra setup of queries is also easy because the test exits and tells
you the query string it does not recognize. This can be used both to
test for correct response to queries and for correctness of queries
themselves.
I already used it to remove an unnecessary query in the pear_rest class
that I didn't realize was unnecessary until the test.
Unit tests that make it easy to optimize = a good thing.
Give it a try, see what you think. I have plenty of experience porting
unit tests over to other formats, it is painful but not difficult, so we
can always re-work them later if necessary. The porting I did was from
PHPUnit->phpt which was *way* more painful than redoing the query testing
Greg