OT: Unit Tests

David Bovill david at openpartnership.net
Wed Jun 27 14:33:59 EDT 2007


Ignore this if your not into this sort of thing - it's overkill for most
things - I'm just adding it as polish.

I have just started working on adding Unit Tests to the open source handler
library. I am just going to hack it right now by taking the basic framework
I had in my old offline library and essentially doing the same online using
Rev cgi's.

I've done a little research to catch up on the latest developments - but
nothing much has turned up so i am keeping it simple at the moment based
around - http://en.wikipedia.org/wiki/XUnit.

The idea I am working on at the moment is that the handlers are kept as text
files on the server and that these text files also include a full suite of
tests to run against the hander.

Changes or improvements to a handler can then be tested locally by fetching
the tests and data from the server, and if the new version passes the tests
uploaded where it will again be tested and run against the server before
committing it to subversion. The embedded test suite also includes internal
references to values used in the tests and the values of the results that
pass the tests. To make development of test easier there will be a Rev
client that allows creating and running simple scripts against the handler,
and throwing a bunch a default data at it. Finally if the handler has any
dependencies (ie it calls other handlers in the hierarchy) these are fetched
and added to the script - so that the whole test is self contained.

I'd like to add benchmarking and other features to this stack if there are
any samples knocking around that I can freely incorporate . Also if anyone
has any real experience of unit tests in other languages it would be good to
get some tips - in fact ideally the tests would be described in a
semi-language neutral way - so that the same test could be run against
various languages using the same data and speed, legibility and other
factors could be compared - but AFAIK these things remain language specific?



More information about the use-livecode mailing list