Penguin
Note: You are viewing an old revision of this page. View the current version.

Aym is a specification-based UnitTesting framework. It uses in-source comments consisting of a functional specification language implementation of an algorithm as an oracle against which to test the correctness of an implementation of said algorithm. This is being written by GianPerrone, AlastairPorter and SimonWare? as their project for COMP134? at WaikatoUniversity.

A Really Bad Example

Aym Specification
function sum(x) of type integer returning integer let sum(0) = 0 let sum(x) = x + sum(x-1)
C++ Implementation

int sum( int x ) {

int count = 0; for(int i = 0; i<x; i++) {

count += i;

} return count;

}

Notice that these two functions return completely different results! The idea is that the unit-testing portion of the project would catch this and inform you of the input, expected output and actual output.

Aym also supports the idea of "watches", whereby internal values of the specification and implementation can be made to match, not just returned results. This is facilitated by the use of a function !AymWatch?, of type string * 'a -> 'a. Using the above example again, one might insert a watch into the last line of the specification such as
let sum(x) = !AymWatch?("sumwatch", x) + sum(x-1)
And then the implementation would have a line added to it such as

AymWatch?("sumwatch", i);

The unit-testing framework will ensure that the values match at each update.

Aym is GPLish. If you want a copy (why?), talk to GianPerrone or AlastairPorter.