Re: Test code is worth the space - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Test code is worth the space
Date
Msg-id CAM-w4HMw1QBWvZaS8LCjvMXhd4pvttAKOT2RC374GDCAA_T5Sg@mail.gmail.com
Whole thread Raw
In response to Re: Test code is worth the space  (Noah Misch <noah@leadboat.com>)
Responses Re: Test code is worth the space  (Peter Geoghegan <pg@heroku.com>)
Re: Test code is worth the space  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
On Wed, Aug 12, 2015 at 3:10 AM, Noah Misch <noah@leadboat.com> wrote:
> Committers press authors to delete tests more often than we press them to
> resubmit with more tests.  No wonder so many patches have insufficient tests;
> we treat those patches more favorably, on average.  I have no objective
> principles for determining whether a test is pointlessly redundant, but I
> think the principles should become roughly 10x more permissive than the
> (unspecified) ones we've been using.


I would suggest the metric should be "if this test fails is it more
likely to be noise due to an intentional change in behaviour or more
likely to be a bug?"

The only time I've seen pushback against tests is when the test author
made valiant efforts to test every codepath and the expected output
embeds the precise behaviour of the current code as "correct". Even
when patches have extensive tests I don't recall seeing much pushback
(though I've been having trouble keeping up with the list in recent
months) if the tests are written in a way that they will only fail if
there's a bug, even if behaviour changes in unrelated ways.

-- 
greg



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: count_nulls(VARIADIC "any")
Next
From: Peter Geoghegan
Date:
Subject: Re: Test code is worth the space