home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.umcs.maine.edu
/
2015-02-07.ftp.umcs.maine.edu.tar
/
ftp.umcs.maine.edu
/
pub
/
WISR
/
wisr5
/
proceedings
/
ascii
/
mili_a.ascii
< prev
next >
Wrap
Text File
|
1993-05-31
|
14KB
|
318 lines
A Formal Approach to Software Reuse: Design and Implementation
Ali Mili, Rym Mili
Department of Computer Science
University of Ottawa, Ottawa, Ont. K1N 6N5, Canada
Tel: (613) 564-9234, fax: (613) 564-5045
Email: (amili, rmili)@csi.uottawa.ca
Roland T. Mittermeir
Instit f Informatik
Universit Klagenfurt, A-9022 Klagenfurt Austria
Tel: (43-463) 2700575, fax (43-463) 2700505
Email: roland@samos.ifi.uni-klu.ac.at
Abstract
Formal specifications and program correctness concepts are widely
recognized as effective in dealing with the richness and complexity
of software components. In this paper we submit the position that
these concepts can be put to bear on the problem of maintaining a
database of software components for the purpose of reusing them. To
support our claim, we discuss a system we are currently designing for
this purpose. A first prototype of this system is written in Prolog
and contains a toy database. A full size version of the system is
being designed by means of a theorem prover named Otter 2.2 (copyright
Argonne National Laboratory).
Keywords: formal specification, program correctness, theorem proving,
software reuse, software archive.
Workshop Goals: Learning; networking; gaining a feel of how our effort fits in
the global research effort; identifying fields where our
contribution will be most useful; fine-tuning our design
orientations.
Working Groups: reuse and formal methods, tools and environments, reuse
process models.
1 Background
The approach advocated in this paper results from the combination of two
research efforts:
1. An effort by the third author to build a software archive as a stratified
multidimensional classification structure for software components.
2. An effort by the first author (and more recently the second) to
investigate various features of the specification process and the
specification product.
In a recent joint publication [NBM92] the first and third authors make a
proposal for constructing a database of software components, based on the
following premises:
* Entries of the database have the form of (specification, program) pairs,
where the program component is correct with respect to the specification
component.
* The set of database entries is [NBM92] by means of an ordering relation
among specifications, whose interpretation is: a specification S1 is greater
than a specification S2 if and only if any program correct with respect to
S1 is correct with respect to S2. This is called the refinement ordering.
* The retrieve key for retrieval operations on the database take the form of a
specification, and seek to determine all the programs of the database that
are correct with respect to the key, by matching the key against the
specification components of database entries.
Our design rationale is that by representing database entries with arbitrarily
abstract specifications and by letting the match between a store key and a
retrieve key be defined by the refinement ordering (rather than strict
equality), we deal effectively with the diversity of software components and the
complexity of organizing such components in a database.
In this position paper we give a brief progress report of our effort to build
this database, then we compare our effort with others.
2 Position
2.1 A Database Structure
In order to illustrate the structure that we propose for a database of software
components, we present an example with eight specifications and eight programs.
This example is used in the Prolog-based first prototype of our system.
The specifications are defined as binary relations on the set
S = 0, 1, 2, 3, 4, 5, 6, 7, 8.
R0 = 0
R1 = (s1,s2) OR s2 mod 2 = 0 AND s2 <= s1 + 1.
R2 = (s1,s2) OR s1 mod 2 = 0 AND s2 >= s1.
R3 = (s1,s2) OR s1 mod 2 = 1 AND s2 >= s1 + 1.
R4 = (s1,s2) OR s1 mod 2 = 0 AND s2 >= s1 UNION
(s1,s2) OR s1 mod 2 = 1 AND s2 mod 2 = 0 AND s2 <= s1 + 1.
R5 = (s1,s2) OR s1 mod 2 = 1 AND s2 = s1 + 1 UNION
(s1,s2) OR s1 mod 2 = 0 AND s2 mod 2 = 0 AND s2 <= s1 + 1.
R6 = (s1,s2) OR s1 mod 2 = 0 AND s2 >= s1 UNION
(s1,s2) OR s1 mod 2 = 1 AND s2 >= s1 + 1.
R7 = (s1,s2) OR s1 mod 2 = 0 AND s2 = s1 UNION
(s1,s2) OR s1 mod 2 = 1 AND s2 = s1 + 1.
The programs are defined by begin-end blocks written in Pascal's syntax on an
integer variable s.
p0: begin s := 5 end.
p1: begin s := 0 end.
p2: begin end.
p3: begin s := s + 1 end.
p4: begin if s mod 2 = 1 then s := 0 end.
p5: begin if s mod 2 = 0 then s := 0 else s := s + 5 end.
p6: begin if s mod 2 = 1 then s := s + 5 end.
p7: begin if s mod 2 = 1 then s := s + 1 end.
Once we arrange the specifications according to the refinement ordering relation
and attach the appropriate specifications to programs, we obtain the structure
described in figure 1.
R7 * p7
/|\
/ | \
/ | \
/ | \
/ R6 * p6 \
/ / \ \
/ / \ \
/ / \ \
/ / \ \
/ / \ \
R5 * p5 / \ R4 * p4
|\ / \ /|
| \/ \/ |
| /\ /\ |
|/ \ / \|
R3 * p3 \ / R2 * p2
\ \ / /
\ \ / /
\ \ / /
\ \ / /
\ \ / /
\ R1 * p1 /
\ | /
\ | /
\ | /
\|/
R0 * p0
Figure 1: A Database of Software Components
A number of storage and retrieval algorithms have been defined on this database
structure. These are essentially graph manipulation and traversal algorithms.
The details of these algorithms are given in [NBM92].
2.2 Implementation Options
The database presented in figure 1 is implemented in Prolog as a first prototype
of our system. Prolog is adequate for this simple example, where specifications
are finite and their representation is simple, but is not sufficiently powerful
for general specifications, that are arbitrarily complex and are represented in
arbitrarily abstract terms. Hence for the full size system we are relying on a
theorem prover to carry out the comparisons between store keys and retrieve
keys.
A typical application of the theorem prover we are using for our purposes is the
following: we are given a specification K, which we call the retrieval key, and
we must extract from the database all the programs that are correct with
respect to K. In order to determine these, a graph traversal algorithm must be
invoked to match K against the nodes Ri. Specification K, as well as the nodes
of the graph, are represented by logical formulas, which involve domain-specific
predicates.
Matching K against a node to determine which is greater (by the refinement
ordering) can be formulated as a first order logic theorem. We are using
Otter's syntax to formulate such theorems, and are using Otter to prove (or
disprove) these theorems. As an illustrative example, we have automated the
proofs involved in the retrieval operations of a database containing Pascal
compilers [NBM92] - clearly a non-trivial problem. What we have found most
encouraging about the use of theorem prover, is that it requires little domain
knowledge about compiler construction before it can make inferences about
compilers and compiler specifications.
Our preliminary experience with the first prototype, and our experimentation
with the Otter theorem prover [LWB92] lead us to support the position that
formal methods can achieve a reasonable level of automation in software reuse,
thus affording us more precision and more efficiency.
3 Comparison
The approaches to software description pursued by different research groups
vary widely. These range from the simple unidimensional, key-based
classifications to multidimensional approaches rooted in modern library
sciences, such as the facetted approach [PDF87], to the rather non-standard
proposals such as linguistic approaches [PHZ91], or cognitive approaches [MS91].
In our previous work on the "Software Archive" we have built a stratified
multidimensional classification structure [MR87]. In this structure, components
have been coarsely placed according to their degree of comprehensiveness, their
functionality, and representational form, as well as according to their relative
alikeness (IS-A hierarchy). The resulting structure was further refined by
(verbal) descriptive information. The implementation of this "Archive" [RM89]
could further support multiple user views, in order to allow different users to
classify components according to their specific frame of reference.
The entries in the various classificatory dimensions have been - as with most
other approaches - strictly verbal. Depending on the specific classificatory
dimension, the administrator of the repository could either use keywords from a
given list of descriptors or choose some descriptor formed according to locally
defined rules (focus of the toolkit has been in-house reuse, where naming
conventions could be observed and a dictionary would suffice to supply all the
information needed for disambiguation). With the completion of the
implementation of the Augusta prototype [Hoc92] of the "Software Base"-concept
[MO87] the need for sharper discrimination among components becomes evident; we
share this observation with other groups working on highly focussed libraries.
Hence the need arises for more formal approaches. Traditionally, formal
approaches to software reuse vary from algebraic specifications [MG91] to
specifications which have the form of high level programming languages [DS91].
The main differences between existing formal approaches and the approach we are
taking lies in the fact that we strive for strict implementation independence.
This allows us to establish relationships among specifications, and hence among
the programs bound to them, irrespective of any programming details and
implementation idiosyncracies. Since the specification components of database
entries may be arbitrarily abstract, hence may have arbitrarily simple
descriptions, an automatic inference mechanism can be entrusted with the duty
of checking properties of these entries (such as e.g. whether the specification
component of an entry is is greater than a retrieve key). Furthermore, it
allows the description of components on a relatively high level, where the
predicate part need not be fully descriptive; these predicates may (as long as
in-house reuse remains a target) build on tacit knowledge within the
application domain served by a particular component repository.
References
[DS91] E.E. Doberkat and H.G. Sobottka. A set oriented description language
for ada. In Proceedings, First International Workshop on Software
Reusability, pages 193--197, 1991.
[Hoc92] E. Hochmueller. Augusta: Eine reuse- orientierte software
entwicklungsumgebung zur erstellung von ada-applicationen. Technical
report, Universitaet Klagenfurt, 1992.
[LWB92] E. Lusk L. Wos, R. Overbeek and J. Boyle. Automated Reasoning:
Introduction and Applications. McGraw Hill, New York, NY, 1992.
[MG91] Th. Moineau and M.C. Gaudel. Software reusability through formal
specifications. In J. Cramer R. Prieto-Diaz, W. Schaefer and S. Wolf,
editors, Proceedings, First International Workshop on Software
Reusability, number Memo Nr 57 in UniDo, Dortmund, 1991.
[MO87] R.T. Mittermeir and M. Oppitz. Software bases for the flexible
composition of application systems. IEEE Trans. on Software
Engineering, SE-13(4):440--460, April 1987.
[MR87] R. Mittermeir and W. Rossak. Software bases and software archives,
alternatives to support software reuse. In Proceedings, Fall Joint
Computer Conference '87, pages 21--28, Dallas, October 1987.
[MS91] N.A.M. Maiden and A.G. Sutcliffe. Reuse of analogous specifications
during requirements analysis. In Proceedings, sixth International
Workshop on Software Specification and Design, pages 220--223, Como,
Italy, 1991.
[NBM92] A. Mili N. Boudriga and R.T. Mittermeir. Semantic-based software
retrieval to support rapid prototyping. Structured Programming,
13:109--127, 1992.
[PDF87] R. Prieto-Diaz and P. Freeman. Classifying software for reusability.
IEEE Software, 4(1):6--16, 1987.
[PHZ91] C. Boldyreff P.A.V. Hall and J. Zhang. Practitioner: Pragmatic support
for the reuse use of concepts in existing software. In L. Dusink and
P. Hall, editors, Software Reuse, Utrecht 1989, pages 97--108.
Springer-Verlag, 1991.
[RM89] W. Rossak and R.T. Mittermeir. A dbms based repository for reusable
software components. In Proceedings of the Second International
Workshop Software Engineering and Its Applications, pages 501--518,
Toulouse, France, 1989.
Biography
Ali Mili holds a PhD in computer science from the University of Illinois at
Urbana Champaign. His research interests are software specifications, program
construction and software reuse.
Rym Mili holds a doctorate of specialty from the University of Tunis, Tunisia.
Her research interests are software specifications, compiler construction and
logic programming.
Roland Mittermeir is professor at the Institut fur Informatik at the
Universitat Klagenfurt, Austria. Among his early work on software reuse is the
design of the "Software Base"-Concept, now implemented in the AUGUSTA
environment. Recently, he has also worked on implementing reuse concepts in
medium sized software companies. Prof. Mittermeir holds degrees from the
Wirtschaftsuniversitat Wien and the Technische Universitat Wien.