> > > I tried this once, for the lexical parser in a desktop calculator program > > > I wrote. It is a really liberating experience, and leads to greater > > > experimentation. > > > > the only problem is that usually to write some more advanced tests, you > > actually need to have some working code, since you have to debug the test > > itself. > > > > So I think that if you have this approach you write only the descriptions > > of the tests. Is that how you've done this? > > The testing engine was fairly simple: it created an instance of the lexer > class, ran the test input through it and printed out a representation of > the list of tokens that the parser returned.
So you wrote tests as you go, that's what I do. XP suggests to write tests before you code anything at all. That's something that I'm trying to grasp. It doesn't seem feasible to me, unless your tests are comments prose. [a nice explanation of how tests were properly written snipped] _____________________________________________________________________ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
