Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
Aym
Edit
PageHistory
Diff
Info
LikePages
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 Simon Ware as their project for COMP134 at WaikatoUniversity. !A Really Bad Example Aym Specification: <pre> function sum(x) of type integer returning integer let sum(0) = 0 let sum(x) = x + sum(x-1) </pre> C++ Implementation: <pre> int sum( int x ) { int count = 0; for(int i = 0; i<x; i++) { count += i; } return count; } </pre> 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: <pre> let sum(x) = ~AymWatch("sumwatch", x) + sum(x-1) </pre> And then the implementation would have a line added to it such as: <pre> ~AymWatch("sumwatch", i); </pre> 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.
3 pages link to
Aym
:
PASL
AlastairPorter
GianPerrone