Hi, all,
The experience of two major deployments of citeproc-js has driven home
the value of the test suite fixtures. But after writing upward of 640
of the things, I don’t relish the idea of continuing to do this by
hand.
Thanks to generous feedback from many quarters, the processor itself
now seems to be pretty well under control. The problem of style
testing remains with us, however, and the bottleneck is obvious; no
one in their right mind is going to sit down and write the hundreds of
tests that would be required to prove that any individual style is
trouble-free. Yet that level of testing will be needed, it seems to
me, if we want CSL to establish solid credibility with and find favor
among major publishers.
The “syntax” of the test fixtures is admittedly a dog’s breakfast
currently, set up in a rush before speeding forward with the coding.
JSON has been used to describe the input data mostly because it does
not require conversion (saving me the time required to write a
converter), and because typing hundreds of tests in JSON by hand is at
least a little less painful than writing hundreds of tests in XML.
However, now that we have the processor running in at least two
interactive applications, recasting the fixtures in a single uniform
syntax seems a good idea, and the obvious choice would be XML.
What would make XML attractive at this point is that we now have
citeproc-js running in two (2) interactive applications, with many
thousands of users between them. Users typically recognize style
errors when they are entering citations in the word processor. At that
point, the document state is instantiated in the processor registry,
and can be readily accessed via JS. It would be very simple to build a
DOM construct containing the items cited, the citations set in the
document, the context (bibliography/citation), and the expected result
string (provided by the user), and the style code or a pointer to the
style in use (if a standard style), and to dump that to disk. Such a
reporting facility would save time in the fielding of user error
reports, and it would make it possible to contemplate building
comprehensive test suites for individual styles.
So … it would be a great help to the cause if a persevering soul or
hungry intern could be persuaded to produce a plugin or extension for
use with one or both of our citeproc-js-consuming projects, offering
a “Report style error” button in the respective word-processor plugin
menu. I would be very (very) happy to adapt the citeproc-js test
runner to process such output, and (although I’m only guessing) I
reckon that the same goes for Andrea Rossato and other developers.
One could even argue that a robust set of style-level tests, coupled
with a simple CSL IDE built with, say, xulrunner, would have a greater
impact than a style editor, since you could then (safely) rely on
contributions by amateur programmers and relative newcomers to the CSL
scene as collaborative style maintainers.
So that’s the pitch. I should add that I’m unlikely to undertake such
a project off my own bat, as the processor is looking pretty stable,
and need to get on with other tasks. But I do think this would be a
good thing for CSL, so I thought I would float the suggestion, in case
anyone out there is in a Christmas mood vis-a-vis our expanding
community.
Frank
(cross-posted to citeproc-js list, with apologies for any double-deliveries)