• No se han encontrado resultados

Diseño de la estructura

In document UNIVERSIDAD DEL AZUAY (página 49-57)

CAPÍTULO II : DISEÑO Y CONSTRUCCIÓN DEL BANCO DIDÁCTICO

2.1 Diseño y construcción de la estructura

2.1.1 Diseño de la estructura

In the traceability concept of this thesis rules are primarily used to identify and record traceability links between the various model elements of the goal-oriented architectural design method. Nevertheless, the rules can be enhanced and increased to also maintain traceability links. The concept of rule-based link establishment is used because it provides higher values of precision and recall than pure information retrieval approaches as evaluated in Chapter 2.

Generally, the relationships between model elements are a product of the per- formed development activities. Accordingly, rules can be defined that express under which conditions and in which manner model elements should be linked as a result of the development activities. As described in Section 7.1 there are different sources of dependencies between model elements that have to be expressed by the rules. Therefore, the rules must cover the identification of links between corresponding model elements representing the same entities of the real world (e.g., URN actor and UML actor) and between other related model elements that represent related entities (e.g., two components with a common interface). Moreover, the rules must support intra model dependencies and inter model dependencies.

The identification of these dependencies to a large extent relies on the compar- ison of the model elements’ attributes. Technically this results in a string-based matching of identifiers. A string comparison for equivalence often is two restrictive to find related elements. In this regard information retrieval techniques as n-gram matching can help as a less restrictive similarity measure. Therefore, the rule-based approach of this thesis is combined with n-gram matching. This increases the re- call of finding links without loosing two much precision as with pure information retrieval approaches. Since the rules exactly specify the model elements, it is further possible to specify the type of the relationship that is recorded as a link.

Based on the evaluation of the state-of-the-art, the rule-based approach of this thesis follows the general concept for the design of rules proposed by Spanoudakis and Zisman et al. [SZPMK04, SZ05, ZEF00]. Accordingly, the rules consist of three parts as introduced in Chapter 2. The head or element definition part of the rule defines the relevant model elements that are effected by the rule together with an informal description. The query part specifies the logical conditions that express how the model elements, which are specified in the head, are related with each other. This

can include a simple string comparison, for example, of the name attributes of two model elements, or even structural information of the queried model together with a comparison of certain attributes for similarity based on an n-gram algorithm. The third part is the result definition or action part. It formulates the result processing. In the simplest case this is the establishment of a traceability link according to the traceability metamodel from Section 7.3. However, also further actions are imaginable as, for example, a triggering of validation rules or other analyses steps.

The structure of the traceability rules is defined with an XML Schema Definition (XSD), which can be found in Appendix B.1. Here for easier comprehensibility the parts of the rule definition are explained with example rules. Listing 7.1 shows an exemplary traceability rule for the linkage between UML components and OWL classes. The head specifies the RuleID and the Description as well as the Elements’ definitions with Type and Alias. The query part defines certain Conditions such as BaseConditions using different comparison operators in their Type attribute as well as LogicConditions with the logic operators And, Or, Not, and Xor, which can be combined and nested. Finally, the Actions part specifies the ActionType CreateLink and the LinkType overlap for the two model elements to be connected. Potentially all link types of Section 7.4 can be used here. The scope operator “::” is used to access the attributes of the model elements.

Listing 7.1: A rule example for the establishment of traceability links between UML components and OWL classes

1 <Rule RuleID=" TraceRule61 " Description=" Find ␣ similarities ␣ between ␣

UML - Components ␣ and ␣OWL - Classes ">

2 <Elements Type=" Class " Alias=" e1 "/> 3 <Elements Type=" Component " Alias=" e2 "/> 4 <Conditions Type=" And ">

5 <BaseConditions Type=" NotNull " Source=" e2::umlID "/> 6 <LogicConditions Type=" Or ">

7 <BaseConditions Type=" Contains " Source=" e1::IRI "

Target=" e2::name "/>

8 <BaseConditions Type=" Contains "

Source=" e1::abbreviatedIRI " Target=" e2::name "/>

9 </ LogicConditions> 10 </ Conditions>

11 <Actions ActionType=" CreateLink " LinkType=" Overlap "

LinkSource=" e1 " LinkTarget=" e2 "/>

Listing 7.2 shows another example rule. This rule is used to create traceabil- ity links based on the links according to the hypertext concept as illustrated in Figure 7.4. Therefore, the rule searches for elements of the type Link from the metamodel of the hypertext concept and for any other model element represented by an asterisk (*). If the identifier of the Link’s target model element matches with any other model element’s identifier, a corresponding TraceLink element will be created by the “CreateLink” Action.

Listing 7.2: A rule example for the establishment of a traceability link based on a hypertext link

1 <Rule RuleID=" TraceRule69 " Description=" Connect ␣ an ␣ EMFfit ␣ ’Link ’␣ element ␣ with ␣ its ␣ target ␣ ModelElement ">

2 <Elements Type=" Link " Alias=" e1 "/> 3 <Elements Type="*" Alias=" e2 "/> 4 <Conditions Type=" And ">

5 <BaseConditions Type=" Equals " Source=" e1::target::identifier "

Target=" e2::identifier "/>

6 </ Conditions>

7 <Actions ActionType=" CreateLink " LinkType=" Overlap "

LinkSource=" e1 " LinkTarget=" e2 "/>

8 </Rule>

As already mentioned, the query part of a rule with the BaseConditions can contain different comparison operators for evaluating the model elements’ attributes. These operators are (cf. [Leh10]):

Equals checks if the value of a model element’s attribute matches a required value Contains checks if an attribute’s value contains a certain string value

IsParent checks if an element has a parent relationship (refinement) with another element in the same model

SimilarTo checks if an attribute’s value resembles a certain value

LesserThan checks if an attribute’s value is lesser than a required value GreaterThan checks if an attribute’s value is greater than a required value NotNull checks if an attribute exists in a model

These operators can be combined with logic operators to formulate complex con- ditional expressions. A special characteristic of the SimilarTo operator is that it uses the n-gram matching algorithm to compare attribute values. In this way the rule-based approach is combined with the information retrieval technique. In the future the operators could be supplemented with additional ones. Moreover, further information retrieval techniques can be integrated, such as word stemming, abbrevi- ation expansion, stop-word elimination, or the more complex vector-based distance measures.

Currently, there are 76 rules specified for the identification and recording of trace- ability links with different types. A complete list of the rules can be found in Ap- pendix B.1. A rule engine is responsible for the interpretation of the rules and to trigger the link creation. Details on this are explained in Chapter 8. The rules can operate on all model elements. Consequently, if change operations, as e.g., the modular operators (cf. Section 6.2.2.1, page 116), are expressed as instances of an explicit metamodel, they can be input for the traceability rules as well. In this way it is be possible to realize also the maintainability of traceability links as proposed by Mäder [Mäd09]. Furthermore, consistency checks would be possible with rules for the validation of models or traceability links.

In document UNIVERSIDAD DEL AZUAY (página 49-57)

Documento similar