Formalization of UML Use Case Diagram-A Z Notation Based Approach
Formalization of UML Use Case Diagram-A Z Notation Based Approach
Abstract- A Unified Modeling Language (UML) [1, 2] use case in a precise way the properties, which an information system
diagram is a visual tool that provides a way for developers to must have, without unduly constraining the way in which
come to a common understanding with system’s end users and these properties are achieved. This abstraction makes formal
domain experts. The behavior of a use case can be specified by
specifications useful in the process of developing a computer
describing a flow of events in text for an outsider to understand it
easily. The flow of events of a use case is specified in an informal system. A formal specification can serve as a single, reliable
structured text. Therefore, it is not possible to automate the reference point for all associated with the entire software life
verification of tracking requirements captured in a use case cycle. Because it is independent of the program code, a formal
diagram in the design phase. On the other hand, Z is a formal specification of a system can be completed early in its
language, which is non-executable, but, a strongly typed development. It can be a valuable means of promoting a
specification language. We here propose a structured-expandable
common understanding among all those concerned with the
format of a use case, which is expressed in Z notation and then
represented visually using an Entity-Relationship diagram. system.
Implementation of our approach would bridge the gap between a The Z notation [3, 4] is a strongly typed, mathematical,
formal language, which is mathematical and difficult to specification language. It is not an executable notation; it
understand and UML use case diagram that is visual, easy to cannot be interpreted or compiled into a running program.
comprehend and that is used widely to capture requirements. There are some tools for checking Z texts for syntax and type
Development of a tool based on this approach will produce a
errors in much the same way that a compiler checks code in an
visual representation of a formalized UML use case diagram,
from which automated traceability and verification of the design executable programming language. Z is a model-based
phase can be achieved. notation.
One of the other main ingredients in Z is a way of
Index Terms: UML, Use case diagram, Z notation, decomposing a specification into small pieces called schemas.
Formalization, ER Diagram, Traceability, Automated The schema is the feature that most distinguishes Z from other
verification. formal notations. In Z, schemas are used to describe both
static and dynamic aspects of a system.
I. INTRODUCTION As “abstraction” is the key concept for both use case
A use case is an object-oriented modeling construct that is diagrams and Z notation, we here propose an approach to
used to define the behavior of a system. Interactions between “formalize” UML use case diagram using Z notation and
the user and the system are described through a prototypical representing it visually using a Entity Relationship diagram as
course of actions along with a possible set of alternative that is understandable for the users and developers.
courses of action. Primarily, use cases have been associated
with requirements gathering and domain analysis. However, II. REVIEW OF RELATED WORKS
with the release of the Unified Modeling Language (UML) Lots of research work is going on in the direction of
specification version 1.1, the scope of use cases has broadened formalizing UML using Z notation. There are a very few
to include modeling constructs at all levels. Due to this works in the direction of visualizing Z notation, [19] is an
expanded scope, the representation of use cases has taken an example of the works in that domain. In the domain of
increasing importance. formalization, some of the works are getting done with an
UML use case diagrams are important for visualizing, objective to map Object-Z [6], which is an object-oriented
specifying and documenting behavior of an element. They are extension to Z with UML and some of the works are done
applied to capture the intended behavior of the system being with an objective to formalize UML with Z or any extension
developed without specifying how the behavior is of Z. A comparison of formalizing approaches of UML class
implemented. When the system is implemented, collaboration constructs in Z and Object-Z is presented in [12].
or sequence diagrams realize the use cases. As in Z, a system is modeled by representing its state, a
Formal specifications use mathematical notation to describe collection of state variables and their values,- and some
operations that can change its state, most of the works focus not prescribe any strict format or style for writing one. To
on representing or translating UML class diagrams with Z address that, we propose a structured, expandable format of a
notation or Object-Z. Some times, state diagrams have been use case, from which, we propose to derive a Z notation
used for this purpose. schema. The schema is type-checked using ZTC [5], a Z
We here summarize some of the relevant works, which is notation type checker and then represented visually using an
focused on the formalization based on Object Z, and then, ER diagram. We demonstrate our approach with the help of a
based on Z or any extension of that. A XML/XSL approach case study of a retail system.
for projection of Object-Z concepts to UML is discussed in Our approach would bridge the gap between UML use case
[10], whereas in [11], a mapping for translating systems diagrams that has become a de-facto industry standard for
modeled in UML incorporating OCL in Object-Z is proposed. capturing requirements and understandable by the users,
An extension of the development method Fusion/UML that domain experts and developers, and Z notation, that is formal,
translates the results of analysis and design into the formal i.e., mathematical and difficult to understand by the users and
specification language Object-Z is proposed in [13], which the developers. A tool based on our approach would generate a
also establishes a consistency relationship between analysis visual representation of a “formalized” use case diagram from
and design. A translation between some of the UML models which automated verification in the design phase can be
into Z and Lustre formal specifications in order to use a achieved. Our approach can be diagrammatically represented
theorem prover and a test generator to validate the models is as in Fig 1.
proposed in [14]. Here Z is used to validate the static part of
the UML model using RoZ as a tool and Z-EVES theorem
prover. In [16] a meta-model-based transformation between Use Case Z Notation Type
Diagram Schema Checking
UML and Object-Z is presented, whereas in [17], a framework using ZTC
that integrates UML with Object-Z is presented to support
requirements elicitation and analysis activities. a precise and
ER Diagram
descriptive semantics for core modeling concepts in Object-Z
and a formal description for UML class constructs is presented
in [18]. Fig 1: Diagrammatic representation of the approach discussed in this paper
A meta-modular framework for the combined use of UML
and Z is presented in [7] by using templates and generics. At IV. REPRESENTATION OF A USE CASE DIAGRAM USING Z
the instantiation-level, UML models are translated into Z NOTATION SCHEMA
specifications by instantiating the corresponding meta-level In this paper, we propose to map events of a use case with
semantic interpretations. This approach is entirely based on the use case itself. So that, when requirements are captured
UML class diagrams. A method for formalizing syntax and using use case diagrams, if some restrictions are enforced on
semantics of UML state-chart diagrams using Z is discussed in the structure and relationship among the use cases themselves
[8]. This paper discusses the hierarchical and concurrent and the use cases and their events, we can formalize the use
structures of States. AML, an augmented object oriented case diagram using Z notation. This will help us tracking the
modeling language, which is based on UML and Z and a requirements in the design phase and also verifying that all the
supporting tool Venus are presented by Xiaoping Jia in [9], requirements have been addressed in the design automatically.
but this paper did not present any technical or theoretical The following diagram is a UML use case diagram which
breakthroughs. Again, AML consists of UML class and to shows an actors and use cases and relationship among the use
some extent state diagrams. An extension of Z notation is also cases.
performed for this purpose and Zext is introduced. [15] is
focused towards the formalization of the primary UML UC1 UC2
<<E>>
constructs used to build class structures. Soon-Kyeong Kim,
<<I>>
David Carrington in [18], use various diagrams to visualize a <<I>>
Z specification, which includes both static and dynamic UC3 UC5
aspects of formal specifications including complex constraints UC4
Appendix
<<extend>>
Place Order Place rush order
<<include>>
<<include>>
Customer Service
Representative Ship partial order
Bill Customer
TABLE II
PARTIAL TABLE DEMONSTRATING USE CASES AND THEIR RELATIONSHIP
Relationship ID Relating Use Case ID Related Use Case ID Relationship Type
01 01 04 <<include>>
02 02 01 <<extend>>
03 03 04 <<include>>
04 05 04 <<include>>
05 06 05 <<extend>>