PostgreSQL unit tests

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: PostgreSQL unit tests
Date: 2006-02-22 06:27:02
Message-ID: 9957985C-5FC8-4816-89B3-D18D50A31BA4@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

During Josh Berkus' presentation at the JPUG PostgreSQL Conference, I
was particularly struck by the fact that 8.1 had a shorter beta
period than previous releases, rolled out on time, and enjoyed a
longer period before the first post-release bug was reported. The
PostgreSQL Build Farm played a key role in making these possible.
(Thanks again, Andrew!)

Something that has been briefly discussed in the past wrt PostgreSQL
has been unit testing to complement the current regression tests.
I've taken a very quick google to see what's out there for C unit
testing frameworks. The ones I found are:

Check (GPL)
GNU Autounit (GPL)
CuTest (GPL? zlib/libpng?)
CUnit (GPL)

There also appears to be a separate cUnit framework, but the web page
was unavailable when I checked.

Of these, Check and GNU Autounit set aside a separate, protected
address space for running tests.

(Almost?) all of these frameworks are GPL. I'm assuming this is
probably going to be an issue with distribution, presumably a non-
starter. I wonder if it would be feasible to maintain the unit
testing framework on Pgfoundry, available for those who wish to run
the tests? If the unit tests were to be run on the build farm
machines, that would mean additional dependencies, but perhaps that
can be configured to be relatively painless (and perhaps completely
automated).

On a related note, Neil brought up QuickCheck in a blog entry[1], and
mentioned in particular "try[ing] to define a domain-specific
language that would allow you to construct random SQL queries that
satisfy certain high-level constraints, and then verify that the
backend executes those queries correctly".

I'm interested in hearing others' thoughts on this. What other

Michael Glaesemann
grzm myrealbox com

[Check](http://check.sourceforge.net/)
[CuTest](http://cutest.sourceforge.net/)
[CUnit](http://cunit.sourceforge.net)
[cUnit](http://people.codefactory.se/~spotty/cunit/)
[GNU Autounit](http://www.recursism.com/s2004/zp/products/gnu+autounit)

[1](http://www.advogato.org/person/nconway/diary.html?start=21)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2006-02-22 07:23:00 Re: windows / initdb oddness
Previous Message Mark Kirkwood 2006-02-22 05:58:17 Re: pg_config, pg_service.conf, postgresql.conf ....