[Koha-devel] Regression considered harmful

Jared Camins-Esakov jcamins at cpbibliography.com
Sat Jun 23 23:16:34 CEST 2012


Hello.

Regardless of your stance on goto statements (and I would note that they
are thankfully pretty scarce in the Koha codebase, with the exception of
sms/sms_listen.pl, which has a surprising number for a 126-line script), I
think we can all agree that regressions in Koha's functionality are a very
bad thing. Well, I have a proposal for one way we might go about cutting
down on regressions, *and* saving testers time: Test::WWW::Mechanize.

By adding tests that use Test::WWW::Mechanize, it would be possible to
include unit tests that confirm that the interface (at least the parts that
are not Javascript-dependent) continues to function as intended. I find
this an extremely promising concept, and one that I would *love* to put
into practice in my Release Maintaining of 3.6.x (whether the tests are
committed to Koha, or whether they are in a separate repository).

So, what can you do to help us reach our lofty goal of no regressions,
ever, and no simple regressions requiring people-hours to identify? Easy!
Start writing those tests! I filed a bug (
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8300) and attached
a unit test that checks the stage MARC import tool is still looking. Take a
look, and think about whether you could come up with some scripts.

Lest you think that writing this sort of unit test has to be hard, I have
good news! It's not actually all that hard. Documented on the wiki we have
instructions for setting up an http-recorder proxy to simplify your test
writing to the very basics: go through the steps with your web browser,
save the resulting file, and change get() to get_ok() and click() to
click_ok() (yes, it really can be that simple). Moreover, I have documented
the two gotchas that we have encountered with this so far on the wiki, and
I will continue to document the solutions to problems I encounter. So, what
are you waiting for? Get thee to the wiki and begin testing!
http://wiki.koha-community.org/wiki/Interface_testing_with_WWW::Mechanize

Regards,
Jared Camins-Esakov

-- 
Jared Camins-Esakov
Bibliographer, C & P Bibliography Services, LLC
(phone) +1 (917) 727-3445
(e-mail) jcamins at cpbibliography.com
(web) http://www.cpbibliography.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-devel/attachments/20120623/c0c42eaf/attachment.htm>


More information about the Koha-devel mailing list