[Xotcl] test driven development

Gustaf Neumann neumann at wu-wien.ac.at
Tue Apr 26 14:54:16 CEST 2011


Just to provide a short addon to stefan's long response:
  - some tests in xotcl/nx are indeed legacy of otcl 
(testo.xotcl).
  - the first generation of regression tests were written in 
the otcl style (testx.xotcl).
  - these tests are in part "designed", but also in part 
tricky cases derived from bug reports.
    Many of these tests are rather integration tests than 
unit tests, testing interdependencies of language features. 
 From the debugging point of view these are a mess, since it 
might take quite some time to find the source of a 
misbehavior. At the same time, these are real-world examples 
and they are valuable for the project, since these are 
testing simultaneously several complex features, so i'll 
leave these for the time being.

The newer generation of tests (package nx::test) are built 
just around the needs of xotcl/nx, for making testing more 
convenient. nx::test  is an
  - oo-based test environment with
  - automated cleanup for the objects created in a test run,
  - provides error/exception handling and
  - simple means for speed comparison,
  - triggers routines for internal (c-level) consistency 
checking, and
  - provides a simple syntax


Writing test environments in Tcl is very simple and quite 
straightforward, but depending on your needs, different 
approaches are reasonable.

In case, you are in an environment where you are using 
already many xUnit tests for several other languages, and 
you are using eclipse, you might find xounit from Ben 
Thomasson useful (some more pointer in addition to Stefan's)
http://xotcllib.sourceforge.net/xounit.html
which seems to be integrated via plugin into eclipse.dltk
http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.dltk/xotcl/plugins/org.eclipse.dltk.xotcl.testing.xounit/?root=Technology_Project&sortby=author
http://download.eclipse.org/eclipse/pde/apitools/eclipse-galileo-rc4/api-html/org.eclipse.dltk.core/org.eclipse.dltk.xotcl.testing.xounit/org.eclipse.dltk.xotcl.testing.xounit.html

some people seem to like tclTkUnit (which disappeared from 
the public pages a few years ago) which is as well modeled 
close to JUnit:
http://classic-web.archive.org/web/20080822172425/http://park.ruru.ne.jp/ando/work/tclTkUnit/

-gustaf neumann


More information about the Xotcl mailing list