Re: Add more regression tests for dbcommands

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Robins Tharakan <tharakan(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add more regression tests for dbcommands
Date: 2013-06-27 15:35:12
Message-ID: 51CC5BB0.4050509@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/27/13 10:57 AM, Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> On 6/26/13 12:17 PM, Tom Lane wrote:
>>> (I like to
>>> point at mysql's regression tests, which take well over an hour even on
>>> fast machines. If lots of tests are so helpful, why is their bug rate
>>> no better than ours?)
>
>> Tests are not (primarily) there to prevent bugs.
>
> Really? Pray tell, what do you think they're for? Particularly code
> coverage tests, which is what these are?

Tests document the existing functionality of the code, to facilitate
refactoring. (paraphrased, Uncle Bob)

Case in point, the existing ALTER DDL code could arguably use even more
refactoring. But no one wants to do it because it's unclear what will
break. With the proposed set of tests (which I have not read to
completion), this could become quite a bit easier, both for the coder
and the reviewer. But these tests probably won't detect, say, locking
bugs in such new code. That can only be prevented by careful code
review and a clean architecture. Perhaps, MySQL has neither. ;-)

Code coverage is not an end itself, it's a tool.

In this sense, tests prevent existing functionality being broken, which
might be classified as a bug. But it's wrong to infer that because
system X has a lot of bugs and a lot of tests, having a lot of tests
must be useless.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-06-27 15:39:43 Re: Reduce maximum error in tuples estimation after vacuum.
Previous Message Robert Haas 2013-06-27 15:34:39 Re: Documentation/help for materialized and recursive views