Unit Testing with Axioms in C++ 2011

This article shows how concepts and axioms can be expressed in standard C++ 2011, and explore Axiom-based testing is a technique for testing generic code in a generic way, based on
algebraic specification. This article explores how you can specify graph transformation-based rules for a classical problem of transforming from UML sequence diagrams to state machines. The specification of the transformation rules is based on the concrete syntax of sequence diagrams and state machines. It introduces tailored transformation support for sequence diagrams and a novel graphical operator to match and transform combined fragments.

Compared to traditional unit testing, axiom-based testing offers a less ad hoc way to specify and test behaviour, and we believe it is particularly well suited to test generic code. Compared to pre- and postconditions, axioms are again more suited for generic code, and allows for specification of relationships that cannot be covered by pre- and postconditions – though axioms are not a replacement for assertions and some forms of pre- and postconditions at the implementation level.