S S M M M M L L
S S o o f f t t w w a a r r e e M M e e a a s s u u r r e e m m e e n n t t M M o o d d e e l l i i n n g g L L a a n n g g u u a a g g e e
2010-09-18 Version.1.2.1
Beatriz Mora, Felix García, Francisco Ruiz, Mario Piattini.
[email protected]
{Felix.Garcia, Francisco.RuizG, Mario.Piattini}@uclm.es
ALARCOS Research Group
Department of Information Technologies and Systems University of Castilla-La Mancha
http://alarcos.esi.uclm.es/smf/smml/
SMML - Software Measurement Modeling Language
C C o o n n t t e e n n t t s s
1. Introduction ... 1
2. Installation ... 2
2.1. Requirements ... 2
2.2. Installation ... 2
3. SMML Graphical editor: Software Measurement Modeling Language ... 3
3.1. Language Metamodel ... 3
3.1.1.SMML Associations... 3
3.1.2.SMML Entities... 4
3.2. Language Constraints... 14
3.3. Editor Options... 15
4. Software Measurement Model Definition ... 16
4.1. SMML Editor ... 16
5. Release Notes... 19
5.1. SMML v1.2.1... 19
5.2. SMML v1.2.0... 19
5.3. SMML v1.1.0... 19
5.4. SMML v1.0.0... 19
6. References... 20
SMML - Software Measurement Modeling Language
C C o o n n t t e e n n t t s s o o f f F F i i g g u u r r e e s s
Figure 1. SMML Metamodel... 3
Figure 2. Wizard to create a new SMM diagram or SMM File ... 16
Figure 3. SMM File (left) and smm properties (rigth) ... 17
Figure 4. SMM Diagram ... 18
SMML - Software Measurement Modeling Language
C C o o n n t t e e n n t t s s o o f f T T a a b b l l e e s s
Table 1. SMML associations ... 3
Table 2. Non-modelable Abstract Entities in SMML ... 4
Table 3. Entity class element in SMML ... 4
Table 4. Base Measure element in SMML... 5
Table 5. Derived Measure element in SMML ... 6
Table 6. Indicator element in SMML... 7
Table 7. Measurement Method element in SMML ... 8
Table 8. Condition element in SMML ... 9
Table 9. Measurement Method element in SMML ... 10
Table 10. Analysis Model element in SMML... 11
Table 11. Decision Criteria element in SMML ... 12
Table 12. Information Need element in SMML ... 13
Table 13. Measurable Concept element in SMML... 13
Table 14. Quality Model element in SMML ... 13
1
SMML - Software Measurement Modeling Language
1 1 . . I I n n t t r r o o d d u u c c t t i i o o n n
SMML is a language which permits software measurement models to be built in a simple and intuitive manner. The SMML development requires both domain knowledge and language development expertise (Mernik et al. 2005) (Mora et al. 2008c).
SMML - Software Measurement Modeling Language
2 2 . . I I n n s s t t a a l l l l a a t t i i o o n n
2 2 . . 1 1 . . R R e e q q u u i i r r e e m m e e n n t t s s
- Eclipse Galileo: http://www.eclipse.org/galileo/ (Modelling Package)
2. 2 . 2. 2 . In I ns st ta a l l la l at ti io on n
• Install Eclipse Galileo (Modeling Package):
http://www.eclipse.org/downloads/
• SMML editor 1.2.1:
o http://alarcos.esi.uclm.es/smf/smml/
• SMTool (last release).
o SMML editor has certain dependencies on SMTool. Moreover, it makes no sense to use SMML separately. To maximize its use, SMTool must be installed from the following URL:
http://alarcos.esi.uclm.es/smf/smtool
3
SMML - Software Measurement Modeling Language
3 3 . . S S M M M M L L G G r r a a p p h h i i c c a a l l e e d d i i t t o o r r : : S S o o f f t t w w a a r r e e M M e e a a s s u u r r e e m m e e n n t t M M o o d d e e l l i i n n g g L L a a n n g g u u a a g g e e
3 3 . . 1 1 . . L L a a n n g g u u a a g g e e M M e e t t a a m m o o d d e e l l
The SMML metamodel has been created in harmony with the SMM metamodel but it is adapted in such a way as to be implemented with GMF. That metamodel is presented in this section.
Figure 1. SMML Metamodel
3. 3 .1 1. .1 1. . SM S MM M L L A As ss s oc o ci i at a ti io on ns s
The SMML associations are presented in the following table:
Table 1. SMML associations
Entity Graphic Element Association
Non navigable association
Dependency
SMML - Software Measurement Modeling Language
3. 3 .1 1. .2 2. . SM S MM M L L E En n ti t it ti ie e s s
The SMML entities are presented in the following tables.
There are two types of entities in SMML: non-modelable (abstract) entities and modelable ones.
• Non-modelable entities: these entities are defined in the metamodel as abstract entities. Theses entities are shown in Table 2Table 2.
Table 2. Non-modelable Abstract Entities in SMML
Entity Attributes MeasurementElement Name
Measure
name status value unit scale
OperableMeasure
name status value unit scale MeasurementApproach name operation
• Modelable entities: the user can define these entities by using SMML editor. These entities are shown in the following tables
Table 3. Entity class element in SMML
Element Type Description Graphic Element
EntityClass Entity The collection of all entities that satisfy a given
predicate
Name Attribute
Domain metamodel name which is being measured.
If this element is not well defined, the software
measurement can not be carried out. This element must match the package name of the domain metamodel. In the example the name is “relational”.
5
SMML - Software Measurement Modeling Language
measurementDomai
n Attribute
Root element name of the domain metamodel.
If this element is not well defined, the software
measurement can not be carried out. The root element of the metamodel is the element from which the model instance is created. In the example the root element is “RelationalSchema”.
attributes Associatio n
An entity class has one or more attributes.
An attribute can only belong to one entity class.
Table 4. Base Measure element in SMML
Element Type Description Graphic Element
BaseMeasure (a Measure and an
OperableMeasure) Entity
A measure of an attribute that does not depend upon any other
measure, and whose measurement approach is a measurement method.
name Attribute Base Measure name.
status Attribute
Base Measure Status. This value cannot be modified by the user. It is a parameter used to carry out the software measurement by mean of QVT transformations.
value Attribute
Base Measure value, that is, the result of applying the model in the software
measurement by means of SMTool.
unit Attribute Base Measure
SMML - Software Measurement Modeling Language
Element Type Description Graphic Element
unit.Some examples are:
- Unit - Ratio - Entity in the
metamodel - Etc
scale Attribute
Base Measure Scale:
- Integers - Double - Etc.
measurementMethodAssociation Association
Each base measure uses one
measurement method. Each measurement method defines one or more base measures.
attributes Association
A measure is defined for one or more attributes. An attribute may have several associated measures.
Table 5. Derived Measure element in SMML
Element Type Description Graphic Element
DerivedMeasure (a Measure and an
OperableMeasure) Entity
A measure that is derived from other base or derived measures, using a measurement function as measurement Approach.
name Attribute Derived Measure
Name
status Attribute
Derived Measure Status. This value cannot be modified by the user. It is a parameter used to carry out the software measurement by means of QVT transformations.
7
SMML - Software Measurement Modeling Language
value Attribute Derived Measure
value.
unit Attribute Derived Measure
value.
scale Attribute
Derived Measure Scale:
- Integers - Double Etc.
measurementFunctionAssociation Association
Each derived measure is calculated with one measurement function. Each measurement function may define one or more derived measures.
Attributes Association
A measure is defined for one or more attributes.
An attribute may have several associated measures.
Table 6. Indicator element in SMML
Element Type Description Graphic Element
Indicator (a Measure) Entity
A measure that is derived from other measures using an analysis model as a measurement approach.
name Attribute Indicator name
status Attribute
Indicator Status. This value cannot be modified by the user. It is a parameter used to carry out the software measurement by means of QVT transformations.
Final result Attribute Indicator final result.
This value is obtained by analyzing the criteria decisions from the result of the analysis
SMML - Software Measurement Modeling Language
Element Type Description Graphic Element
model.
value Attribute
Analysis Model value.
This value is obtained by executing the analysis model.
This value is not represented in the element.
unit Attribute Indicator unit.
scale Attribute
Derived Measure Scale:
- Integers - Double Etc.
analysisModelAssociation Association
Each indicator is calculated with one analysis model. Each analysis model may define one or more indicators.
informationNeedAssociation Association
An indicator may satisfy several information needs. Each information need is satisfied by one or more indicator.
Attributes Association
A measure is defined for one or more attributes. An attribute may have several associated measures.
Table 7. Measurement Method element in SMML
Element Type Description Graphic Element
MeasurementMethod (a Measurement
Approach) Entity
A measurement method is the measurement approach that defines a base measure. Logical sequence of operations, described generically, used in quantifying an attribute with respect to a specified scale.
9
SMML - Software Measurement Modeling Language
Element Type Description Graphic Element
Name Attribute Measurement
Method Name
Operation Attribute
Measurement Method operation.
The current version only supports the measurement method operation
“COUNT”
Entity Attribute
The entity in the measurement method is the domain entity which is going to be measured, for example: Table (to Count Tables), Attribute (to Count Attributes), etc.
If this element is not well defined, the base measure can not be calculated. This value must match an entity of the domain which will be measured.
Conditions Association
A measurement Method has one or more
conditions. A condition can only belong to one measurement method.
Table 8. Condition element in SMML
Element Type Description Graphic Element
Condition Entity Defines a specific condition in the measurement method for the domain entity which is measured.
name Attribute Condition name
SMML - Software Measurement Modeling Language
Element Type Description Graphic Element
entityAttribute Attribute
Attribute name of the domain metamodel entity which will be measured.
For example for the entity “Table” the possible attributes for this entity can be the “name”
condition Attribute
Condition value. The current version supports the following values:
- = - <>
- <
- >
- <=
- >=
value Attribute
The value that must satisfy the Condition. If the entityAttribute is a String type, the value must be set between single quotation marks: ‘value’.
An example of a condition which can evaluate a domain entity is the following:
Table.name = ‘University’
Where Table is the domain entity.
Name the attribute of the entity.
This specifies that the measurement method must satisfy this condition.
Table 9. Measurement Method element in SMML
Element Type Description Graphic Element
MeasurementFunction Entity
A measurement function is the measurement approach that defines a derived measure. An algorithm or calculation performed to combine two or more base or derived measures.
(A measurement function is the measurement approach that defines a derived measure)
name Attribute Measurement
Function name
operation Attribute Measurement Function operation.
The current version supports the
11
SMML - Software Measurement Modeling Language
Element Type Description Graphic Element
following operation:
- + - - - / - *
This operation defines the operation applied between the two operable measures.
m1 op m2
m1 Attribute The first operable measure (base or derived measure) selected to calculate the Derived Measure value.
m2 Attribute The second operable measure (base or derived measure) selected to calculate the Derived Measure value.
Table 10. Analysis Model element in SMML
Element Type Description Graphic Element
AnalysisModel Entity
An analysis model is the measurement approach that defines an indicator. Algorithm or calculation
combining one or more measures
with associated decision criteria.
name Attribute Analysis Model name
operation Attribute
Measurement Function operation. The current version supports the following operation:
- + - - - / - *
This operation defines the operation applied between the two operable measures.
12
SMML - Software Measurement Modeling Language
Element Type Description Graphic Element
m1 op m2
If the indicator uses only one measure (m1) the operation must not be valued, that is, this value must be empty.
The non-existence of an operation specifies that the value of the analysis model is the same as the measure m1.
m1 Association
The first operable measure (base or derived measure) selected to calculate the Indicator value.
m2 Association
The second operable measure (base or derived measure) selected to calculate the Indicator value. This value is optional if the operation is empty
criteriaDecisions Association
An analysis model uses one or more decision criteria. Each decision criterion is used in one or more analysis models.
This implementation only permits us to define 4 decision criteria.
Table 11. Decision Criteria element in SMML
Element Type Description Graphic Element
DecisionCriteria Entity Thresholds, targets, or patterns used to determine the need for action or further investigation, or to describe the level of confidence in a given result.
The Decision Criterion establishes the Analysis
13
SMML - Software Measurement Modeling Language
Element Type Description Graphic Element
value, the Analysis Model interpretation is the min and max value descriptor.
name Attribute Decision Criterion name minValue Attribute Decision Criterion min
value.
maxValue Attribute Decision Criterion max value.
descriptor Attribute Decision Criterion descriptor.
Table 12. Information Need element in SMML
Element Type Description Graphic Element
InformationNeed Entity Insight necessary to manage objectives, goals, risks, and problems.
name Attribute Information Need name
measurableConceptAssociation Association
An information need is related to one measurable concept. A measurable concept is associated with one or more information needs.
Table 13. Measurable Concept element in SMML
Element Type Description Graphic Element
MeasurableConcept Entity Abstract relationship between attributes of entities and information needs.
name Attribute Measurable Concept name
attributes Association A Measurable concept relates one or more attributes. An Attribute is related to one or more measurable concepts.
Table 14. Quality Model element in SMML
Element Type Description Graphic Element
SMML - Software Measurement Modeling Language
Element Type Description Graphic Element
QualityModel Entity
The set of measurable concepts and the
relationships between them which provide the basis for specifying quality
requirements and evaluating the quality of the entities in a given entity class.
Name Attribute Quality Model name
measurableConceptsAssociation Association
A quality model evaluates one or more measurable concepts. A measurable concept is evaluated by one or more quality models.
entityClassAssociation Association
A quality model is defined for a certain entity class. An entity class may have several associated quality models.
3. 3 . 2. 2 . La L a n n gu g ua ag ge e C Co on ns st tr ra ai in n t t s s
- The name element cannot contain literal spaces.
- Only one “EntityClass” element can be defined in the diagram.
- Only one “InformationNeed” element can be defined in the diagram.
- Only one “EntityClass” element can be defined in the diagram.
- The MinValue attribute must be smaller than the Maxvalue attribute of the DecisionCriteria element.
- The m1 and m2 measures of the measurement method or measurement function must be different.
- The operation of the measurement method must be COUNT - The operation of the measurement function must be the following:
o + o – o / o *
- The operation of the analysis model must be the following:
o + o – o / o * o empty
- If the operation of the analysis model is empty, only the value of the m1 measure is taken.
- If the operation of the analysis model is empty, the m1 measure must be a “derived measure”.
15
SMML - Software Measurement Modeling Language
3 3 . . 3 3 . . E E d d i i t t o o r r O O p p t t i i o o n n s s
- The smm diagram can be validated.
SMML - Software Measurement Modeling Language
4 4 . . S S o o f f t t w w a a r r e e M M e e a a s s u u r r e e m m e e n n t t M M o o d d e e l l D D e e f f i i n n i i t t i i o o n n
This section shows the steps which are necessary to define an SMM model.
4. 4 . 1. 1 . SM S MM ML L E Ed di it t or o r
The Software Measurement Modelling Language (SMML) (Mora et al. 2008b) is a language which belongs to the SMF and supports the definition of software measurement models.
The Software Measurement Metamodel (SMM) (García et al. 2007) has been used in order to develop the SMML. This metamodel is derived from the Software Measurement Ontology (SMO) (García et al. 2006) and defines the abstract syntax of the SMML. The set of icons which form a part of the language have been created and/or selected in order to facilitate the definition of software measurement models by software engineers. The usage of general purpose languages to define domain measurement models is thus avoided.
The SMML is a DSL with a clear syntactic and semantic definition and a solid ontological base.
The SMML also fulfils the following general requirements of a DSL: it is usable, it conforms, and it is orthogonal, supportable and simple. The SMML allows users to represent measurement models in various domains.
As stated in the previous section, the SMML plays a fundamental role in the SMF as it allows users to define the measurement models which are the input for the software measurement process. The visual representation of the measurement models aims to make the SMF a more usable and intuitive framework for the user. In other words, its intention is to make the measurement process more comfortable.
Figure 2. Wizard to create a new SMM diagram or SMM File
17
SMML - Software Measurement Modeling Language
SMML Editor is a graphical editor which supports the SMML. This SMML editor has been created by using the Eclipse Graphical Modeling Framework (GMF), which provides a generative component and runtime infrastructure for developing graphical editors based on EMF (Eclipse Modeling Framework) and GEF (Graphical Editing Framework). This has facilitated the creation of the SMML editor from the Software Measurement Metamodel (SMM) which was previously defined in EMF. The EMF project is a modeling framework and code generation facility for building tools and other applications based on a structured data model. EMF uses a model specification described in XMI to provide tools and runtime support in order to produce a set of Java classes for the model, along with a set of adapter classes that enable viewing and command-based editing of the model, and a basic editor.
SMML Editor supports two types of files (see Figure 2Figure 2):
• SMM File: this file (with .smm extension) is an instance of the SMML Metamodel and can be edited with “SMM Model editor” (see Figure 3Figure 3).This editor is an SMML version of the Reflective Ecore Model Editor included in EMF. An instance of the SMM diagram file can be obtained from this file.
Figure 3. SMM File (left) and smm properties (rigth)
• SMM diagram (smmd): this is the graphical representation of the SMM file. It is written in xmi and it has an smmd extension (see Figure 4Figure 4). This file can be edited with the “SMM Diagram editing”, which permits the software measurement models to be defined in an easy manner. These models will be used to execute the measurement process.
SMML - Software Measurement Modeling Language Figure 4. SMM Diagram
19
SMML - Software Measurement Modeling Language
5 5 . . R R e e l l e e a a s s e e N N o o t t e e s s
5 5 . . 1 1 . . S S M M M M L L v v 1 1 . . 2 2 . . 1 1
In the current version, the following amendments have been made:
• The association defined in decision criteria DC3 was incorrect, the association
“association navigable” has been changed to the association “dependency”
• The attribute finalResult (String) has been added in the Indicator entity. This value is the value of the indicator from the decision criterion.
• The attribute entity (String) has been added in the Measurement Method entity. This value specifies the domain entity which will be measured.
• The attribute interpretation (String)” of the entity Analysis model has been deleted.
• The graphical representation of decision criteria has been fixed; the symbols ‘<’ and ‘>’
were incorrect.
5. 5 . 2. 2 . SM S MM ML L v v1 1. . 2. 2 . 0 0
In the current version, the following improvements have been made:
• The smml file extension (.smm) has been replaced by the smm extension.
• The name of the metamodel (smml) has been replaced by the name smm.
5 5 . . 3 3 . . S S M M M M L L v v 1 1 . . 1 1 . . 0 0
In the current version, the following amendments have been made:
• The smml_diagram extension has been replaced with the smmd extension
• Corrected Bug: the default value (pending) for the status Measure has been set.
5. 5 . 4. 4 . SM S MM ML L v v1 1. . 0. 0 . 0 0
• Initial version.
SMML - Software Measurement Modeling Language
6 6 . . R R e e f f e e r r e e n n c c e e s s
García, F., Bertoa, M. F., Calero, C., Vallecillo, A., Ruíz, F., Piattini, M. and Genero, M. (2006).
Towards a consistent terminology for software measurement. Information & Software Technology 48(8): 631-644
García, F., Serrano, M., Cruz-Lemus, J., Ruiz, F. and Piattini, M. (2007). Managing Software Process Measurement: A Metamodel-Based Approach. Information Sciences 177: 2570–
2586.
Mernik, M., Heering, J. and Sloane, A. M. (2005). When and how to develop domain-specific languages. ACM Computing Surveys (CSUR) Volume 37(4): 316-344.
Mora, B., García, F., Ruiz, F. and Piattini, M. (2008b). SMML: Software Measurement Modeling Language. The 8th OOPSLA Workshop on Domain-Specific Modeling, Nashville
(Tennessee) USA, University of Alabama at Birmingham. Department of Computer and information Sciences: 52-59.
Mora, B., Ruiz, F., Garcia, F. and Piattini, M. (2008c). SMML: Software Measurement Modeling Language, Department of Computer Science. University of Castilla - La Mancha, from http://www.uclm.es/dep/tsi/pdf/SMML_Software_Measurement_Modeling_Language.pd f.