Automated rapid prototyping of TUG specifications using Prolog

https://doi.org/10.1016/j.infsof.2004.03.001Get rights and content

Abstract

A prototype is usually built quickly and cheaply to explore poorly understood user requirements in the front-end of the software development life cycle. There are several techniques to construct a prototype such as fourth generation languages, functional and logic programming languages, and simulation techniques. Despite their benefits, these techniques do not directly support formal user requirements and specifications. In this paper, a formal specification language, called TUG, is presented to support an automatic derivation of a prototype in Prolog from a specification in the language via a set of transformation rules. The work described in this paper is distinct from existing rapid prototyping techniques. There is a close correspondence between TUG and Prolog that makes the process of transformation relatively mechanical. The process also allows specifiers not to consider low-level details at implementation such as selection of data structures and algorithms due to the features of the TUG specification language and the Prolog programming language. In addition, rederivation of a prototype in Prolog from a TUG specification is also avoided whenever the specification is modified. A Change Request Script is used to update the prototype in response to the revised specification. The prototype construction and specification acquisition are integrated to handle the construction of user requirements. The formality of the TUG specification language improves the quality of the description of user requirements. Rapid prototyping from the specification via software transformations improves the understanding of user requirements in a cost effective way.

Introduction

Rapid prototyping has been used for exploring vague user requirements in the front-end of the software life cycle. When the vague user requirements are understood, the prototype is thrown away. Therefore, a throwaway prototype should be built quickly and cheaply. Manual rapid prototyping methods are not cost effective for building throwaway prototypes. Automated rapid prototyping may reduce the cost of prototyping and the time of developing it. One automated rapid prototyping technique is the direct execution of a specification. Direct execution of a specification has the benefits of quick construction of the prototype, direct support for formal specifications, and quick response to the specification changes. However, existing formal specification languages still have difficulties in specifying software systems such as non-functional behavior of the systems. For non-executable formal specification languages, a prototype may be derived from the specification via software transformations. Automatic rapid prototyping has its benefits; however, it also has the problems. The use of a prototype depends on the capability of its specification. In addition, rederivation of prototypes from scratch may not be efficient if the specification is large.

Our approach to rapid prototyping uses a formal specification language to automatically generate a prototype in Prolog via a set of software transformation rules. Because there is a direct correspondence between the language and Prolog, the transformation is mechanical and straightforward. Specifiers can concentrate on generating the prototype without the distraction of transforming one notation into another. In order to avoid the rederivation of the entire prototype from scratch, we allow the prototype to be updated only in response to the revised specification. Nevertheless, if there is a major change in the specification, a new prototype is suggested to be regenerated from scratch. Like other existing formal specification languages, our formal specification language may not provide enough abstractions for prototyping some particular features of systems. Therefore, our approach is designed to support the derived prototype to be extended or modified in a modular manner. The specification is written in modules in terms of the language patterns that support module independence, the prototype is then derived in a modular way that supports the ease of modifications to the prototype.

The remainder of this paper is organized as follows. Related work that has influenced our approach is presented. The specification language used for automated rapid prototyping is described and the rapid prototyping process via the language is outlined. The software transformation rules used for the derivation of prototypes in Prolog are presented. The use of the approach is demonstrated with an example system. Finally, the strengths, limitations, and future research are explored.

Section snippets

Related work

An executable specification language can be exercised as a prototype that enables user requirements to be explored, formulated, and analyzed in the software requirements and specification phase. When used as rapid prototyping technique, the behavior of the software system interacting with its environment can be demonstrated and observed before it exists in production quality form. After the validation of the specification, the specification can form a formal document for all phases of software

Description of TUG

The TUG specification language consists of three parts: a name part where the title with input/output parameters are given, an analysis part where the input data is defined, and an anatomy part where the output data is generated.

The name part contains a module or scheme title with input/output parameters. The input/output parameters are enclosed in parentheses. The analysis part contains the rules for analyzing the input data. To analyze the input data, DCGs are used to represent the rules to

Rapid prototyping process via software transformations

The idea of prototyping via software transformations is not new [4], [33]. However, an automatic rapid prototyping approach should avoid a prototype to be rederived from scratch whenever there is a change in the specification. Also, the automated approach should allow developers to easily extend the functions of the prototype manually in case the specification language does not support abstractions for features needed for demonstration. A rapid prototyping approach via software transformations

A telegram analysis problem

This section illustrates the usage of TUG by means of a telegram analysis problem. A specification in TUG is formalized incrementally in a modular and top-down manner. The example also illustrates how the language supports module independence via the language patterns. The telegram analysis problem is specified informally in Ref. [28]:

A program is required to process a stream of telegrams. This stream is available as a sequence of letters, digits and blanks on some device and can be transferred

Discussion

An approach was developed to support rapid prototyping via software transformations by deriving a prototype in Prolog from a specification in TUG. We did not directly use the Prolog language to specify user requirements. Programming languages more or less concentrate on how rather than what and are generally unsuitable for specification purposes. In addition, a specification in Prolog lacks modularity in contrast to a specification in TUG. Since the main purpose of a specification is to aid the

Summary, contributions, and future research

Rapid prototyping via software transformations helps build prototypes automatically from specifications. In this paper, a formal method with TUG was presented to support the rapid prototyping via software transformations process in which a prototype can be built quickly and cheaply. Automation of the application of software transformations reduces the labor intensity of developing prototypes manually. Rapid prototyping via software transformations also provides support for prototype

References (48)

  • R.J.A. Buhr et al.

    Temporal logic-based deadlock analysis for Ada

    IEEE Transactions on Software Engineering

    (1991)
  • D. Carrington et al.

    Object-Z: an object-oriented extension to Z

    (1989)
  • B. Chetali

    Formal verification of concurrent programs using the larch prover

    IEEE Transaction on Software Engineering

    (January 1998)
  • C.-C. Chiang et al.

    Scalable templates for specification reuse

    (1997)
  • C.-C. Chiang et al.

    Validating software specifications against user claims

    (1999)
  • W.F. Clocksin et al.

    Programming in Prolog

    (1984)
  • A. Davis

    Operational prototyping: a new development approach

    IEEE Software

    (1992)
  • A.J.J. Dick et al.

    Computer aided transformation of Z into Prolog

  • A. Diller

    Z: An Introduction to Formal Methods

    (1990)
  • A. Evans

    Visualizing concurrent Z specifications

  • N.E. Fuchs

    Specifications are (preferably) executable

    Software Engineering Journal

    (1992)
  • J. Goguen et al.

    Rapid prototyping in the OBJ specification language

    ACM SIGSOFT, Software Engineering Notes

    (1982)
  • J. Goguen

    Parameterized programming

    IEEE Transactions on Software Engineering

    (1984)
  • A. Gravell et al.

    Executing formal specifications need not be harmful

    Software Engineering Journal

    (1996)
  • Cited by (3)

    View full text