[Xotcl] test driven development

Stefan Sobernig stefan.sobernig at wu.ac.at
Tue Apr 26 12:40:14 CEST 2011


Victor,

> I am beginning to learn and use test driven development in my
> projects. I've noticed that NX does not use the standard "tcltest"
> package in Tcl but instead provides it's own "nx::test". Is there a
> specific reason for that?

I can't give you the full story, only some observations of mine. To some 
extent, nx::test and especially its predecessors (xotcl::test) are a legacy:

OTcl had its own testing environment, not using or not building upon 
tcltest, and so had XOTcl; see e.g. 
http://otcl-tclcl.cvs.sourceforge.net/viewvc/otcl-tclcl/otcl/lib/test.tcl?view=markup

test migration vs. test continuity so is the issue here. also: nx::test 
& friends have always been used to test core functionality of the 
language system, rather than application testing. for your XOTcl/nx 
application, tcltest is certainly a viable option (coming with nice 
helpers actually missing in nx::test). another answer along these lines 
is probably that a home-brewed testing evironment is usually one of the 
first prototype applications written by the language authors in their 
language.

as for application testing, however, an object-aware testing environment 
comes handy; you can refine your test suites occasionally through 
mixins; or nx::test traces object lifecycles during test execution to 
maintain a prestine testing sandbox to avoid unwanted test interactions. 
however, that does not mean that you could not realise all of this using 
tcltest.

some further pointers, especially when it comes to TDD (which is, by the 
way, something different than merely writing and executing tests in the 
sense of tcltest or nx::test):

Two or three years ago, I had a look at a xUnit framework for XOTcl:
http://xotcllib.cvs.sourceforge.net/viewvc/xotcllib/xounit/

While it gave me a xUnit environment, it found it incomplete and its 
implementation rather clumsy (including its usage of Exception objects 
ontop of Tcl's error control flow mechanism).

More recently, Mark published on a scenario-driven approach and 
prototype framework (STORM) which I successfully used in one or two dev 
projects of mine. It comes with essentials concepts for applying a 
test-first development approach:

http://wi.wu-wien.ac.at/home/mark/publications/se2011-extended.pdf

I don't know whether the prototype implementation (the XOTcl script) is 
publicly available, but you could most certainly talk Mark into 
providing it to you :)

//stefan










>
> Thanks,
>
> Victor
> _______________________________________________
> Xotcl mailing list
> Xotcl at alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
>


-- 
Institute for Information Systems and New Media
Vienna University of Economics and Business
Augasse 2-6, A-1090 Vienna

`- http://nm.wu.ac.at/en/sobernig
`- stefan.sobernig at wu.ac.at
`- ss at thinkersfoot.net

`- +43-1-31336-4878 [phone]
`- +43-1-31336-746 [fax]


More information about the Xotcl mailing list