Re: Test code is worth the space

From: David Fetter <david(at)fetter(dot)org>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Test code is worth the space
Date: 2015-08-18 13:16:00
Message-ID: 20150818131600.GB18054@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 18, 2015 at 02:03:19PM +0100, Greg Stark wrote:
> On Tue, Aug 18, 2015 at 6:57 AM, Noah Misch <noah(at)leadboat(dot)com> wrote:

> >> I suspect any effort to significantly improve Postgres test
> >> coverage is doomed until there's an alternative to pg_regress.
> >
> > There is the src/test/perl/TestLib.pm harness.
>
> Sadly I think the test suite is only half the battle. The coding
> style of Postgres predates modern test suite systems and makes it
> hard to test. Most functions require a specific environment set up
> that would be laborious and difficult to do in any sane way. Even
> something as self-contained as tuplesort would be difficult to test
> without the whole operator class and syscache mechanisms initialized
> and populated. And that's an easy case, imagine trying to test
> individual functions in the planner without doing a complete planner
> run on a query.

I'm given to understand that this tight coupling is necessary for
performance. Are you saying that it could be unwound, or that testing
strategies mostly need to take it into account, or...?

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-08-18 13:17:40 Re: Autonomous Transaction is back
Previous Message Greg Stark 2015-08-18 13:03:19 Re: Test code is worth the space