
UNU/IIST International Institute for Software Technology Generating a Prototype From a UML Model of System Requirements Xiaoshan Li, Zhiming Liu, He Jifeng and Quan Long September 2004 UNU-IIST Report No. 307 R UNU-IIST and UNU-IIST Reports UNU-IIST (United Nations University International Institute for Software Technology) is a Research and Training Cen- tre of the United Nations University (UNU). It is based in Macau, and was founded in 1991. It started operations in July 1992. UNU-IIST is jointly funded by the Governor of Macau and the governments of the People’s Republic of China and Portugal through a contribution to the UNU Endownment Fund. As well as providing two-thirds of the en- downment fund, the Macau authorities also supply UNU-IIST with its office premises and furniture and subsidise fellow accommodation. The mission of UNU-IIST is to assist developing countries in the application and development of software technology. UNU-IIST contributes through its programmatic activities: 1. Advanced development projects, in which software techniques supported by tools are applied, 2. Research projects, in which new techniques for software development are investigated, 3. Curriculum development projects, in which courses of software technology for universities in developing coun- tries are developed, 4. University development projects, which complement the curriculum development projects by aiming to strengthen all aspects of computer science teaching in universities in developing countries, 5. Schools and Courses, which typically teach advanced software development techniques, 6. Events, in which conferences and workshops are organised or supported by UNU-IIST, and 7. Dissemination, in which UNU-IIST regularly distributes to developing countries information on international progress of software technology. Fellows, who are young scientists and engineers from developing countries, are invited to actively participate in all these projects. By doing the projects they are trained. At present, the technical focus of UNU-IIST is on formal methods for software development. UNU-IIST is an interna- tionally recognised center in the area of formal methods. However, no software technique is universally applicable. We are prepared to choose complementary techniques for our projects, if necessary. UNU-IIST produces a report series. Reports are either Research R , Technical T , Compendia C or Administrative A . They are records of UNU-IIST activities and research and development achievements. Many of the reports are also published in conference proceedings and journals. Please write to UNU-IIST at P.O. Box 3058, Macau or visit UNU-IIST’s home page: http://www.iist.unu.edu, if you would like to know more about UNU-IIST and its report series. Chris George, Acting Director UNU/IIST International Institute for Software Technology P.O. Box 3058 Macau Generating a Prototype From a UML Model of System Requirements Xiaoshan Li, Zhiming Liu, He Jifeng and Quan Long Abstract We present a method for automatically generating a prototype from a UML model of system requirements that consists of a use-case model and a conceptual class model. The method is based on a formalization of UML in which a use case is formally specified by a pair of pre and post conditions in the context of a conceptual class model. To generate a prototype, we translate the pre and post conditions of a use case into a sequence of executable atomic actions. These actions are to create or delete an object, update an object, establish or remove a link between two objects with respect to an association. Such a prototype can be used to validate requirements and check system invariants. An automated prototype generator is developed in Java, and a simple library system is used as an example to illustrate the feasibility of the method. Keywords: Prototype, UML, Requirements analysis, Formal Specification, Automated Java Code Generation This paper is to occur in the proceedings of 1st International Conference on Distributed Computing Internet Technology(ICDCIT 2004) Decemeber 22-24, 2004, Bhubaneswar, India. Xiaoshan Li is an Associate Professor at the University of Macau. His research areas are interval temporal logic, formal specification and simulation of computer systems, formal methods in system design and imple- mentation. E-mail: [email protected]. Zhiming Liu is a Research Fellow at UNU/IIST, on leave from Department of Computer Science at the University of Leicester, Leicester, England where he is lecturer in computer science. His research interests in- clude theory of computing systems, emphasising sound methods for specification, verification and refinement of fault-tolerant, real-time and concurrent systems, and formal techniques for OO development. His teaching interests are Communication and Concurrency, Concurrent and Distributed Programming, Internet Security, Software Engineering, Formal specification and Design of Computer Systems. E-mail: [email protected]. He Jifeng is a Senior Research Fellow of UNU/IIST. He is also a professor of computer science at East China Normal University and Shanghai Jiao Tong University. His research interests include the Mathematical theory of programming and refinement methods, design techniques for the mixed software and hardware systems. E-mail: [email protected]. Quan Long is a Fellow at UNU/IIST. He is a Ph.D candidate at Department of Informatics, School of Mathe- matical Sciences, Peking University, Beijing, China. His research interests are formal method, object-oriented analysis and design, and component-based software development. Email: [email protected]. Copyright °c 2004 by UNU-IIST, Xiaoshan Li, Zhiming Liu, He Jifeng and Quan Long Contents i Contents 1 Introduction 1 2 Formalizing UML Models of Requirements 3 2.1 A library system . 3 2.2 Formalizing UML models of requirements . 4 3 Generate an Executable Prototype 10 4 Prototyping Library System 15 5 Discussion and Conclusion 15 Report No. 307, September 2004 UNU-IIST, P.O. Box 3058, Macau Introduction 1 1 Introduction Early acquired requirements are difficult to validate without testing. Prototyping is efficient and effective to expose errors in the early stages of requirements analysis and design. The general purposes of building a prototype include [Smi91, LSHZ94, Cop95, Som00] ² to ensure that the designers and implementors understand requirements directly, ² to help to demonstrate to the customers for validating the requirements, ² to cope with changing requirements better, ² to be used for test planning. Ideally, prototypes cover two aspects of the system being developed: the semantics of the application and the architecture of the software. The architecture of prototypes has to match the fundamental architecture of the envisaged application system independently of the purpose of the prototype. This paper presents a method for automatic generation of a prototype from a model of system requirements. A model of requirements consists of a use-case model (UCM) and a conceptual class model (CCM). They are specified in the notation of UML. When prototyping a system from its model of requirements, we should make clear two key problems. One is which parts of the model we want to prototype; and the other is whether we can prototype the parts in the current context of the model, i.e. the parts are executable or not. UML models of requirements A UCM consists of a use case diagram and textual descriptions of use cases. However, a use case diagram provides only static information about use cases. The dynamic semantic aspects are described in the textual descriptions of use cases as sequences of interactions between actors and the system. Therefore, formalizing and prototyping the requirements of a system should focus on the textual description of the use cases. A CCM for an application is a class diagram consisting of classes (also called concepts), and associations between classes. A class represents a set of conceptual objects and an association determines how the objects in the associated classes are related (or linked). For example, we have two concepts User and Copy of a publication in a library system. They are associated so that a customer borrows a number of copies. In addition to associations between concepts, a concept may have some properties represented by attributes. For example, User has an attribute uid. The reason why we call a class model conceptual at this level is that we are not concerned with what an object does, how it behaves, or how an attribute is represented. The decision on these issues will be made during design phase when the responsibilities of a use case are decomposed and assigned to appropriate objects. Therefore, a CCM is a static model of the structure of the application domain. The background The correctness of a requirements model is validated in general by simulations with a prototype of the system. However, a prototype is usually a simplified version of the system with a smaller set of functionalities, but with design and implementation details [Lee01, Som00]. The framework presented in this paper supports the generation of prototypes for requirements validation without the need of going into the Report No. 307, September 2004 UNU-IIST, P.O. Box 3058, Macau Introduction 2 design. It also supports a fuller scale of prototyping. We believe this is more cost effective as it is only added as part of the requirements analysis, and its automation can even reduce the cost by making the requirements analysis more efficient and effective. The method is fully based on a sound formal method [HH98] of modelling and refinement of requirements integrated with the Rational Unified Process(RUP)[LLH01, LLH]. RUP [JBR99, Kru00] has emerged as a popular software development process. The modelling notation used in RUP is UML [RJB99], that is the de-facto standard modelling language for the development of software with broad application ranges. UML covers the early development stages of requirements analysis and specification and has strong support for design and implementation [JBR99]. RUP promotes several best practice, but one that stands above the other is the ideas of iterative development.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages24 Page
-
File Size-