<!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>models using Linear Program ming</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Inmaculada Ayala</string-name>
          <email>ayala@lcc.uma.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mercedes Amor</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Lidia Fuentes</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universidad de Málaga, ITIS Software</institution>
          ,
          <addr-line>Málaga</addr-line>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2022</year>
      </pub-date>
      <abstract>
        <p>Goal models are an efective mechanism for elicitation and analysis in early Requirements Engineering, improving communication with stakeholders. However, in real scenarios, goal models become a complex network of actors and evaluating them can be dificult. Some tools assess the level of achievement of actors and intentional elements, which alleviate this limitation. However, using tools to evaluate models has some limitations, like the dificulty of integrating goal models with other models, the training required to use these tools, and the impossibility of assessing models when tools become outdated. In this work, we propose a formalization of iStar 2.0 models in the form of linear constraints that makes it possible to evaluate and optimize models using linear programming. This formalization allows the evaluation of goal models on existing tools and facilitates integration with other approaches.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>are propagated on the contrary from leaves to roots. The third type of analysis of the level
of achievement is by optimising goal models, which intends to assign values to intentional
elements that maximise the model’s satisfaction level.</p>
      <p>The evaluation based on frameworks presents some issues that limit the use of goal models in
practice. Firstly, existing frameworks strongly depend on specific tools that belong to academia.
So, their maintenance is discontinued and they frequently become outdated; therefore, their
use for evaluating goal models is rather inadvisable. In addition, these tools are usually closed
systems, so integrating goal models with other approaches is almost impossible. The resolution
algorithms depend on the specific implementation of the models, so it is necessary to adapt
them to similar systems. Another important aspect is the training required to use these tools.</p>
      <p>
        Recently, it has been proposed the formalisation of goal models using arithmetic semantics
[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], linear constraints [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] and constraint satisfaction problems [
        <xref ref-type="bibr" rid="ref6 ref9">6, 9</xref>
        ]. These formalisations
allow the evaluation of the models on already existing tools and facilitate the integration of
goal models in other approaches [
        <xref ref-type="bibr" rid="ref10 ref8">10, 8</xref>
        ]. In this work, we propose a formalisation of iStar 2.0
models in the form of integer linear constraints that makes it possible to evaluate and optimise
models using integer linear programming (ILP). ILP [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] is a field of mathematical programming
consisting of various techniques and algorithms for solving particular mathematical models.
These models are composed of decision variables, and the goal is to find values that maximise
or minimise an objective function. This objective function is subject to a set of inequality
and equality constraints. The program is linear when constraints and the objective function
are linear expressions. ILP is applied when decision variables are constrained to take
nonnegative integer values. We extend the work of Noorian et al. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], which does not consider
inter-agent dependencies and the level of satisfaction values of the intentional elements. IStar
2.0 has an online tool pIStar [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] that facilitates the use of the standard. In addition, various
general-purpose tools like Matlab, R or Excel can resolve ILP problems.
      </p>
      <p>This work is structured as follows: Section 2 presents some related work; Section 3 introduces
the formalization of the goal model in the form of ILP; Section 4 shows our proof of concept
tool; and the paper concludes with some conclusions and future work.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related work</title>
      <p>The work presented here is related to many contributions that study how to analyse goal models
using alternative representations.</p>
      <p>
        GRL models use the GRL satisfaction analysis [13], a family of algorithms propagating
satisfaction values in goal models. Internally, these algorithms work with mathematical expressions
of goal models. The work [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] proposes arithmetic semantics based on the GRL standard. Models
developed in jUCMNav are translated to SimPy. From this representation, it is possible to
generate programs in Matlab, Java, JavaScript, C, C++ or R. This utility is implemented as a
plugin in jUCMNav. Continuing with GRL, the work presented in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] presents a formalisation
of GRL models in the form of a Constraint Satisfaction Problem that permits the optimisation
of goal models as we do. The approach is integrated into the jUCMNav tool as well.
      </p>
      <p>
        The work in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] addresses the multi-objective optimisation of KAOS models using constraint
satisfaction. The proposal deals with Pareto-optimal solutions and uses Search-Based Software
Engineering. Multi-objective optimisation of goal models is also approached in [14] in the
context of the Constrained Goal Model. Noorian et al. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] propose a formalisation of goal
model refinements as a set of linear constraints. The approach is integrated into a system
that facilitates the configuration of products in product lines taking into account high-level
stakeholder goals. The approach in [15] uses RELAX goal models to generate utility functions.
These functions are used to monitor requirements at runtime.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Mapping iStar 2.0 model to ILP</title>
      <p>
        The iStar 2.0 language does not specify how users have to evaluate models. Indeed, for the case
of i* (the ancestor of iStar 2.0), frameworks take guidelines from other goal modelling languages
like GRL for the evaluation [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Our idea is to provide a method to optimise the goal model and
compare diferent model configurations. Our formalisation does not cover all the elements of
iStar 2.0, we do not consider actor association links like participates-in and is-a. We define the
problem as follows:
maximize
 1,…, 
subject to  , ℛ,  ,  , ℰ , ℬ

∑  ∗ 
=1

(1)
 &lt;= 
elements.
      </p>
      <p>2 +  
elements, the constraint would be   − ∑

=1  ∗ 
 = 0.</p>
      <p>Our objective function is the level of satisfaction of the entire model, which is the weighted
sum of the satisfaction of the actors in the model (  ) and the  , ℛ,  ,  , ℬ
constraints derived from the model in the form of  ∗  &lt;= 
or  ∗  =</p>
      <p>
        are the linear
. We have a single
weight  because we consider each actor equally important. We will use diferent weights if
actors have diferent importance in the model. Constraints 
model the satisfaction value of an
agent, which is the weighted sum of the satisfaction value of its intentional root elements. We
have a linear constraint for each agent, for example for the agent  that has  root intentional
ℛ represents constraints derived from AND and OR refinements. In previous contributions
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], refinements are evaluated using 
(for OR contributions) and 
(for AND contributions)
functions depending on their type, which can be modeled as linear constraints as well. For
example, to model the expression  = (
      </p>
      <p>
        1,  2), we define a binary decision variable  , which
is 1 if  1 &gt;  2 and 0 otherwise, and a variable  , which is bigger than  1 and  2 in any solution
of the problem. Then we define several constraints to enforce the value of  , ( 1 −  2 &lt;=  
and  2 −  1 &lt;=  (1 −  )
), and the value of  ( &gt;= 
1,  &gt;= 
2, &lt;=  1 +  (1 −  )
and
). This approach can be generalized for refinements with more than two leaf
 represents constraints derived from contributions to qualities. We model this as a weighted
sum in which the weights depend on the kind of link. So, for make links the weight is 1, for help
the weight is 0.75, for hurt links the weight is 0.25 and for break links is 0. These weights for
the diferent kinds of contributions are aligned with the proposal of [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The linear constraint
would be  −
      </p>
      <p>∑
=1 

− 0.75 ∑

=1 
ℎ
− 0.25 ∑

=1 
ℎ
= 0.</p>
      <p>represents constraints derived from dependencies between actors. In this kind of
relationship, we have five entities: the depender, the depender element, the dependum, the dependee
and the dependee element. According to the iStar 2.0 specification, the satisfaction of the
depender elements depends on the dependum. So, we use an equality constraint to enforce
this issue with the form   −  = 0 . On the other hand, if the dependee
element is not satisfied, the dependum cannot be satisfied as well. This is modeled using the
linear constraint  −  &lt;= 0 . Where there is no depender or dependee
element, we use its actor’s satisfaction level.</p>
      <p>The ℰ represents these variables in the model that we want to set to a specific value. In a
forward analysis, we would like to know the configuration of the model to achieve a certain
level of satisfaction in an entity. We model this issue using equality constraints. Finally, ℬ
represents the boundings of the model entities that should have a value between 0 and 100.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Proof of concept</title>
      <p>To validate our approach, we have implemented a command-line utility in Java (available in
https://github.com/iayalavinas/istar20) that takes models from the piStar tool1 and generates
a Matlab script. The piStar tool permits the export of models in JSON format. We use the
json-simple library to parse piStar models. Matlab has diferent libraries to optimise linear
programs, we use intlinprog2.</p>
      <p>We have validated our utility for models of diferent sizes. We see that even for models of
more than 100 elements, Matlab and our scripts provide solutions in less than 10 seconds. This
time is reasonable for a program not intended for user interaction or real-time interaction. For
example, for the initial model of the piStar tool (see Figure 1), we obtain the Matlab script that
appears in the screenshot of Figure 2. In line 2 appears the objective function, and as Intlinprog
only supports minimisation problems, we multiply its weights by −1. Intlinprog requires to
indicate what variables of the model are integers. We do so in line 3 using the vector intcon.
The script sets the equality and inequality constraints of the ILP using vectors A, b, Aeq and
beq (lines 4-7). We set between 0 and 100 the satisfaction level of intentional elements in lines 8
and 9. The Intlinprog function is called in line 10. Finally, we print the index of the variable to
interpret the results (lines 11-28).</p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusions</title>
      <p>In this work, we have presented a formalisation of iStar 2.0 models in linear constraints that
allows optimising these models using ILP. IStar 2.0 models, which are modeled using the piStar
tool, are then converted into an ILP problem using our proof of concept tool and resolved in
Matlab. Our formalisation considers most iStar 2.0 entities such as intentional elements, agent
dependencies, contributions and refinements. Although similar approaches exist for other goal
modelling languages like GRL, KAOS or RELAX, they use other formalism that requires specific
solvers like SMT or SAT or does not permit the model optimisation. Other work uses ILP
for goal models, but it only considers a limited sub-set of the entities and does not evaluate
1https://www.cin.ufpe.br/~jhcp/pistar/
2https://es.mathworks.com/help/optim/ug/intlinprog.html
the model’s satisfaction level. In future work, we plan to integrate this formalisation into our
approach for Proactive Dynamic Software Product Lines.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>This work is supported by the European’s H2020 research and innovation programme under
grant agreement DAEMON 101017109, by the projects co-financed by FEDER funds LEIA
UMA18-FEDERJA-15, MEDEA RTI2018-099213-B-I00 and Rhea P18-FR-1081, the
PRE2019087496 grant from the MICINN and by DISCO B1-2012 12 funded by Universidad de Málaga.
[13] D. Amyot, S. Ghanavati, J. Horkof, G. Mussbacher, L. Peyton, E. Yu, Evaluating goal
models within the goal-oriented requirement language, International Journal of Intelligent
Systems 25 (2010) 841–877.
[14] C. M. Nguyen, R. Sebastiani, P. Giorgini, J. Mylopoulos, Multi-objective reasoning with
constrained goal models, Requirements Engineering 23 (2018) 189–225.
[15] A. J. Ramirez, B. H. C. Cheng, Automatic derivation of utility functions for monitoring
software requirements, in: Model Driven Engineering Languages and Systems, Springer
Berlin Heidelberg, 2011, pp. 501–516.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>J.</given-names>
            <surname>Horkof</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <article-title>Interactive goal model analysis for early requirements engineering</article-title>
          ,
          <source>Requirements Engineering</source>
          <volume>21</volume>
          (
          <year>2016</year>
          )
          <fpage>29</fpage>
          -
          <lpage>61</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>E.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <article-title>Towards modelling and reasoning support for early-phase requirements engineering</article-title>
          ,
          <source>in: Proc. of ISRE '97</source>
          ,
          <year>1997</year>
          , pp.
          <fpage>226</fpage>
          -
          <lpage>235</lpage>
          . doi:
          <volume>10</volume>
          .1109/ISRE.
          <year>1997</year>
          .
          <volume>566873</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>F.</given-names>
            <surname>Dalpiaz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Franch</surname>
          </string-name>
          , J. Horkof, istar
          <volume>2</volume>
          .
          <article-title>0 language guide</article-title>
          , arXiv preprint (
          <year>2016</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>D.</given-names>
            <surname>Amyot</surname>
          </string-name>
          , G. Mussbacher, URN:
          <article-title>Towards a new standard for the visual description of requirements</article-title>
          ,
          <source>in: International Workshop on System Analysis and Modeling</source>
          , Springer Berlin Heidelberg,
          <year>2003</year>
          , pp.
          <fpage>21</fpage>
          -
          <lpage>37</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>P.</given-names>
            <surname>Bresciani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Perini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Giorgini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Giunchiglia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Mylopoulos</surname>
          </string-name>
          ,
          <string-name>
            <surname>Tropos:</surname>
          </string-name>
          <article-title>An agent-oriented software development methodology</article-title>
          ,
          <source>J. AAMAS</source>
          <volume>8</volume>
          (
          <year>2004</year>
          )
          <fpage>203</fpage>
          -
          <lpage>236</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>H.</given-names>
            <surname>Luo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Amyot</surname>
          </string-name>
          ,
          <article-title>Towards a declarative, constraint-oriented semantics with a generic evaluation algorithm for grl</article-title>
          ,
          <source>in: Proc. of the 5 th International i* Workshop</source>
          ,
          <year>2011</year>
          , p.
          <fpage>26</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Fan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. A.</given-names>
            <surname>Anda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Amyot</surname>
          </string-name>
          ,
          <article-title>An arithmetic semantics for GRL goal models with function generation</article-title>
          ,
          <source>in: System Analysis and Modeling. Languages, Methods, and Tools for Systems Engineering</source>
          , Springer International Publishing,
          <year>2018</year>
          , pp.
          <fpage>144</fpage>
          -
          <lpage>162</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M.</given-names>
            <surname>Noorian</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Bagheri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Du</surname>
          </string-name>
          ,
          <article-title>Toward automated quality-centric product line conifguration using intentional variability</article-title>
          ,
          <source>Journal of Software: Evolution and Process</source>
          <volume>29</volume>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>C.</given-names>
            <surname>Ponsard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Darimont</surname>
          </string-name>
          ,
          <article-title>Towards multi-objective optimisation of quantitative goal models using constraint programming.</article-title>
          ,
          <source>in: ICORES</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>286</fpage>
          -
          <lpage>292</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>A.</given-names>
            <surname>Anda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Amyot</surname>
          </string-name>
          ,
          <article-title>An optimization modeling method for adaptive systems based on goal and feature models</article-title>
          ,
          <source>in: MoDRE</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>11</fpage>
          -
          <lpage>20</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>B.</given-names>
            <surname>Kolman</surname>
          </string-name>
          ,
          <article-title>Elementary linear programming with applications</article-title>
          ,
          <source>Computer Science and Scientific Computing</source>
          , 2nd ed. ed., Academic Press, San Diego, California,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>J. a.</given-names>
            <surname>Pimentel</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. Castro,</surname>
          </string-name>
          <article-title>piStar tool - a pluggable online tool for goal modeling</article-title>
          ,
          <source>in: IEEE 26th International Requirements Engineering Conference (RE)</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>498</fpage>
          -
          <lpage>499</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>