<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Goal2UCM: Automatic Generation of Use Case Model from iStar Model</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Yilong Yang</string-name>
          <email>yilongyang@buaa.edu.cn</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Younggi Bok</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zhuoxi Yang</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Eric Sherif</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>a nd Tong Li</string-name>
          <email>litong@bjut.edu.cn</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Information Technology, Beijing University of Technology</institution>
          ,
          <country country="CN">China</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>State Key Laboratory of Software Development Environment, School of Software, Beihang University</institution>
          ,
          <country country="CN">China</country>
        </aff>
      </contrib-group>
      <fpage>21</fpage>
      <lpage>27</lpage>
      <abstract>
        <p>Goal-oriented modeling is an efective way for modeling and analyzing the requirements of users. It takes stakeholder's intentions as the main clue and analyzes their goals and tasks to construct hierarchical requirements model. Unified Modeling Language (UML) is a de facto standard for system requirements modeling and design. In practice, it is very desirable to have an approach to automatically transform user requirements into system requirements, then automatically generate system prototypes for requirements validation. In ICSE'19 and RE'19, we propose an approach and CASE tool RM2PT, which can automatically generate prototypes from system requirements in UML. In this paper, we focus on filling the gap between user and system requirements. Specifically, we propose an approach Goal2UCM to automatically generate the use case diagram, the system operations and interfaces of use cases from the goal-oriented model iStar based on the model-driven approach. We evaluate the proposed approach with the case study of CoCoME system. Overall, the result is satisfactory. The 93.6% of the iStar model elements can be transformed successfully, and the remaining parts of sub-goals and sub-tasks can be refined and mapped into UML models manually. The proposed approach with the developed CASE tool can be applied to the software industry for requirements engineering.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;UML</kwd>
        <kwd>goal model</kwd>
        <kwd>user requirements</kwd>
        <kwd>system requirements</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Eliciting and specifying the user requirements is the initial step of requirements engineering.
Goal-oriented modeling iStar is a promising way for modeling and analyzing the requirements
of users. It provides software developers and designers with a way to model the characteristics
of system requirements visually and systematically. In practice, it is very desirable to have an
approach to automatically transform user requirements into system requirements, then
automatically generate system prototypes for requirements validation. Requirements modeling and
automatic prototyping (RM2PT) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ][
        <xref ref-type="bibr" rid="ref2">2</xref>
        ][
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] is an approach and a CASE tool that can automatically
generate a system prototype from UML requirements models. The input models of RM2PT
contains a use case diagram, the system sequence diagrams of the use case, the constraints of
the system operations in the system sequence diagram, and a conceptual class diagram. The
direct transformation from iStar to these UML models is challenging because iStar models lack
modeling and describing abilities for the sequences of tasks and conceptual modeling.
      </p>
      <p>Compared with the related works to generate a use case diagram or class diagram from iStar
1.x model, we propose an approach Goal2UCM to automatically generate a use case diagram,
the system operations and interface of use cases from iStar 2.0 model based on the
modeldriven approach. In addition, we implement a iStar 2.0 modeler and Goal2UCM transformer
(https://istar.rm2pt.com) , which are integrated with RM2PT to support further prototype
generation for requirements validation. We evaluate the proposed approach with the case study
of CoCoME system. Overall, the result is satisfactory. The 93.6% elements of iStar models can
be transformed successfully, and the remaining parts of sub-goal and sub-tasks can be refined
and mapped into UML models manually. The contributions of this paper are summarized as
follows:
• We propose an approach Goal2UCM to transform a iStar 2.0 model into a use case model,
which includes a use case diagram, the system operations, the message of system operation,
and the interface of use cases.
• We implement the proposed approach and a iStar 2.0 modeler as the plugins in our CASE
tool RM2PT to support iStar modeling and further prototype generation for requirements
validation.
• We demonstrate the efectiveness of the proposed Goal2UCM by CoCoME case study, in
which 93.6% of the iStar model elements can be transformed successfully without any
extension.</p>
      <p>The remainder of the paper is organized as follows: Section 2 presents the related work.
Section 3 introduces the iStar and use case models. Section 4 presents the proposed approach of
mapping from iStar to use case model. Section 5 demonstrates the proposed approach through
CoCoME case study. Section 6 concludes the paper and proposes future work.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        To the best of our knowledge, the related work is about the transformation from iStar 1.x model
to use case diagram or class diagram. The work [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ][
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] propose a transformation method from
iStar to use case diagram, and made a tool JGOOSE to implement the methods. However, they
only can the transform iStar 1.x model to a use case diagram, which is not involved other
models to describe the specification of the use cases. Another work [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] is to transform a iStar
1.x model to class diagram with OCL constraints. But it does not involve the transformation of
use case diagram. The work [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] transform the iStar 1.x model to use case diagram and class
diagram. However, all system operations are encapsulated into a same class of the system
and the parameters of system operation can not be transformed. The other type of work is
about the transformation from natural language to UML models [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ][
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], it only focuses on the
conceptual class diagram but not the other models in UML. In short, the current work can not
full support use case model generation. We make a further step to support user requirements
validation by transforming the iStar 2.0 model to use case model, which can be used to generate
the prototypes to validate the user requirements.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. iStar and UML Meta-models</title>
      <p>The proposed approach is based on the model-driven methodology. Before starting the
transformation, the meta-models of iStar and use case model are presented in this section. We use
iStar 2.0 (http://istarwiki.org) as the source model and the subset use case model of UML 2.5
(https://www.omg.org/spec/UML) as the target model. The meta-models of iStar and use case
model are shown in Figure 1.
iStar Model: The transformation does not cover all elements of the model. For the iStar model,
the classifier of the intention subject is Actor, which has two sub classes Agent and Role. Base
on the element definitions iStar specification, the Agent is the instance of the subject with the
Role. The Role of iStar is semantically equivalent to the Actor in UML. Moreover, the Actor
has several intentions, which can be a Goal, Task, and Resource. The Goal is the state that the
Actor wants to achieve with a clear achievement standard. The Task refers to the action that
Actor wants to implement, usually to achieve a goal. The Resource is the physical entity or
information entity that the Actor needs to execute a task.</p>
      <p>(a) iStar Metamodel
UML Model: For the UML model, we do not transform the whole system, but only focus on the
use case model, which include the classifiers such as the Actor and UC in the use case diagram,
and the System operation and System service in the system sequence diagram of the use case.
The transformation is straightforward, we will map the semantic equivalence classifiers and
their relations of iStar to the UML model. We will see transformations rules and algorithm in
the next section.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Goal2UML: Transformation from iStar to UML models</title>
      <p>This section presents how to transform the iStar model into UML model based on the
metamodel introduced in the preliminary section. We introduce the transformation rules for the
use case diagram and system operations of use case first and then present the transformation
algorithm</p>
      <sec id="sec-4-1">
        <title>4.1. Transformation Rules</title>
        <p>When transforming the use case diagram, the whole transformation process will be divided
into two parts. The first part is the conversion of Actor, and the second part is the conversion
of UseCase. In UML, an Actor is an external entity that interacts with the system. It can be a
user, an external system that can interact with the system, or a basic device. In the Goal Model,
Actors are divided into two categories, Role and Agent. Agent is a specific instance, such as a
person, organization, or department. It is not suitable to convert Agent to Actor in UML because
Agent is more specific and has more limitations. Role is an abstract description of a certain
group of people, such as students. It is closer to the meaning of Actor in UML, so it can be
converted directly.</p>
        <p>.()  .()
 1 ∶   . ()  2 ∶   . ()</p>
        <p>The rule R1 describes the process of transforming role in Goal model into actor in
UML.Formula R2 describes the process of transforming Goal in Goal Model into UC in UML. The UseCase
describes the function of the system as a series of events and provides valuable observations for
the operator. In the Goal Model, a Goal is a state that the Actor wants to achieve, and there is a
clear completion standard. They all describe behavior or state from the perspective of Actor, so
they can be transformed. However, not all goals can be converted to UseCase, only goals at the
root can be converted. At present, we do not consider the situation when Goal is connected to
another Goal through Refinement. This problem will be improved in the follow-up work.</p>
        <p>The Task in iStar represents an action that the Actor wants to perform, usually to reach a
certain Goal. The Task is corresponding to the following elements in use case model: Message
and Operation. All of these elements may be involved to complete a single task in the entire
UseCase. They describe the process of the same task. But if the Task is connected by multiple
other Intentional Elements with OrRefinement, it will not be transformed in our case. The
rules R3 and R4 describe the process of transforming Task in Goal Model into child elements
CallMessage and ReturnMessage of message in UML.</p>
        <p>The Task with the related Resource is corresponding to the following elements in UML:
Operation and Parameter. Task is transformed into Operation, however, if the Task is connected
by multiple other Intentional Elements with OrRefinement, it will not be transformed. The rule
R5 describes the process of transforming Parameter in Goal Model into Operation in UML. The
rule R6 describes the process of transforming Resource in Goal Model into Parameter in UML.
 4 ∶
  .  .   ()</p>
        <p>. ()
 6 ∶
 . . ()
  .   ()
 3 ∶</p>
        <p>. ()
  .  .   ()
 5 ∶
 . ()
  . ()</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Transformation Algorithm</title>
        <p>To use the above transformation rules, we propose the transformation algorithm in this section.
It takes an iStar model as the input and outputs UML models. Firstly, it retrieves all the Role
in iStar model, and then applies the rule  1 to transform all roles into the actors in UML. For
each top goal of the Role in iStar, if there is no refinement type connection for the current Goal,
it indicates that the goal is in the root node section, and the algorithm apply the rule  2 to
transform it into the UseCase of UML. If the current Task is not connected by other tasks or
goals with OrRefinement, the rules  3 and  4 will be executed, and the current Task will be
transformed into CallMessage, ReturnMessage in UML, otherwise, no transformation will be
performed. Moreover, the rule  5 to transform the Task in the Goal model into the Operation in
UML. Then the rule  6 under the element to transform the Resource in the Goal model into a
Parameter in UML. Finally, the algorithm assembles all the transformed elements of UML and
outputs a file uml.xmi.</p>
        <p>Algorithm 1: Transformation algorithm from iStar to UML models</p>
        <p>Input : iStar Model - iStar.xmi
Output : UML Model - UML.xmi
begin
roles ←retrieve(iStar.xmi);
for r ∈ roles do
apply rule  1;
elements ← getIntentions(r);
for e ∈ elements do
if e == Goal and isRootGoal(e) then</p>
        <p>apply rule  2;
end
if e == Task then
apply rule  3,  4,  5;
rs ← getRelatedResource(e);
for r ∈ rs do</p>
        <p>apply rule  6;
end
end
end</p>
        <p>end
end
return assemble(UML.xmi);</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Evaluation</title>
      <p>In this section, we use CoCoME case study (https://www.cocome.org) to evaluate and
demonstrate the efectiveness of the proposed approach. We first present a brief introduction about
the case study and then show and discuss the transformation results.</p>
      <sec id="sec-5-1">
        <title>5.1. CoCoME Case study</title>
        <p>We use the case study CoCoME (Supermarket System) to demonstrate the proposed approach.
The main subjects of this system are the cashier and customer. The main intention of cashier
is processSale. This part constitutes a simple use case diagram. The goal processSale can be
expanded to the interaction with customers. First, makeNewSale is initiated and then the
enterItem loop is initiated, requiring the customers to provide the cashier with barcode and
quantity information about the goods until it ends. Then we proceed to the next action, endSale.
Finally, a selection to either makeCashPayment or makeCardPayment is needed. If cash payment
is chosen, a specific amount is required. On the other hand, if card payment is chosen, the card
account number, expiry date and fee is required. Due to space constraints, this chapter can not
give a good introduction to this example. Therefore, we have made relevant web pages with
detailed instructions (http://istar.rm2pt.com).</p>
      </sec>
      <sec id="sec-5-2">
        <title>5.2. Evaluation Results and Discussion</title>
        <p>The transformation results are divided into the following two parts. The first part is a use case
diagram, which describes the relationship between user Cashier and his/her UseCases. Then the
system operations of the use cases processSale. The transformation success rate from the Goal
model to the top-level use case diagram can be reaches 100%. The success rate of the system
operation and message can be reaches 87.2%.</p>
        <p>System sequence diagram: each task in the Goal model is transformed into the corresponding
interaction (Call Message, Return Message, Execution) and Service (Operation) in UML, and
the Resource of Dependency in the Goal model is transformed into the corresponding Service
(Operation) in UML.
In this paper, we propose an approach Goal2UCM for transforming the iStar to use case model
in UML, which contains a use case diagram and the system operations with its parameters
of the use cases. Overall, the result is satisfactory. The 93.6% of iStar model elements can be
transformed successfully. The proposed approach is implemented and integrated with RM2PT
to support requirements validation. However, the results show that some elements of UML can
not be directly generated due to the lack of the information in the iStar model. In the future, we
will try to extend iStar model and transformation rules with the sequence marks of the tasks to
support system sequence diagram models generation as well as the contract of system operation
and conceptual model to fully support the prototype generation.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Ke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <article-title>Automated prototype generation from formal requirements model</article-title>
          ,
          <source>IEEE Trans. Reliab</source>
          .
          <volume>69</volume>
          (
          <year>2020</year>
          )
          <fpage>632</fpage>
          -
          <lpage>656</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Liu</surname>
          </string-name>
          , W. Ke,
          <article-title>RM2PT: a tool for automated prototype generation from requirements model</article-title>
          ,
          <source>in: Proceedings of the 41st International Conference on Software Engineering: Companion Proceedings, ICSE 2019, May 25-31</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>59</fpage>
          -
          <lpage>62</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Ke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <article-title>RM2PT: requirements validation through automatic prototyping</article-title>
          , in: 27th IEEE International Requirements Engineering Conference, IEEE,
          <year>2019</year>
          , pp.
          <fpage>484</fpage>
          -
          <lpage>485</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>V. F. A.</given-names>
            <surname>Santander</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Castro</surname>
          </string-name>
          ,
          <article-title>Deriving use cases from organizational modeling</article-title>
          ,
          <source>in: 10th Anniversary IEEE Joint International Conference on Requirements Engineering (RE</source>
          <year>2002</year>
          ),
          <fpage>9</fpage>
          -
          <issue>13</issue>
          <year>September 2002</year>
          , IEEE Computer Society,
          <year>2002</year>
          , pp.
          <fpage>32</fpage>
          -
          <lpage>42</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>G. C. L.</given-names>
            <surname>Geraldino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V. F. A.</given-names>
            <surname>Santander</surname>
          </string-name>
          ,
          <article-title>The JGOOSE tool</article-title>
          , in: J.
          <string-name>
            <surname>Pimentel</surname>
            ,
            <given-names>J. P.</given-names>
          </string-name>
          <string-name>
            <surname>Carvallo</surname>
          </string-name>
          , L. López (Eds.),
          <source>Proceedings of the 12th International i* Workshop co-located with 38th International Conference on Conceptual Modeling (ER</source>
          <year>2019</year>
          ),
          <article-title>CEUR-WS</article-title>
          .org,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>Castro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Mylopoulos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. M. R.</given-names>
            <surname>Alencar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. A. C.</given-names>
            <surname>Filho</surname>
          </string-name>
          ,
          <article-title>Integrating organizational requirements and object oriented modeling</article-title>
          ,
          <source>in: 5th IEEE International Symposium on Requirements Engineering (RE</source>
          <year>2001</year>
          ), IEEE Computer Society,
          <year>2001</year>
          , pp.
          <fpage>146</fpage>
          -
          <lpage>153</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>J. F.</given-names>
            <surname>Castro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. M. R.</given-names>
            <surname>Alencar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V. F. A.</given-names>
            <surname>Santander</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. T. L.</given-names>
            <surname>Silva</surname>
          </string-name>
          ,
          <article-title>Integration of i* and ObjectOriented Models, in: Social Modeling for Requirements Engineering</article-title>
          , The MIT Press,
          <year>2010</year>
          , pp.
          <fpage>457</fpage>
          -
          <lpage>484</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>C.</given-names>
            <surname>Arora</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Sabetzadeh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. C.</given-names>
            <surname>Briand</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Zimmer</surname>
          </string-name>
          ,
          <article-title>Extracting domain models from naturallanguage requirements: approach and industrial evaluation</article-title>
          ,
          <source>in: Proceedings of the ACM/IEEE 19th, ACM</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>250</fpage>
          -
          <lpage>260</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>G.</given-names>
            <surname>Lucassen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Robeer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Dalpiaz</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. M. E. M. van der Werf</surname>
          </string-name>
          , S. Brinkkemper,
          <article-title>Extracting conceptual models from user stories with visual narrator, Requir</article-title>
          . Eng.
          <volume>22</volume>
          (
          <year>2017</year>
          )
          <fpage>339</fpage>
          -
          <lpage>358</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>