DBI::Test
-----------------------------------

Several of use DBI/DBD developers were playing with an idea for a long
time to come to a new way of testing DBI and DBD and especially the API
as defined by the DBI.

We have noticed in several occasions that the DBI defines the API,
where testing the API is hard because there is not (yet) an actual
database on the backend (no functional DBD) and from the other side
(the DBD) some of these tests are quite the same, just to test if the
API as documented from the DBI is working as expected from the DBD
point of view.

The plan has grown to create a new module that would replace the API
tests in the DBI test suite and that can also be used without
modification in the DBD test suites.

This way we can assure that all documented API is tested the same way
from both sides. As a bonus, we can have the DBD check that ALL DBI
functionality is implemented (or documented not to be) and that all
functionality (like logging) are dealt with in the way the end-user is
expecting the DBI/DBD to work.

As the Lancaster Consensus has come to the conclusion that the new
toolchain can expect a minimum of perl-5.8.1 (which might be raised to
5.8.4 when the need arises), we have set the lower bound for DBI::Test
to be 5.8.1, which includes the use of recent Test::More and the use of
done_testing (); (no plans).

What the end-user sees:       http://tux.nl/Talks/images/dbi-dbd.png
How that is currently tested: http://tux.nl/Talks/images/testing.png
What the new plan would be:   http://tux.nl/Talks/images/dbi-api.png

The team that is currently working on this plan, as started on the QA
hackathon in Lancaster, is

 Name             IRC (irc.perl.org/6667 #dbi)
 ---------------- ----------------------------
 Jens Rehsack     Sno
 Peter Rabbitson  ribasushi
 H. Merijn Brand  Tux
 Joakim Tørmoen   trmjoa

with a possible new member soon: Vince Willems

You can watch the effort in https://github.com/perl5-dbi/DBI-Test
The notes made in Lancaser are in
https://github.com/perl5-dbi/DBI-Test/blob/master/sandbox/qa2013-notes.txt

Jens is currently working on DBI::Mock, which is needed for DBI-less
tests (SQL::Statement) and for testing DBI::Test itself

Joakim is writing the tests. Some are there, and the aim is to have a
small focussed working test before aiming at completeness, so we can
test with actual DBD's and have feedback early in the process. Joakim
will be supported by Peter, who will coordinate the test setup.

The plan is to support a full matrix of tests, including both DBI/XS
and pure-perl DBI, as well as with and without proxy or other optional
parts. There will be a possibility to skip pure-perl DBI (DBD::Oracle,
DBD::CSV with Text::CSV_XS) or to skip DBI/XS (DBD::Pg_PP, DBD::CSV
with Text::CSV_PP).

I will set up a basic readme, with some of this mail and references to
the mailing list and repository, the aims and the plans.

As there already seems to be a DBI::Test here:
https://metacpan.org/module/DAVEBAIRD/Class-DBI-FormBuilder-0.481/DBI/Test.pm
I might have to contact him to see what we can work out in that
namespace. Hopes are not really high: his last update was 2008.

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.17   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

Reply via email to