Test for Search.pm

Michael Leupold lemma at confuego.org
Sat Feb 28 12:04:54 UTC 2009


Hi,

with all the changes I recently did to Search.pm I figure it is pretty hard to 
find out if it's still behaving as it did before. As I didn't find any 
automated test I wanted to ask if you think that's something worth putting 
some effort into and if you have some ideas on how to construct such a test.

Basic idea so far:
- Construct an array of input searches and output SQL.
- If run, compare the SQL query Search.pm produced for each of the input 
queries with the stored output SQL in the array.
- If the SQL doesn't match, output so the developer can compare and check if 
searches are equivalent - if they are, replace the static query with the newly 
created SQL query before committing to make the test work

Problems with that:
- The SQL produced by Search.pm depends on the database type used
- AFAIK Search.pm needs a running database server (so it might not qualify for 
automatic testing in runtests.pl)

Of course you'd have to decide which queries to put into the test to cover as 
much functionality as possible

Regards,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.bugzilla.org/pipermail/developers/attachments/20090228/f78daa32/attachment.sig>


More information about the developers mailing list