The Guppy Specification Language is an evolving specification language. GSL can describe aspects of a system, especially its API, in a way that can be automatically converted to tests as well as to documents. The documents generated have a formal structure for describing the formal aspects of the specification, complemented with descriptive text from the same source documents. A language that is similar in intent is the Assertion Definition Language .
Specifications written in GSL can be used for:
Documents are generated from a combination of formally described aspects and descriptive text. The formal aspects include specifications of attributes and methods and their parameters and return values. The descriptive text is written together with the formal specifications. It can include HTML tags and attributes, specified in the GSL dotted tree format. Output modules can convert from the GSL form to formats such as HTML or Latex.
The tests generated can check the formal aspects of the specification against an implementation. It can test whether objects have the promised attributes, and then if the kind of attribute is specified it is tested again and so on. Methods are checked to see if they can be called with the forms of parameters specified. The return value can then be checked up to some limit of recursion.
A specification can be compared to a previous specification, to tell according to formalized rules whether or not the new one is backwards compatible with the old one, and if not, in what way they differ. For example, according to such rules, an attribute or parameter type can be added to a specification, but it can not be removed. The idea is that all tests possibly generated from the old specification should still succeed with objects conforming to the new specification. -- A program could likely compare specifications for compatibility automatically, but this is not yet implemented.
GSL has been used to generate the documentation for this Guppy distribution. Some part of the specification has been checked against the implementation using the generated tests, which did reveal some discrepancies that were subsequently corrected.
The documents generated by GSL use a formal syntax to describe parameter modes.
In the next article, we're going to discuss about GSL Documentation and Test Example.
Happy Pythoning...!!
Comments