pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig Ringer <craig@2ndquadrant.com>
Cc: Jankirk.Vincent., Jamison <k.jamison@jp.fujitsu.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: On Judging the Value of Tests
Date: Wed, 22 Nov 2017 00:37:07 -0500
Message-ID: <20667.1511329027@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMsr+YF1JDerigv7gM9b8Umut_=TU-cm0Ys+t+kU7oqqQAR+CQ@mail.gmail.com>
References: <D09B13F772D2274BB348A310EE3027C61CD78D@g01jpexmbkw24>
	<CAMsr+YF1JDerigv7gM9b8Umut_=TU-cm0Ys+t+kU7oqqQAR+CQ@mail.gmail.com>

Craig Ringer <craig@2ndquadrant.com> writes:
> On 22 November 2017 at 08:43, Jankirk.Vincent., Jamison <
> k.jamison@jp.fujitsu.com> wrote:
>> 1.      How do you judge when a test suite is acceptable to be added to
>> Postgres OSS source code? (How do you judge the value of a test suite?)

> Make your argument for it, and see if others agree. There's no formal
> process.

Yeah.  Also realize that we've been accreting test cases for ~20 years,
and there's never been any master plan about what to test.  So there's a
lot of individual test cases of varying quality/value, and you shouldn't
necessarily take any one existing test as gospel.  I don't hold that out
as a great example of software engineering, but it's the truth.

> Inputs into the decision making process include:

> * How much coverage of previously untested functionality it adds
> * How much code coverage it adds
> * How long the test takes to run, especially considering the slow buildfarm
> boxes and development turnaround time
> * Whether the test fits into one of the existing suites we run routinely,
> or requires separate steps
> * How much work will be required to maintain the test

Also, portability/repeatability.  If it doesn't produce the same answers,
with very high probability, across all the platforms we support, it isn't
going to last long.

>> 3.      Is there a standard way of writing tests on the source code that
>> we should follow, like when should test be written in TAP/SQL/C formats and
>> how long should it be?

> In general, prefer pg_regress if you can use it. Isolation tests for
> concurrency issues.  TAP tests if you can't write it with pg_regress or
> isolation tester. Test modules only if you really must.

Right.  This ties in closely to the incremental runtime needed for one
additional test case.  A new query or two in an existing SQL regression
script adds little overhead.  A new TAP test adds quite a bit.

>> 4.      In the src/test/examples directory (which are all libpq tests),
>> why is the “examples” directory not included when building postgres?

I've always taken those to be more documentation, or sample code, than
test cases.  I'm not sure why they're under src/test/ at all.

			regards, tom lane




view thread (6+ messages)  latest in thread

Message-ID: <20667.1511329027@sss.pgh.pa.us>
Permalink:  ../20667.1511329027@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20667.1511329027@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, craig@2ndquadrant.com, k.jamison@jp.fujitsu.com
  Subject: Re: On Judging the Value of Tests
  In-Reply-To: <20667.1511329027@sss.pgh.pa.us>
  References: <D09B13F772D2274BB348A310EE3027C61CD78D@g01jpexmbkw24> <CAMsr+YF1JDerigv7gM9b8Umut_=TU-cm0Ys+t+kU7oqqQAR+CQ@mail.gmail.com> <20667.1511329027@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox