Software Development byevolution 3 Shaoying Liu Department of Computer Science Faculty of Information Sciences Hiroshima City University, Japan Email: shaoying@cs.hiroshima-cu.ac.jp Introduction Software development is a process of creating and changing documents from unexecutable specications to executable programs. To achieve an eective control of the process and reliable documents produced during this process, precise and sensible rules are needed to serve as the guidelines and criteria for producing and verifying the documents. In this paper we propose an ary approach to dealing with this important problem, based on the existing renement and incremental techniques [, 2]. It is our belief that software development usually involves three dierent kinds of activities: improving functions, extending functions, and modifying functions. By improving functions we mean that a given operation P can be improved to Q with the preservation of the function of P. The improvement can mean two things. One is to eliminate non-determinism in operation P, and another is to strengthen the capability of P so that Q will be able to oer more functions under the constraint of P. Suchanimprovement is called renement by Jones and Morgan. By extension we mean that a given operation P or its function (e.g., a dierent named operation with the same function) will be sustained when it is expanded to another operation Q. For example, such a Q can be like Q Str(P ), where Str(P ) can be any available construct, such as P ;P; P 2, if B then P ; P else P 2 ; P,andwhile B do P ;P; P 2.Such an extension does not deal with the improvement of P itself, instead, it addresses the problem of how to reuse P in the extended operation Q. By modifying functions we mean that a given operation P is modied into another operation Q so that Q neither preserves the function of P nor reuses the function of P. Such a modication usually reects a change of original requirements for the function of P. The proposed ary approach is intended to unify those three activities with dierent natures. In other words, we attempt to provide a unied rule as a guideline for developing software. We also show how the ary approach can be eectively taken to control the process of software development. 2 The denition of Let operations P and Q have the signatures: P : DP! RP 3 This work is supported by the Ministry of Education of Japan under Grant-in-Aid for Scientic Research on Priority Areas (A) No.39236)
and Q : DQ! RQ. where DP and RP denote the domain and range of the operation P, respectively; and DQ and RQ are those for operation Q. P can be a relation or function, and so is Q, depending on their current specication. Denition 2. Operation Q is an of P i () Q is arenement of P, (2) Q is an extension of P,or (3) Q is a modication of P. We use P j= Q to denote that Q is an of P,orP is evolved to Q. Denition 2.2 Operation Q is a renement of P i () pre-p ) pre-q and (2) pre-p ^ post-q ) post-p We use P v Q to represent that Q is a renement of P. This denition shows that operation P is improved to Q by weakening and strengthening its precondition and postcondition, respectively. In other words, Q must possess the function required by P, but can extend to oer additional functions under the functional constraint of P. Figure depicts a renement. R Q D Q R P D 00 P 0 Figure : Illustration of renement For example, two operations OP and OP are given below: c-process OP(x : nat) y:nat x > a post: y > x + a where nat denotes the natural number type (including zero). c-process OP(x : nat, b:nat) y,z: nat x > a or x > b post: y > x+aand z >= x+b 2
As we have pre-op ) pre-op, and pre-op ^ post-op ) post-op, we can claim that OP is an of OP. Note that although there are additional input b and output z in the operation OP, it still satises the renement rule. Compared with the function of OP, OP has a weaker precondition and stronger postcondition. Denition 2.3 Operation Q is an extension of P i Q Str(P ). where Str(P ) is a construct that contains P as its component. P < Q denotes that Q is an extension of P. Note that in theory the operation P in Str(P ) can be replaced by an equivalent operation P. By equivalentwe mean that P and P have the same function, but possibly with dierent syntax. However, application of this rule will increase signicantly the diculty in verifying whether Q is an extension of P in practice. Therefore, this rule can be simplied to the level that the syntax of P is sustained in Str(P ) when it is applied in practice. For example, Str(P ) can be one of the constructs: () Str(P ) P ; P ; P 2, (2) Str(P ) if b then P else P, (3) Str(P ) while b do begin P ; P end where P and P 2 are additional operations. Denition 2.4 Operation Q is a modication of P i it is neither a renement nor extension of P. We use P = Q to denote that Q is a modication of P. For example, the operation OP given previously is changed to the operation OP2: c-process OP2(x : nat) y:nat x <= a post: y > x + 2*a As OP2 is neither a renement nor extension of OP, it is regarded as a modication of OP. 3 Application of ary approach to SOFL SOFL was developed in our project FM-ISEE based on the rst author's Ph.D research [3]. It consists of a specication language and implementation language [4]. As we did not use the implementation language in the study presented in this paper, we only introduce the SOFL specication language in this section. Readers who are interested in the detailed description of SOFL can refer to the rst FM-ISEE, standing for Formal Methods and Intelligent Software Engineering Environment, was an international joint project funded by the Ministry of Education of Japan in the period of 996-997. 3
author's previous publication [4]. When building a SOFL specication, development of the CDFD hierarchy usually requires extension and/or modication, in addition to decomposition. Decomposition refers to the improvementofa condition process, whereas extension or modication refers to changes in the structure or functionality of a condition process or CDFD. A condition process is decomposed by constructing a corresponding lower level CDFD to rene the process. Extension or modication of a condition process or a CDFD changes its structure or functional denition to make a new version of the current specication. Decomposition extends a specication in a top-down fashion while extension or modication improves it in a horizontal direction, as shown in Figure 2. Increment or modification X A B C A B C Decomposition D E F D E F G G I Y I Figure 2: Illustration of using the SOFL specication language The following approach is an eective way to use when constructing a specication: Decomposition and extension or modication are interleaved, but decomposition usually comes rst and then extension or modication steps are made if necessary. When decomposition of a condition process reveals the need for a change to the condition process itself, then an extension or modication of the condition process and/or the associated CDFDs needs to be carried out. The result of the extension or modication is another hierarchy of CDFDs that properly reects the decomposition relation between high level condition processes and their decomposed CDFDs. 4 Successive approach to software development We believe that software development is a successive process, and our proposed rules can be employed to make this process under control. Specically speaking, when changing an operation P, one must rst consider rening P. If it does not t the purpose (e.g., P needs extension), 4
he must consider extending P. If the original function of P needs to be changed to meet the changed requirements, he must consider modifying P. Each of those three activities must be carried out according to their corresponding rules given previously. For brevity, we call all the documents produced during a software development specications, which may include requirements specications, designs, and programs. Figure 3 shows the ary process of software development. Specification Specification2 Specification n Figure 3: Evolutionary process of software development 5 Conclusions and future research We have proposed an ary approach to software development. It consists of three activities: renement, extension, and modication. We have also given a formal denition for, which includes rules for renement, extension, and modication. We have described how the can be used to control the process of software development, in particular the development using SOFL specication language. As we have realized that a good quality software environment for is crucial in enforcing the ary disciplines in real software projects, improving and extending the existing tools remains as the highest priority in our future research. References [] Carroll Morgan. Programming from Specications. Prentice-Hall International(UK) Ltd., 990. [2] John A. McDermid (editor). Software Engineer's Reference Book. Butterworth-Heinemann Ltd., 993. [3] Shaoying Liu. A Structured and Formal Requirements Analysis Method based on Data Flow Analysis and Rapid Prototyping. PhD thesis, University of Manchester, U.K., August 992. [4] Shaoying Liu, A. Je Outt, Chris Ho-Stuart, Yong Sun, and Mitsuru Ohba. SOFL: A Formal Engineering Methodology for Industrial Applications. IEEE Transactions on Software Engineering, 24():337{344, January 998. Special Issue on Formal Methods. 5