I would like to see Jena adopt a set of contract tests. I recently wrote
an article for Dr. Dobb's [1] concerning contract testing. In it I use the
experimental/new_tests as an example.
The basic concept is we provide a set of contract tests for expected
extension points like the Graph SPI. Implementers of Graph would be able
to run the contract test to ensure that their implementations match what is
expected. To be honest, I have implemented what I thought was a proper
Graph implementation only to find that it was missing some component.
My proposal is that as we go through the process of refactoring and
building version 3 we create contract tests for the extension points. In
so doing we can more completely document what the requirement is and
provide a test for it.
For example the a Graph contract test case may be:
/* Inserting into the graph requires that the graph listener be notified of
the insertion. */
@ContractTest
public void notifyInsertion()
{ ..... }
Any thoughts or objections?
Claude
[1] http://www.drdobbs.com/testing/simplifying-contract-testing/240167128
--
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren