Forth Testing Tools?
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.forth Profile…
 Up
Forth Testing Tools?         


Author: Josh Grams
Date: Feb 24, 2008 09:52

Are there other Forth testing tools out there?

I've tried using the Hayes tester a couple of times. I like the
syntax
and simplicity, but its failure messages are just useless. If I have
to
go back and insert debug statements and re-run the tests to figure out
what actually went wrong, why bother using it at all? I might as well
just write ad-hoc test code and shove it in a file.

I want something that (at least) displays the actual and expected
stack
contents, and preferably something that can be extended to deal with
strings or other data. I'd love to be able to do:

T{ 1 2 3 => 1 5 }T
T{ s" abcdef" 2 /string => s" def" }( string )T

And see:

T{ 1 2 3 => 1 5 }T
Returned: <3> 1 2 3
Expected: <2> 1 5
Show full article (0.91Kb)
24 Comments
Re: Forth Testing Tools?         


Author: Anton Ertl
Date: Feb 24, 2008 13:10

Josh Grams qualdan.com> writes:
>I want something that (at least) displays the actual and expected
>stack
>contents, and preferably something that can be extended to deal with
>strings or other data. I'd love to be able to do:
>
>T{ 1 2 3 => 1 5 }T
>T{ s" abcdef" 2 /string => s" def" }( string )T
>
>And see:
>
>T{ 1 2 3 => 1 5 }T
>Returned: <3> 1 2 3
>Expected: <2> 1 5
>
>T{ s" abcdef" 2 /string => s" def" }( string )T
>Returned: <2> $8070938 4 ("cdef")
>Expected: <2> $8070948 3 ("def")
>
>Anybody have something like that, or should I roll my own? ...
Show full article (1.09Kb)
no comments
Re: Forth Testing Tools?         


Author: Dennis Ruffer
Date: Feb 24, 2008 15:43

On 2008-02-24 14:10:47 -0700, anton@mips.complang.tuwien.ac.at (Anton
Ertl) said:
> Josh Grams qualdan.com> writes:
>> I want something that (at least) displays the actual and expected
>> stack
>> contents, and preferably something that can be extended to deal with
>> strings...
Show full article (4.43Kb)
no comments
Re: Forth Testing Tools?         


Author: Albert van der Horst
Date: Feb 24, 2008 18:39

In article <154c0481-de36-4f57-a9c2-80f2d4dec4b1@c33g2000hsd.googlegroups.com>,
Josh Grams qualdan.com> wrote:
>Are there other Forth testing tools out there?
>
>I've tried using the Hayes tester a couple of times. I like the
>syntax
>and simplicity, but its failure messages are just useless. If I have
>to
>go back and insert debug statements and re-run the tests to figure out
>what actually went wrong, why bother using it at all? I might as well
>just write ad-hoc test code and shove it in a file.

The merit of tsuite.frt is that it is comprehensive.

One of the last errors in the Renesas Forth was in <.
Gosh, forget to push the result on the stack. What would you want
more than the information that < doesn't work?
Show full article (1.78Kb)
no comments
Re: Forth Testing Tools?         


Author: Ed
Date: Feb 25, 2008 04:52

"Albert van der Horst" wrote in message news:jwrwq5.g14@spenarnc.xs4all.nl...
> In article <154c0481-de36-4f57-a9c2-80f2d4dec4b1@c33g2000hsd.googlegroups.com>,
> Josh Grams qualdan.com> wrote:
>>Are there other Forth testing tools out there?
>>
>>I've tried using the Hayes tester a couple of times. I like the
>>syntax
>>and simplicity, but its failure messages are just useless. If I have
>>to
>>go back and insert debug statements and re-run the tests to figure out
>>what actually went wrong, why bother using it at all? I might as well
>>just write ad-hoc test code and shove it in a file.
>
> ...
>>Anybody have something like that, or should I roll my own?
>
> We did something like that for tforth. The testing system was
> so sophisticated that...
Show full article (2.03Kb)
no comments
Re: Forth Testing Tools?         


Author: Josh Grams
Date: Feb 25, 2008 07:40

On Feb 24, 9:39 pm, Albert van der Horst
wrote:
>In article <154c0481-de36-4f57-a9c2-80f2d4dec...@c33g2000hsd.googlegroups.com>,
>Josh Grams qualdan.com> wrote:
>
>One of the last errors in the Renesas Forth was in <.
>Gosh, forget to push the result on the stack. What would you want
>more than the information that < doesn't work?

Well, if I'm the one *writing* the Forth (which is the situation I'm
talking about), I want to know exactly HOW it didn't work. Did it
forget to push the result? Did it push a wrong result? Did it push
an
extra result? Even if I'm not the author, I still want good failure
messages so I can file a decent bug report.
>>I want something that (at least) displays the actual and expected
>>stack contents...
>
>I want to see nothing, because that means the test has passed.
Show full article (2.08Kb)
no comments
Re: Forth Testing Tools?         


Author: Charles Turner
Date: Feb 26, 2008 04:14

On Feb 25, 10:40 am, Josh Grams qualdan.com> wrote:
> And...I am going to write my own.  I know Dennis posted code, but I
> think my vision is different enough to justify experimenting a bit.

Go Josh!

Best, Charles
no comments
Re: Forth Testing Tools?         


Author: Gerry
Date: Feb 26, 2008 09:47

> Perhaps the greatest use for Hayes is for people who are
> upgrading a 79 or 83 forth system.  

I find the Hayes tester useful when developing an application, the
tests are written in parallel with the code and at the end you have
regression tests available for when the code is modified.

Gerry
no comments
Re: Forth Testing Tools?         


Author: Krishna Myneni
Date: Feb 26, 2008 16:20

Ed wrote:
> ...
>
> Which suggests that test suites are mostly a "feel good" utility
> i.e. one feels good when it passes but otherwise has little value.
> It impresses the customer but that's about all.
>
> Who would find Hayes useful? Probably not someone who has
> brought up a forth. ...

Are you considering only testing of Forth systems? What about using the test
suite to test applications? For instance, the extended version of the Hayes
tester, incorporating extensions by David Williams and Anton Ertl, have proved
valuable in finding problems with the Forth Scientific Library modules. These
problems went unnoticed for many years. The findings are documented in an
earlier thread on automated FSL tests.

Also, David Williams used the Hayes test suite to perform some stringent
regression tests on his ppc port of kForth. These tests uncovered several
problems with the x86 version, which were subsequently fixed.

Krishna
no comments
Re: Forth Testing Tools?         


Author: Josh Grams
Date: Feb 26, 2008 18:46

>Josh Grams qualdan.com> wrote:
>And...I am going to write my own. I know Dennis posted code, but
>I think my vision is different enough to justify experimenting a
>bit.

OK, I banged out a first draft...it basically works, and I've
tested the cases that I can think of. But it is a first draft,
and I've been staring at this code for too long at a stretch, so
I'd be surprised if I've caught everything.

http://qualdan.com/forth/tester-2008-02-26.tar.bz2

Any suggestions for how to improve this are welcome (I think).
Though...I did just ask for (and received) code and then went and
reinvented the wheel anyway, so... :)

I do have one question. It's easy to test without floats:

: environment? ( c-addr u -- false | i*x true ) 2drop false ;

But how do I test the combined float/data stack case? Anybody
have a Forth that does things that way? (x86 or PPC Linux,
preferably).

--Josh
no comments
1 2 3