On 1 Mar 2007, at 18:15, Andrew Gianni wrote:
To test the rules you could maybe extend the rule notation to allow
assertions to be expressed as part of the rule set and write a test
harness that uses your (now proved) rules engine to test the assertions.

That's sort of what I was thinking. There's no point in going through the
CGI interface to test the rules, or even the application framework
interface, minus CGI. The rules engine is general enough that we can
probably write a relatively straight forward interface that allows us to pass data directly to the engine and simply ensure that the results are what
we expect. Is that basically what you were suggesting?

Pretty much.

It's potentially a great example of testing improving your code quality in ways other than the obvious 'does it work?'.

In addition to the benefits of test coverage you're being persuaded to decouple components from one another so they can be used both for testing and in the application - which is in general a good thing.

If you get it right it'll also be a great help to the people writing the rules. You can give them a tool which allows them to start with an assertion and work backwards to a rule that implements it. They'll be able to do their own testing on the rule outside of the live application.


--
Andy Armstrong, hexten.net

Reply via email to