An integration of uml use case diagram and activity diagram with Z language for formalization of library management system

ABSTRACT


INTRODUCTION
Unified Modeling Language (UML) is a visual language for constructing and modeling of software systems. It combines a graphical notation with a semi-formal language for object-oriented based system, to provide requirements specifications with syntax and semantics constraints [1,2]. UML diagrams are considered as a standard tool to compose requirements, and then transform them into structures. In order to, understand system's requirements and reduce complexity of the system. UML includes thirteen diagrams: Use Case, Class, Activity and others. However, there is the lack of precision in the definition of UML notations and semantics [3]. Consequently, UML diagrams have a different interpretation of the described model. In addition to, the consistency between models is very critical. Therefore, a consistency and a concise formalization of UML semantics is required for mapping between graphical and logical by using mathematical theories [4]. In Software Engineering, the integrated formal specifications and UML specifications are very useful to understand the requirements specifications of any system by combination of UML diagrams with formal approaches [5,6]. With emphasis on consistency between UML diagrams. Formal methods are techniques based on mathematical notations, which play a critical role as they focus on refinement of requirements in the initial stages of the System Development Life Cycle (SDLC) like the requirements analysis and specification. It used to ensure that the requirements specifications are precisely express. In order to refinement of a system's requirements which therefore increase the system's accuracy  [7]. Formal methods specify the unambiguous system specification, reduce the error and improved effectiveness in design and development phases [8,9]. The formal specification removes ambiguity, reduces the design time, it also addresses improve software's reliability and comprehensibility [10]. Formal specification languages are widely used for development an accurate, consistent and unambiguous systems and software. On that point are various formal languages like VDM, B-Methods, Larch and Z notation are used for formal specification. Z notation is a good example based on formal specification language which uses the set theory for determining the behavior of sequential systems [11]. The literature indicates that the most well-known issue for UML is lack of obvious semantics, various interpretation of the diagram and inconsistency among diagrams. This leads to ambiguity, errors, and reduced software quality. in addition, the most popular UML diagrams used in industry are use case, class, sequence to integrate with formal methods. But, The formal specifications have not been made from activity diagram. Hence, the combination of informal method and formal method is required to handle ambiguity, specifying consistency and improving completeness [12]. Therefore, this paper proposes an approach that aims to integrate of UML use case and activity diagrams with formal specification method, to bridge a gap between informal and formal methods. The main focus of this paper is on consistency and complement among UML use case diagram, UML activity diagram and Z schemas. Besides, there was a research gap of proper integration of activity diagrams with formal specifications. Also, Z notation used for formal analysis of LMS (LMS) which is further verified by using the Z/EVES tool.
The rest of this paper organized as follows. Section 2 introduces the related work. Section 3 fully describes the proposed approach to integrate of UML use case and activity diagrams with formal specification method. Section 4 presents the results of the case study to demonstrate the effectiveness of the proposed approach. Section 5 describes the strength and weakness of the proposed approach. and finally Section 6 remarks the conclusions.

RELATED WORKS
The formal approach for requirements specification using Z language that had been addressed by many researchers [4, 6-8, 11, 12], they were offered it in different aspects. The solution has produced with greater improvement than informal method. Minhas,et al. [4] proposed an integration of UML specification with formal specification. They have been used UML sequence diagram and Z language for developed. The Flight Reservation System. In addition, they concluded to use more than one UML diagram, in order to the results can be more improved. To cover ambiguity, identifying consistency and enhancing completeness, the informal and formal method combination is proper to develop the Road Traffic Management System by Singh, et al. [6]. In their study UML use case, class and sequence diagrams with Z language used. Moreover, the Z/EVEs tool used to verify Z schemas. In the research provided from Bakri et al. [7], related to our research study where they offer a formal specification for the inventory system using Z language. Their approach based on translating the UML specification into Z schemas. It also focused on the consistency between UML specification and Z schema, in order to effectively improve system reliability and reduce defect for developing the inventory system. However, in their study have been used UML class diagram. Researchers presented in [8,11,12] formal specifications by using UML use case diagram and Z schemas to improve software correctness, reliability, and efficiency. As it used to reduce time and cost at an initial stage. However, in [8] have been used Z/EVEs tool to verify Z schemas. While, in both of the studies [11,12] no tool used to verify Z schemas. The comparative study of related works focused on a number of formal specification approaches to improve the systems development as reviewed in Table 1. Based on Table 1, the literature indicates that the most popular UML diagrams used in industry are use case, class, sequence. The formal specifications did not construct from activity diagram as well. Therefore, this paper is used combination of UML use case and activity diagram with Z formal specification language to design the LMS. In addition to, we have discussed earlier that the most well-known issue for UML is lack of clear semantics, different interpretation of the described model and inconsistency among models. Hence, the consistency between UML diagrams and Z schema focused in this paper.

RESULTS AND ANALYSIS
UML is a common modelling method in an object-oriented based system. The consistency is a significant rule between diagrams, to ensure that implementation of the diagrams is complementing. Moreover, the consistency between use-case diagram and activity diagram confirmed by [13,14]. On the other hand, Formal methods are an essential solution to the issues related to requirement analysis and specifications. In addition, it describes of unambiguity requirements specifications, and ensures that the system indeed satisfies the requirements, reliability and corrects [10]. Consequently, this paper aims to propose an approach that integrates UML diagrams (use case diagram and activity diagram) with the formal specification language (Z language) for specifying requirements for LMS, and then verified by using Z/EVES type checker tool. This tool used for verifying the schema specification, that wrote based on Z notation language [7]. This verification includes syntax and semantics of the LMS formal specification. The proposed approach for designing LMS uses UML and the formal method as shown in Figure 1.

CASE STUDY AND APPROACH MODELLING
In this paper, we present a case study of A Library Management System (LMS). A developer wants to develop LMS. When a user wants to borrow a book, the system should be able to verify the membership of the user first, if the user is a member, then the system checks the availability of the book. If the book is available, then the system lets the member reserves the book and the database needs to update to indicate that the book is not available anymore. The first step is to determine the requirements analysis for the scenario as in the next subsection.

System requirements analysis
The analysis stage was the basis of the system design. At this stage, it needs to obtain the user requirements as accurate, and analysis of demand, thus to specify system requirements. The system requirements analysis is as follows: The LMS entrusted by book borrowing and book return business. Book borrows management need to verify the membership of the user and check the availability of the book. As book return management need to verify the membership of the user and the legality of the book. Librarian task was to maintain the new book information addition. The stakeholders of the system are Librarian and Member. The system has basic functions that are Verify membership, Check a book availability, Borrow a book, Return a book and Add a book.

System design based on UML specifications
Based on the above analysis, we then draw the diagrams of UML mainly the use case diagram and activity diagram. In this paper, the Rational Rose UML tool used to create a complete UML diagrams. Figure 2 shows use case diagram for the LMS. There are two users to use the system, which are Librarian and Member. A Librarian can do activities for Borrow a book, Return a book and Add a book. As a Member can do activities for Borrow a book and Return a book. While, the functions Verify membership and Check a book's availability are included functions of the system. Based on the use case diagram in Figure 2, there are three main functions are Borrow a book, Return a book and Add a book. Thus, the activity diagram of LMS consists of these three activities. Figure 6 shows the activity diagram of Add a book function in LMS. Figure 3 shows the activity diagram of Borrow a book function in LMS; it demonstrates when any user wants to borrow a book should be entering his/her details and the book details. LMS will verify the user membership. If it is incorrect, the system will display an error message. Otherwise, the system will check the availability of the book. If it is not available, the system will display an error message. While, if it is available, the system will record the book as lent book, delete it from shelves and display a success message.  Figure 4 shows the activity diagram of Return a book function in LMS; it explains when any user wants to return a book should be entering his/her details and the book details. LMS will verify the user membership. If it is incorrect, the system will display an error message. Otherwise, the system will verify from the book. If it is not lent, the system will display an error message. While, if it is lent, the system will delete it from being loan, record it on the shelves and display a success message. Figure 5 shows the activity diagram of Add a book function in LMS; it shows when any user wants to add a book should be entering his/her details and the book t details. LMS will verify the user membership. If it is not a librarian, the system will display an error message. Else, the system will let the librarian to enter the book details. Then, add the book details into catalogue record it on the shelves and display a success message. Each function with its regarding activity diagram will be transform to Z schema, with consideration for consistency between UML diagrams and the Z schema as discussed in the next section.

System implementation based on formal specifications
The Z is a formal specification language for system specification, and it based on set theory and mathematical logic. Z notations employed in industry; it used in this paper as to be the main part of the solution for this study's issue. Z schemas describe the static and dynamic characteristics of a system like state transition, operations and relationships. The Z schemas describe system specifications and its behaviour to provide sufficient confidence before coding. It written as two parts, the declaration part describes the used variables for function, and the operation part demonstrates the relationship between the values of those variables [11]. In this section, the LMS specifications are implemented based on Z schemas and used Z/EVEs tool for verification. Z/EVEs is an interactive tool which writes, verifies and analysis Z notations. This tool provides two interfaces: a graphical interface and a command line interface. Both interfaces support the analysis of specifications and manage the synchronization of the analysis with modifications to the specification [8]. The proposed approach in this paper indicates to integrate and consisting of UML use-case diagram and activity diagram with Z language. Consequently, UML activity diagrams constructed based on UML use-case diagram in the previous section. In this section, Z specification interpreted from the UML activity diagram. The activity diagram of LMS consists of three activity diagrams based on the main functions in the use-case diagram. Each activity diagram has two cases: valid activity case and invalid activity case. Therefore, Z schemas constructed for two cases of each activity diagram as following: Figure 6 shows Z Schema declares the power sets BOOK and PERSON. In addition, we represent the response message by using variable LMSMESSAGE. There are only two types of response, which are SUCCESS or FAIL. LMS initialized and all default values have been set to initial value. Books identified as on_loan and on_shelves. Librarian and member are the system users, they declared as PERSON set. In addition to, Lent_to is the relationship that can exist between a Book and a Person as represented by .   Figure 7 shows the Z schema is verified that, the person that wants to borrow a book was recorded as being a librarian or member, and the particular book is available (not already on loan). Then the book is recorded as being lent to person as represented by , and the response 'SUCCESS' should be output. Figure 8 shows the Z schema is verified that, the person that wants to borrow a book was not recorded as being a librarian or member, and the particular book is not available (already on loan). Then the LMS state values will not be change as represented by and the response 'FAIL' should be as output. Figure 9 shows the Z schema verified that, the person that wants to return a book recorded as being a librarian or member, and the particular book recorded as being on loan. Then the book is recorded as being back on the shelves, the record of it being lent to a person is deleted as represented by and the response 'SUCCESS' should be output. Figure 10 shows the Z schema verified that, the person that wants to borrow a book was not record as being a librarian or member, and the particular book is not record as not being on loan. Then the LMS state values will not be change as represented by and the response 'FAIL' should be as output. Figure 11 shows the Z schema verified that, the person that wants to return a book recorded as being a librarian. Then the book shall be add to the library catalogue and the response 'SUCCESS' should be as output. Figure 12 shows the Z schema verified that, the person that wants to borrow a book was not record as being a librarian. Then the LMS state values will not be change as represented by and the response 'FAIL' should be as output.

RESULTS AND DISCUSSION
The main contribution of this paper is to provide an approach to convert from informal specification into formal specification by focusing on integration and consistency between UML specification and formal method. The proposed approach is a formalization of Library Management System (LMS). It starts from the system's requirements, and then translated to UML use case diagram and activity diagram. Furthermore the Z schemas were adapted based on activity diagrams. The syntax and semantics of LMS specifications are verified with the tool Z/EVES. In the proposed approach, it has been seen that bridged a gap between informal and formal methods. There are certain benefits to improved system factors during analysis and design phases before implementation. Following benefits can be a result of the integration UML specification with Z language:

Reduced the ambiguity
This is one of the biggest advantages that can be achieved by integration of informal and formal methods. This approach emphasizes on identifying the system behavior by using UML behavior diagrams (use case diagram and activity diagram) based on system requirements. In addition to, the formal methods are mathematically based techniques for specifying a description of the system to be developed. Therefore, the system requirements specification will be clearly defined

Reduced the error
This is one of the most important aspects of the software design. The proposed approach is certifying a developed system, by generating models based on system's requirements by using the Rational Rose tool to create a complete UML diagrams. And then uses formal methods to generate proofs that the schema meets requirements. Moreover the schemas are verified by using Z/EVES checker tool, to overcome the errors.

Improved the quality
Formal methods use mathematical and logical formalization. Formal methods have been used in our approach, starting from the design phase to find defects. The basic purpose is to improve the quality of the resulting software. Therefore, formal methods were the best way to improve software quality can be applied in early stages of the Software Development Life Cycle (SDLC).

Confidentiality
We anticipate that software security can be improved through the application of formal methods. By implementing Z schema for each function of that software. Thus, it makes it easier to manage and implement the code and make it secure against unauthorized access. With this we can sort that which user can access what type of information. So the information is protected.
Briefly, the results of the integration UML specification with formal specification are reduced the ambiguity and Error, and Improved the quality and confidentiality of the system in the early stages. However, the limitation of the proposed approach is that it does not support code generation. Even if the proposed approach to design LMS does not provide the fine-grained steps and practices for impletation phase, the development processes in this paper allow the software developer to describe and capture the analysis and design phases for LMS. However, since the standard Z notations used to support the code generation by any programming language.

CONCLUSION
This paper proposed an approach to formalization of Library Management System (LMS) by focusing on integration and consistency between UML specification and formal method. The behavior of the system is specified from system's requirements, and then translated to UML use case diagram and activity diagram. Moreover the Z schemas were adapted based on activity diagrams. The syntax and semantics of LMS specifications are verified with the Z/EVES tool. The proposed approach is an integration of UML specification with Z language, as a result that has been bridged a gap between informal and formal methods. The obtained results were to improve the system's requirements during analysis and design phases in terms reduced the ambiguity and error, improved the quality and confidentiality.