[Push] Tests

PerPlex Ed edperplex at yahoo.com
Wed Jun 30 04:06:36 EDT 2010


The reason for a format of this kind for sharing a test database instead of the simple "Push Truth" format is that <Snapshot> can be extended to contain all the internal information about the interpreter's internal state (for example, if it's quoting names or not).

A <Snapshot> could be provided after every instruction evaluation and used to compare in detail the behaviour of different interpreters.

I discovered more bugs running random code than running the set of truths that Marrten kindly shared. In fact, after I fixed one bug, all those tests ran successfully with the first version of my interpreter. On the other side, in the next couple of days I found many bugs running the random code generation and evaluation tests.

The problem with detailed comparison of random code running on different interpreter is that the *.Rand instruction must be excluded, because they will obviously generate different states and the floating point precision.



PerPlexEd said:

>Is a database in a format of this kind usable by other people too?

<?xml version="1.0" encoding="utf-8"?>
<RandomCodeTest ImplementationName="Push/PerPlexEd" 
ImplementationVersion="23 06 2010 17:16:52" LanguageVersion="3" 
Timestamp="26 06 2010 02:36:11">
  <History>
    <Run>
      <Snapshot>
        <BooleanStack />
        <IntegerStack />
        <FloatStack />
        <NameStack />
        <CodeStack />
        <ExecStack />
      </Snapshot>
      <Program>((Code.NoOp) (Exec.Do*Range Code.Do*Range 
Env.MaxRandomFloat) (Integer.Shove (Exec.Do*Times Float.%)) (Float.+ 
(Code.Discrepancy (Boolean.FromFloat Integer.% (Float.Rot) (Code.Pop)) 
Env.MaxPointsInProgram Float.Tan) (Float.Swap (Boolean.YankDup Code.Do) 
(Code.YankDup Code.FromBoolean) (Float.Rot) ((Code.Length Float.Pop 
Code.Rot) ((Float.+) Integer.Shove) Name.RandBoundName)) ((Integer.Dup 
Code.YankDup (Integer.Min (Name.StackDepth) Name.Dup)) Integer.+ 
((Code.FromFloat (Code.FromBoolean)) Code.If)) Code.Yank) Name.Shove 
((Name.Yank) Name.YankDup) ((Code.Position Integer.Dup Exec.Do*Range 
Code.Null) ((Code.Do*Count) Integer.+) (Exec.StackDepth 
Float.FromBoolean) Integer.=) (Float.Pop))</Program>
    </Run>
    <Run>
      <Snapshot>
        <BooleanStack>true</BooleanStack>
        <IntegerStack>200</IntegerStack>
        <FloatStack>0.067967768541529722</FloatStack>
        <NameStack>$76653AD0</NameStack>
        <CodeStack />
        <ExecStack />
      </Snapshot>
      <Program>((((Name.Quote Code.Position Float.Swap Env.Types 
(Code.Extract Code.List)) Boolean.Flush Code.Null) 
(Env.MaxRandomInteger) ((Integer.Dup) (Integer.Shove) ((Code.Rand) 
(Code.Pop) Code.Do*Times (Name.Rand Exec.=) Name.Swap) Exec.Do*Times) 
Float.Rand (Name.RandBoundName (Code.FromBoolean Code.Append Integer.*) 
Float.StackDepth Boolean.Yank) Code.Do*Count) Code.Container 
((Exec.StackDepth) Name.RandBoundName) Code.NoOp)</Program>
    </Run>
    <Run>
      <Snapshot>
        <BooleanStack />
        <IntegerStack>0</IntegerStack>
        <FloatStack>0.99874998442799556</FloatStack>
        <NameStack />
        <CodeStack />
        <ExecStack />
      </Snapshot>
      <Program>((Name.Yank Exec.Do*Times ((Float.Rot) 
(Code.FromName Name.Rot) Float.Shove Float.Min (Float.Rot))) (((Float.=) Boolean.Yank) Code.Append (Boolean.=) Code.Yank) ((((Code.Do*Times) 
(Name.Shove Integer.Rot) Float.Rand) Boolean.Not) (Integer.Pop Float.+) 
Name.StackDepth) Boolean.Pop)</Program>
    </Run>

...etc.etc....

  </History>
</RandomCodeTest>


      

_______________________________________________
Push mailing list
Push at lists.hampshire.edu
https://lists.hampshire.edu/mailman/listinfo/push



      



More information about the Push mailing list