In the previous article we have discuss about guppy and heapy.If you have not gone through it you see through this link guppy and heapy. In this article we will discuss about one
of the important subpackage under guppy that is GSL.
INTRODUCTION TO GSL
Guppy Specification Language or in short GSL is an evolving specification language, which is a
part of the Guppy-PE programming environment. 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.
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.
- Resolving compatibility issues
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.