Validating Object-Oriented Specications
through Animation
Antonio Grau
Technische Universitat Braunschweig, Informatik, Abt. Datenbanken
Postfach 3329, D{38023 Braunschweig, Germany
e{mail: [email protected]
Abstract
An important task in the conceptual modelling process of information systems is the validation of the model. The validation task has the objective of checking whether the model correctly and adequately expresses the requirements informally stated by the users. Dierent techniques and tools have been developed to sup-port this task. We propose an animation tool for an object-oriented specication language. This tool generates executable specications from conceptual model spec-ications on the same level of abstraction. In this way, the model behaviour can be observed and checked against the intended user requirements.
1 Introduction
Conceptual modelling is a process of great importance in information systems develop-ment. The result of this process is a conceptual model or system specication which describes the functional requirements that the desired information system must achieve, and serves as the basis for following development phases. Formal specication languages aid in making specications more concise and less ambiguous, avoiding possible false in-terpretations of them. Unfortunately their mathematical rigour entails complex syntax and semantics and consequently understanding the specication requires a good knowl-edge about their backgrounds. This handicap can hinder an indispensable task in the conceptual modelling process, namely the validation of the model. The validation task has the objective of checking whether the model correctly and adequately expresses the requirements informally stated by the users. Validating the model requires the involve-ment of people with dierent backgrounds and therefore the model should be described in an easy and understandable way. Formality versus comprehensibility seems to be a dilemma dicult to solve. How can user participation be eased in the validation process? Dierent validation techniques have been developed with the aim of making possible this user involvement. Among them there are: (a) Presentation of the models in a more easily understandable way. The introduction, for instance, of graphical symbols or user-dened
concepts make specications more intuitive and accessible to the users. Another possi-bility is to paraphrase specications into natural language [RP92]. (b)Model execution. This approach emphasizes on validating the dynamic properties of the model through its execution. In this way users can observe, experiment and test the dynamic properties of the model making easier its comprehension. Dierent techniques are given in this context [Har92]: step by step or interactive execution [Muk95], batch execution, programmed ex-ecution with break points, transformational prototyping and animation [HJS93, DDD94]. (c) Explanation generation. This technique aims at improving the validation of speci-cations by means of giving explanations related to the dierent parts of the conceptual modelling [Gul96].
In this paper we propose an animation system for the object-oriented specication lan-guage Troll [Har97]. For animating specications we mean the process of identifying
scenarios, where a scenario is a sequence of events which may occur in the domain of the system, and testing them against the specication to see whether the specication meets the intended user requirements involved in these scenarios. This task requires the automatic construction of executable specications from conceptual model specications on the same level of abstraction. Animation must not be confused with the system im-plementation where factors of quality like eciency, security, ergonomic user interfaces etc. are borne in mind. The generated code from the specication is of prototype quality and is thrown away after the specication has been validated. Nevertheless, some tech-niques used for the automatic translation of specications into executable ones could be useful for the design and implementation phases. It has to be mentioned that once the specication has been animated and observed that its behaviour meets the user require-ments in a set of scenarios, we would like to arm that such specication is correct with respect to the requirements. Unfortunately, such correctness can only be assessed if the specication has been tested in all possible scenarios. Thus, animation can only detect incorrectness in relation to the user requirements but not the opposite. Animation sup-port and development environments have already been investigated for previous Troll
versions [HJS93, GCD+95, KHHS95]. Their experiences serve us as basis for the proposed
animation tool.
2
TrollTroll stands for \Textual Representations of an Object Logical Language". It is a formal language for the specication of object systems on a high level of abstraction [Har97]. Troll denes an abstract model called the Universe of Discourse to cover all
aspects which are relevant with respect to organisational activities in complex information systems. It includes the functional requirements of the later system and excludes non-functional requirements (like technology bindings of later implementations). Troll com-bines an intuitive diagrammatic notation Omtroll which is similar to OMT [RBP+91]
and adapted to Troll [JWH+94]. Semantics are given to Troll specications using
dierent techniques: The static structure of an object system is semantically described with algebraic methods, statements over object states are expressed with a logic calculus, and the dynamic structure of the system, i.e. the systems evolution, is re ected via a tem-poral logic which is interpreted in terms of event structures. For exhaustive description of the underlying theory, semantics, and logics see [Ehr96, ES95].
3 The
TrollAnimation System
Animating Object Societies
In Troll, an object society is composed of a set of independent and concurrent objects which may communicate with each other through global interactions. Concurrent objects are declared over object classes. An object class specication is a set of attributes, actions, and constraints. Object classes may be constructed over other object classes (aggregation) to describe complex objects, i.e. objects which are composed of component objects. An object class may also be the specialisation of another object class. The specialised class (subclass) may have properties in addition to those inherited from its superclass.
The object system can be animated through event occurrences indicated from the outside of the system. An event occurrence implies the synchronised execution of a nite set of actions and determine the new object states. Basically, the animation should support:
The exploration of actual states of the object society, i.e., the visualisation of object
interfaces (attributes and actions) as well as the possibility of navigating across complex objects and their components and specialisations.
The execution of event occurrences by the users.
The visualisation of state transitions produced by such events.
When an event occurrence cannot be carried out its cause must be reported to the
user. (for instance, either a precondition is not fullled or the new state violates an integrity constraint.)
System Architecture
Specications are introduced in the system by ASCII les and can be written in any editor. Nevertheless, special editors are available helping this task. Specication syntax is analysed by a parser reporting syntax errors to the user. Once syntax correctness has been checked the specication is divided in two parts: (a) Signatures are stored in a repository. Specication signatures include object declarations, object class signatures and data type denitions. (b) Axioms are translated into C++ code. Axioms include the attribute valuations and action calls dened in the object actions, as well as constraints and rules dened for derived attributes. By means of the information stored in the repository the instance schema generator generates database schemas for the system instances. The instance database will contain the actual states of the system objects (see Fig. 1). In animation time the user interacts with the system through an user interface. Here the user can observe the system objects and their actual states, execute actions and observe state transitions. For this task an animation manager reads in the repository the system descriptions, accesses the instances database in order to obtain information about the system objects and executes the code generated for the object axioms.
Editors In the Troll graphical editor specications are described using the Omtroll
Editor Editor Parser Repository Update C++ Code Generator Repository Generator Schema Instance Instances graphical textual Axioms TROLL SYSTEM
Figure 1: System Architecture
as well as global structure and interactions. Operation denitions and constraints are introduced by adequate dialog boxes. Although the model can be specied entirely by means of the graphical editor, for renement purposes would be more adequate the use of the textual editor. For this reason, graphical notations are automatic translated into textual Troll.
For textual specications a Troll model language has been implemented in the Emacs editor. It constitutes the front end of the system. Here other system tools can be in-voked providing a common interface. Some of the new capabilities added to the Emacs Editor are: management of specication projects, automatic generation of patterns, cross-referencing, automatic generation of documentation les, dierent type styles for reserved words and automatic indentation.
Repository Information about the system description is stored in the repository. The
instance database generator reads from it the necessary information and generates the database schemas for the future system instances. In animation time the animation manager will access the repository in order to get information about the objects which are possible to create and about their object classes. The repository structure has been specied with Troll itself.
Instance DatabaseGeneratorFor the rst prototype of the animator we have decided
to use a relational database system due to its high performance and portability. Various techniques have been developed to translateTrollobjects into relational schematas. The instance database generator reads the specication description stored in the repository and generates a sql script which includes the necessary commands for creating the respective relational schematas.
Code Generator The code generator translates the model behaviour into C++ code.
The transformation strategy and execution mechanisms are being now studied.
First Outlook
A prototype of the system is being now implemented with the following tools: C/C++ as programming languages, Tk/Tcl for the user interfaces and the graphical editor, Emacs for the textual editor and RDBMS Ingres for the databases.
References
[DDD94] E. Du Bois, P. Du Bois, and F. Dubru. Animating Formal Requirements Specica-tions of Cooperative Information Systems. In M.L. Brodie, M. Jarke, and M.P. Papa-zoglou, editors, Proc. 2nd Int. Conf. Cooperative Information Systems (CoopIS'94), pages 101{112, 1994.
[Ehr96] H.-D. Ehrich. Object Specication. In E. Astesiano, H.-J. Kreowski, and B. Krieg-Bruckner, editors, IFIP WG14.3 Book on Algebraic Foundations of Systems Speci-cation. Springer, 1996. To appear.
[ES95] H.-D. Ehrich and A. Sernadas. Local Specication of Distributed Families of Sequen-tial Objects. In E. Astesiano, G. Reggio, and A. Tarlecki, editors, Recent Trends in Data Types Specication, Proc. 10th Workshop on Specication of Abstract Data Types joint with the 5th COMPASS Workshop, S.Margherita, Italy, May/June 1994, Selected papers, pages 219{235. Springer, Berlin, LNCS 906, 1995.
[GCD+95] M. Gogolla, S. Conrad, G. Denker, R. Herzig, and N. Vlachantonis. A
Develop-ment EnvironDevelop-ment for an Object Specication Language. IEEE Transactions on Knowledge and Data Engineering, 7(3):505{508, June 1995.
[Gul96] J.A. Gulla. A General Explanation Component for Conceptual Modeling in Case Environments. ACM Transactions on Information Systems, 14(3):297{329, 1996. [Har92] D. Harel. Biting the Silver Bullet - Towards a Brighter Future of Systems
Develop-ment. IEEE Computer, 25(1):8{20, January 1992.
[Har97] P. Hartel. Konzeptionelle Modellierung von Informationssystemen als verteilte Ob-jektsysteme. Reihe DISDBIS. inx-Verlag, Sankt Augustin, 1997.
[HJS93] T. Hartmann, R. Jungclaus, and G. Saake. Animation Support for a Conceptual Modelling Language. In V. Mark, J. Lazansky, and R.R. Wagner, editors, Proc. 4th Int. Conf. on Database and Expert Systems Applications (DEXA), Prague, pages 56{67. LNCS 720, Springer, Berlin, 1993.
[JWH+94] R. Jungclaus, R.J. Wieringa, P. Hartel, G. Saake, and T. Hartmann. Combining Troll with the Object Modeling Technique. In B. Wolnger, editor, Innovationen
bei Rechen- und Kommunikationssystemen. GI-Fachgesprach FG 1: Integration von semi-formalen und formalen Methoden fur die Spezikation von Software, pages 35{ 42. Springer, Informatik aktuell, 1994.
[KHHS95] J. Kusch, P. Hartel, T Hartmann, and G. Saake. Gaining a Uniform View of Dif-ferent Integration Aspects in a Prototyping Environment. In Proc. 6th Int. Conf. on Database and Expert Systems Applications (DEXA'95), pages 38{47. Springer Verlag, Berlin, LNCS 978, 1995.
[Muk95] P. Mukherjee. Computer-Aided Validation of Formal Specications. Software Engi-neering Journal, pages 133{140, July 1995.
[RBP+91] J. Rumbaugh, M. Blaha, W. Premerlani, F. Eddy, and W. Lorensen. Object-Oriented
Modeling and Design. Prentice-Hall, Englewood Clis, NJ, 1991.
[RP92] C. Rolland and C. Proix. A Natural Language Approach for Requirements Engi-neering. In P. Loucopoulos, editor, Proc. 4th Int. Conf. on Advanced Information Systems Engineering (CAiSE'92), pages 257{277. Springer, Berlin, LNCS 593, 1992.