Compiler test report

Compiler test report
SchemeStation documentation

1 Introduction

The SCHEMESTATION cross-compiler and assembler are used to produce binary byte code objects to be run in the SCHEMESTATION operating system simulator.

This document describes the actual procedures used to test the compiler and the assembler, and the results of the tests. The tests were made according to the framework presented in Unit testing of the SchemeStation cross-compiler and assembler.

2 Testing procedures

The testing plan identified the following areas to be tested in the compiler (from now on, we use the word "compiler" to refer to the totality of the compiler and the assembler):

  1. Lexical parser
  2. Macro expansion
  3. Semantic optimizations
  4. Linearizer
  5. Peephole optimizer
  6. Assembler
  7. Complete functionality

In the actual testing these areas were combined in the following way:

  1. Lexical parser
  2. Macro expansion + semantic optimizations
  3. Linearizer + peephole optimizer + assembler

This was done for the following reasons: (1) No real semantic optimizations have been yet implemented in the compiler. (2) The workings of the peephole optimizer are currently almost trivial and can be evaluated in more efficient ways than white- or black-box testing. (3) There is currently no way to run SCHEMESTATION byte code without using the virtual machine, and using the virtual machine requires to use the assembler. So linearization cannot be tested without using the assembler at the same moment. Moreover, deassembler does not exist yet. The current structure of the compiler is such that these three ares cover most of the compiler's workings.

2.1 Lexical parser testing

The lexical parser was tested so, that test expressions were created by hand and automatically. Then they were read using (1) VSCM's, an established Scheme interpreter, read procedure, and (2) using the read procedure used in the compiler. It was then checked that the two procedures resulted in identical objects in the sense of equal?. The actual test cases used are found from Compiler test report: actual test cases.

Results: all test cases were correctly read.

2.2 Macro expansion testing

Macro expansion was tested so, that test expressions were created by hand and automatically. They were then expanded to the corresponding semantic trees in the compiler. However, linearization was not done but instead the semantic trees were evaluated according to their semantics, using a feature built in to the compiler. The same expressions were then fed to VSCM, and the results were compared. The actual test cases used are found from Compiler test report: actual test cases.

Results: all test cases were correctly expanded and evaluated.

2.3 Linearization testing

Linearization testing was tested so, that test expressions were created by hand and automatically. They were then compiled and assembled, and the resulting byte code was run using the SCHEMESTATION virtual machine. Then the same expressions were fed to VSCM, and the results were compared. The actual test cases used are found from Compiler test report: actual test cases.

Results: all test cases returned correct values after they had been compiled and run using the virtual machine.

3 Discussion

During the systematical testing phase at least one error was found from the implementation of the compiler. Thus testing was useful. That the compiler succeeds from all the tests presented above is an indication that currently the compiler produces correct code.

The user interface of the compiler has not been tested yet. This is because the user interface has not been finished yet. Its testing is postponed until this has been done.