Académique Documents
Professionnel Documents
Culture Documents
net/publication/221595380
CITATIONS READS
2 601
5 authors, including:
Some of the authors of this publication are also working on these related projects:
ODA: Open Data for All via the exploitation of Open APIs View project
All content following this page was uploaded by Antonio Vallecillo on 02 June 2014.
2 http://gts.inf.um.es/trac/age/wiki/ISEvolutionHOT 3 http://www.eclipse.org/modeling/emft
limitations, in the addition cases only a controller respectively. The following is the
skeleton can be generated in most cases, transformation between the metamodels we
leaving the implementation logic to the take as a base.
developer. And in the case of removal, we
can synchronize automatically the trans- module exam2mvc;
formation but not guarantee its seman- create OUT : AssistantMVC from IN :
tic correction. On the other hand, in the ExamXML;
case of update, where the changes are only rule Exams {
in the nomenclature and are not struc- from vExam : ExamXML!Exam
tural, it is automatic. Possible impacts to mvc : AssistantMVC!Exam (
on transformations caused by a change in examItems <- vExam.elements ) }
the requirements are shown in the table.
rule OpenQuestion {
3.2 Example from vExam : ExamXML!OpenElement
In this Section we present a source metamodel
to vOpenController :
called Exam and a target metamodel called
AssistantMVC!OpenController(),
MVC (in Figure 3), based on [4]. vOpenView :
The Exam metamodel describes exams AssistantMVC!OpenView(
and exam questions. An exam ( Exam ) is controller <- vOpenController,
composed of one or more exam questions: fontName <- 'Times',
open (OpenElement ) and multiple choice fontColor <- 'Red' ),
( MultipleChoiceElement ). On the other vOpen : AssistantMVC!Open (
hand, MVC metamodel represents a Model- question <- vExam.question,
View-Controller architecture where three observers <- vOpenView ) }
abstract metaclasses: ExamItem, View and
Controller correspond to model, view and rule MultipleChoice {
from vExerciseElement :
ExamXML!ExerciseElement rule OpenQuestion {
to vExerciseController : from vOpenElement :
AssistantMVC!ExerciseController(), ExamXML!OpenElement
AssistantMVC!OpenView ( be:
proposed transformation can have dierent ture - Foundations and Applications, Sec-
intrinsic diculty of the changes and the 2006, Bilbao, Spain, July 10-13, 2006,
Acknowledgments We would like to [8] Ivan Kurtev, Klaas van den Berg, and
thank Maider Azanza and the reviewers for Frédéric Jouault. Rule-based modulariza-
their help and comments. This work has been tion in model transformation languages
partially supported by a Basque Government illustrated with atl. Sci. Comput. Pro-
grant. gram., 68(3):138154, 2007.
[9] Tom Mens and Pieter Van Gorp. A tax-
References
onomy of model transformation. Electr.
[1] Iso 9126: http://www.sqa.net/iso9126.html.
Notes Theor. Comput. Sci., 152:125142,
2006.
[2] Jean Bézivin, Fabian Büttner, Martin
[10] Massimo Tisi, Frédéric Jouault, Piero
Gogolla, Frédéric Jouault, Ivan Kurtev,
Fraternali, Stefano Ceri, and Jean
and Arne Lindow. Model transforma-
tions? transformation models! In MoD-
Bézivin. On the use of higher-order model
cada vez que se encuentra el patrón estructural en como otras condiciones que limiten la ejecución
el modelo de origen y las reglas non-top son de la regla. La postcondición de las reglas top son
invocadas directa o transitivamente desde la las llamadas, por composición de
cláusula where de las reglas top. transformaciones [2], a las distintas reglas non-
Las reglas de transformación incluidas en las top, agregando un mecanismo de reutilización a
transformaciones alternativas han de ser las reglas top.
modificadas para adaptarlas a la estructura de la En cuanto a las reglas non-top, su estructura
arquitectura. Por cada patrón estructural para el será definida de la forma habitual para representar
que se han identificado transformaciones la relación entre patrones estructurales del modelo
alternativas generaremos una nueva regla top por origen y sus correspondencias en el modelo
composición de todas las alternativas, aplicando destino.
principios de composición análogos a los descritos
en [2] para el contexto de transformaciones QVT- 4 Automatizando la selección de
Operational. Esta regla tendrá discriminantes que transformaciones alternativas
le permitirán seleccionar apropiadamente la
alternativa, y realizar las invocaciones a reglas
Esta sección muestra la automatización del
non-top en función de las selecciones realizadas
proceso de transformación de modelos dirigido
en la fase de análisis de reglas. La información de
por atributos de calidad en un dominio concreto.
las distintas reglas a invocar se encuentra
Por restricción de espacio, presentamos
disponible en el Modelo de Reglas Activas.
únicamente un breve resumen de la
En QVT-Relations una transformación se
automatización de la transformación de un modelo
define como una relación entre dos o más
de requisitos, en concreto de diagramas de
modelos. Una relación en una transformación
secuencia a diagramas de clase UML. Esta
define las restricciones que deben ser satisfechas
implementación se ha llevado a cabo con la
por los elementos de los modelos participantes.
infraestructura Eclipse, empleando EMF para
Una relación se define por dos o más dominios y
definir los metamodelos y la persistencia en XMI
un par de predicados when y where que
que brinda para serializar los modelos. Como
especifican la relación que debe mantener entre
lenguaje de transformación empleamos QVT-
los elementos de los modelos participantes. La
Relations y como motor de transformación
cláusula when especifica las condiciones bajo las
empleamos MediniQVT.
cuales la relación debe ejecutarse. La cláusula
where especifica la condición que debe ser
satisfecha por todos los elementos del modelo que 4.1 Identificación de alternativas y atributos
participan en la relación. Estas cláusulas pueden relevantes
restringir alguna de las variables de la relación y
sus dominios [12]. El proceso comienza con la identificación de
La estructura de una regla top, que agrupa las transformaciones alternativas en el dominio
distintas alternativas, constará de tres dominios. El específico. En este caso utilizamos el Catalogo de
primer dominio es el Modelo Origen, donde son Reglas de Transformación propuesto por Insfran
descritas con precisión las entidades del patrón [7]. Este catálogo define las relaciones entre
estructural. El segundo dominio es el Modelo de patrones estructurales del diagrama de secuencia y
Reglas Activas, donde se define la asociación el diagrama de clases UML entre otros. En
entre el nombre de las alternativas para un patrón concreto analizando estas reglas de
estructural dado y las distintas reglas non-top que transformación mostramos como ejemplo un
crearán o modificarán los constructores del patrón estructural en el diagrama de secuencia que
modelo destino. Por último en una regla top da lugar a más de una transformación alternativa
tendremos también el dominio del Modelo para el diagrama de clases UML. Este patrón
Destino donde se define aquellos elementos estructural se muestra en la Figura 2: "un mensaje
comunes que serán creados o modificados por las con el estereotipo «Service/New» de la clase A a
diferentes alternativas. La precondición de la regla la B, y dos mensajes con el estereotipo «Connect»
top consta de restricciones sobre el dominio de la clase B a las clases C y D,".
origen y sobre el Modelo de Reglas Activas, así
La selección por parte del usuario del atributo resultado el diagrama mostrado en la Figura 4.a en
de calidad Changeability tal como se muestra en el que el patrón estructural formado por los
el Modelo de Calidad mostrado en la Figura 3.b mensajes 10 al 12 y el patrón estructural formado
da como resultado el diagrama de clase UML por los mensajes 13 al 15 en el modelo origen se
mostrado en la Figura 4.b en el que el patrón transforman en relaciones de asociación entre las
estructural formado por los mensajes 10 al 12 y el distintas clases. Las dos representaciones que se
patrón estructural formado por los mensajes 13 al muestran para cada modelo en la Figura 4.a y b
15 del modelo origen se transforman en dos clases son, el modelo destino tal como es generado por la
asociación. La selección del atributo de calidad herramienta de transformación y su representación
Appropriateness Recognizability da como como diagramas de clase UML.
Rental Cost
CostType Rental
Customer
CostType
Cost
(a) (b)
Figura 4. Modelos destino alternativos
(a) Generación.
(b) Validación
Flow hay que quedarse con los estados finales nuevos DSALs, aunque la mayoría de ellos se
del modelo de entrada, navegar por las transi- mueven en el espacio tecnológico de las gra-
ciones que llegan hacia ellos para obtener los máticas. Una de las propuestas que aboga por
estados de tipo FrontEndView que conducen al la definición de múltiples lenguajes específi-
estado final. cos de dominio para el desarrollo de aplica-
ciones web en el espacio de las gramáticas es
WebDSL [32]. WebDSL está compuesto por
varios sublenguajes: un lenguaje para el mo-
delo de datos, un lenguaje para la presenta-
(a) De FrontEndView a ViewState. ción, un lenguaje de consultas, y un lengua-
je de expresiones y acciones. Como extensión
a WebDSL, los autores también han definido
lenguajes específicos de dominio para tratar
con el control de acceso y con workflows. En
esta propuesta la generación de código se rea-
liza mediante reglas de reescritura de progra-
(b) De FrontEndView + estado final a EndState mas.
Con respecto a las propuestas de ingeniería
Figura 6: Ejemplos de mapppings web, y sobre todo, en relación al tratamien-
to que le dan a la navegación, hay que desta-
car que casi todas las propuestas modelan la
navegación de forma separada al modelo con-
6. Trabajos relacionados
ceptual y a la interfaz de usuario. En general,
Al ser MWACSL una propuesta que se apo- hay dos tipos de propuestas en relación a la
ya en varias disciplinas emergentes, los traba- navegación, aquellas que la modelan desde un
jos relacionados hay que buscarlos en áreas ta- punto de vista del comportamiento y las que lo
les como el modelado orientado a aspectos, los hacen desde una perspectiva estructural. Las
lenguajes específicos de dominio o la ingeniería primeras se basan en la semántica operacio-
web. nal, y normalmente, lo que hacen es explorar
En general, las propuestas de modelado el estado en el que quedará el sistema cuando
orientado a aspectos pueden agruparse en dos un evento particular lanza una transición. Las
grandes familias, por una parte, aquellas cuyo segundas se centran en estructurar la informa-
objetivo es el modelado de programas que se ción en contextos que representan trozos de
han implementado en una plataforma orienta- información que se conectan mediante enlaces
da a aspectos, tales como [13, 23, 9], y, por con significado. Las propuestas que se centran
otra, las centradas en estructurar los mode- en el comportamiento suelen usar diagramas
los de acuerdo a los diferentes aspectos que lo de estado para modelar la navegación. En este
componen, como [2, 10]. MWACSL está más grupo están [3, 33, 19, 12, 4].
alineado con la segunda familia, aunque no se Las propuestas centradas en la estructu-
descarta la primera en el caso en que la plata- ra, normalmente conciben la navegación como
forma sea orientada a aspectos, ya que así se una vista del modelo conceptual, lo que im-
pueden generar aspectos de AspectJ o hipers- plícitamente, impone un desarrollo en casca-
lices de HyperJ. da, en el sentido de que es necesario definir en
En relación a los lenguajes de aspectos espe- primer lugar el modelo conceptual para lue-
cíficos de dominio (o DSALs) se pueden encon- go poder definir el de navegación. Los auto-
trar muchas propuestas publicadas en las di- res de estas propuestas también las están ex-
ferentes ediciones del Domain-Specific Aspect tendiendo aplicando orientación a aspectos y
Languages Workshop. Muchos de los artículos un desarrollo de software dirigido por mode-
presentados en esta serie de talleres definen los. En este grupo están UWE [34], que usa la
modeling, pages 21–27, New York, NY, [16] James Kalbach. Designing Web Naviga-
USA, 2007. ACM Press. tion. O’Reilly Media, Inc., 2007.
[10] R. France, I. Ray, G. Georg, and [17] D. S. Kolovos, R. F. Paige, and F. A.C.
S. Ghosh. Aspect-oriented approach to Polack. Detecting and repairing inconsis-
early design modeling. IEE Software, tencies across heterogeneous models. In
151:173–186, June 2004. Proceedings of 2008 International Confe-
[11] S. Gordillo, G. Rossi, A. Moreira, J. Araú- rence on Software Testing, Verification,
jo, C. Vairetti, and M. Urbieta. Mode- and Validation (ICST08, pages 356–364.
ling and composing navigational concerns IEEE, 2008.
in web applications. requirements and de-
sign issues. In Proc. of the Fourth Latin [18] I. Kurtev, J. Bézivin, and M. Aksit.
American Web Congress, 2006. LA-Web Technological spaces: An initial apprai-
’06., pages 25–31, Oct. 2006. sal. In International. Federated Conf.
(DOA, ODBASE, CoopIS), Industrial
[12] E. A. Gorshkova and B. A. Novikov. Use Track, 2002.
of statechart diagrams for modeling of
hypertext. Programming and Computer [19] K.R.P.H. Leung, L.C.K. Hui, S.M. Yiu,
Software, 30(1):47–51, 2004. and R.W.M. Tang. Modelling web na-
vigation by statechart. In Proceedings
[13] Yan Han, Günter Kniesel, and Armin B.
of the 24th Annual International Compu-
Cremers. A meta model and modeling
ter Software and Applications Conference
notation for AspectJ. In Omar Alda-
(COMPSAC 2000),, October 2000.
wud, Grady Booch, Jeff Gray, Jörg Kienz-
le, Dominik Stein, Mohamed Kandé, Fai- [20] Cristina Videira Lopes. D: A Language
sal Akkawi, and Tzilla Elrad, editors, The Framework for Distributed Programming.
5th Aspect-Oriented Modeling Workshop PhD thesis, College of Computer Science,
In Conjunction with UML 2004, October Northeastern University, 1997.
2004.
[14] Anders Hessellund, Krzysztof Czarnecki, [21] Oracle Sun Developer Network. Javaser-
and Andrzej Wasowski. Guided develop- ver faces technology. http://java.sun.
ment with multiple domain-specific lan- com/javaee/javaserverfaces/, 2010.
guages. In Gregor Engels, Bill Opdy-
ke, Douglas C. Schmidt, and Frank Weil, [22] OMG. Meta object facility (mof) 2.0
editors, Proceedings of the Model Driven query/view/transformation specification.
Engineering Languages and Systems, 10th Technical report, OMG, Nov 2005.
International Conference, MoDELS 2007,
volume 4735 of Springer-Verlag Lecture [23] Ilka Philippow, Matthias Riebisch, and
Notes in Computer Science, pages 46–60. Kai Böllert. The Hyper/UML approach
Springer, 2007. for feature based software design. In
Omar Aldawud, Mohamed Kandé, Grady
[15] J. Nanard, G. Rossi, M. Nanard, S. Gor- Booch, Bill Harrison, Dominik Stein, Jeff
dillo, and L. Pérez. Concern-sensitive Gray, Siobhán Clarke, Aida Zakaria San-
navigation: Improving navigation in web teon, Peri Tarr, and Faisal Akkawi, edi-
software through separation of concerns. tors, The 4th AOSD Modeling With UML
In Proc. Conf. on Advanced Information Workshop, October 2003.
Systems Engineering (CAISE 08), volu-
me 5074, pages 420–434, Berlin, Heidel- [24] AspectJ Project. Aspectj home page.
berg, 2008. Springer-Verlag Lecture Notes Avalaible at: http://www.eclipse.org/
in Computer Science. aspectj/, 2009.
[25] A. M. Reina Quintero and J. Torres Val- [29] A. Schauerhuber, M. Wimmer, E. Kap-
derrama. Metamodelling and transfor- sammer, W. Schwinger, and W. Retschit-
ming sitemaps for reconciling information zegger. Bridging webml to model-driven
architecture and navigation design. In engineering: from document type defini-
J. R. Romero, O. Avila-García, and V. Pe- tions to meta object facility. IET Softwa-
lechano, editors, Publicado en las Actas re, 1(3):81–97, 2007.
de los Talleres de las Jornadas de In-
geniería del Software y Bases de Datos [30] P. Valderas, V. Pelechano, G. Rossi, and
(TJISBD), volume 3. Sistedes, 2009. S. Gordillo. From crosscutting concerns
to web systems models. In Proceedings
[26] A. M. Reina Quintero and J. Torres Val- of the Web Information Systems Enginee-
derrama. Sitemaps from a model dri- ring (WISE 2007), volume 4831, pages
ven perspective. a first step for bridging 573–582. Springer-Verlag Lecture Notes
the gap between information architectu- in Computer Science, 2007.
re and navigation design. In Joaquim
Filipe and José Cordeiro, editors, WE- [31] E. Vervaet. The Definitive Guide to
BIST 2010. Proceedings of the 6th Inter- Spring Web Flow. APress, 2008.
national Conference on Web Information
Systems and Technology, volume 2, pages [32] Eelco Visser. Generative and Transfor-
111–117. INSTICC. Institute for Systems mational Techniques in Software Engi-
and Technologies of Information, Control neering II, volume 5235/2008 of LNCS,
and Communication, April 2010. ISBN: chapter WebDSL: A Case Study in
978-989-674-025-2. Domain-Specific Language Engineering,
pages 291–373. Springer Berlin / Heidel-
[27] A. M. Reina, M. Toro, and J. Torres. Ge- berg, 2008.
nerating domain specific aspect code for
navigation from platform specific models [33] M.A. Alba Winckler. StateWebCharts:
in mwacsl. In C. de la Riva J. Tuya A. Mo- a Formal Notation for Navigation Mode-
reira, M. J. Suárez-Cabal, editor, Publica- lling of Web Applications. PhD thesis,
do en las Actas de las XIII Jornadas de Institute de Recherche en Informatique de
Ingeniería del Software y Bases de Datos Toulouse, 2004.
(JISBD 08), pages 385–390. Sistedes, Oc-
tober 2008. [34] Gefei Zhang, Hubert Baumeister, Nora
Koch, and Alexander Knapp. Aspect-
[28] A. M. Reina, J. Torres, and M. Toro. El oriented modeling of access control in web
metamodelado de un framework: Spring applications. In Mohamed Kandé, Do-
web flow. In A. Vallecillo, V. Pelechano, minik Stein, Omar Aldawud, Tzilla El-
and A. Estévez, editors, Publicado en las rad, Jeff Gray, and Jörg Kienzle, editors,
Actas de los Talleres de las Jornadas de 6th International Workshop on Aspect-
Ingeniería del Software y Bases de Datos Oriented Modeling, March 2005.
(TJISBD), volume 1. Sistedes, 2007.
más bien al contrario, es recomendable que los 2. Desarrollo dirigido por modelos de
entornos para DSDM soporten distintas formas de diagramadores basados en EMF
presentar un mismo modelo de cara a mejorar la
usabilidad de la herramienta, uno de los Esta sección revisa las soluciones existentes a día
principales inconvenientes para la adopción del de hoy para soportar el desarrollo dirigido por
DSDM en los últimos años [10]. modelos de editores gráficos (de tipo
Por otra parte, la idea de usar modelos para diagramador) para modelos EMF. En particular
guiar u orientar el proceso de desarrollo no nos centraremos en cómo deben utilizarse, es
implica un gran cambio respecto a las prácticas decir, el proceso de desarrollo a seguir cuando se
clásicas. En realidad la novedad estriba en el papel utilizan estas herramientas, y su nivel de
central que juegan dichos modelos y sobre todo en automatización.
aumentar el nivel de automatización. De hecho, la
única forma de aprovechar al máximo las ventajas
que ofrece la IDM, en términos de desarrollos más 2.1. Graphical Modeling Framework (GMF)
rápidos y baratos, pasa por automatizar al máximo
posible las diferentes etapas del proceso de Como ya hemos mencionado, GMF es la base
desarrollo [1]. Automatizar el proceso implica tecnológica sobre la que operan el resto de
automatizar cada una de las tareas que lo propuestas estudiadas en este trabajo.
componen y la única forma de hacerlo es a través Concretamente, GMF es un plug-in de Eclipse que
de la construcción de herramientas de soporte. proporciona un componente generativo y una
Como consecuencia, en los últimos años han plataforma de ejecución para el desarrollo de la
aparecido numerosas herramientas para soportar infraestructura de editores gráficos basados en
las tareas relacionadas con la puesta en práctica de EMF y GEF (Graphical Editing Framework).
un proceso de DSDM. Así, se encuentran Básicamente, el proceso de generación de editores
herramientas para definir y utilizar nuevos con GMF consiste en especificar un conjunto de
lenguajes de modelado; herramientas o lenguajes modelos a partir de los cuales GMF generará
para desarrollar transformaciones de modelos; automáticamente el código Java que implementa
herramientas para asegurar que los modelos son el diagramador y que podrá ser utilizado como un
consistentes y correctos, etc. nuevo plugin de Eclipse. La Figura 1 detalla el
Por otro lado, dado que estas herramientas son proceso de desarrollo completo y los modelos que
también componentes software, lo ideal sería que se manejan en cada paso. Nótese la distinción
para su construcción también se siguieran los entre aquellos pasos que deben realizarse
principios de la IDM. Un ejemplo de esta práctica manualmente y aquellos que GMF realiza
es la idea de ver las transformaciones de modelos automáticamente.
como modelos de transformación [2], de manera 1. Definir el metamodelo (también llamado
que puedan transformarse, validarse o generarse modelo de dominio) del DSL (.ecore)
automáticamente, como cualquier otro modelo 2. Generar el modelo .genmodel a partir del
[14]. modelo .ecore. Este modelo contiene
En este trabajo combinamos la necesidad de información específica de la plataforma donde
disponer de diagramadores con la idea de aplicar se va a ejecutar la aplicación final y permite
la IDM para su desarrollo. En particular nos configurar cómo se llevará a cabo la
centramos en la tecnología disponible para el generación de código.
desarrollo (dirigido por modelos) de editores 3. Generar el código que implementa el editor
gráficos en EMF. Concretamente revisamos las tree-based a partir del modelo genmodel. Es
propuestas existentes, que giran todas en torno a importante tener en cuenta que gran parte del
GMF (Graphical Modelling Framework), el código del diagramador es directamente el
framework para generación de diagramadores para código del editor tree-based. Es decir, muchas
modelos EMF que proporciona el Eclipse de las características gráficas del diagramador,
Modelling Project [5] y presentamos una nueva como los editores de propiedades para cada
herramienta que aumenta el nivel de elemento del modelo, son heredadas del editor
automatización del proceso. tree-based.
4. Definición del modelo que especifica los
elementos gráficos que utilizaremos para
GMF Project
EMF Project
Domain
2 EMF
3 EMF editor
Generator
Model (tree-like)
1 Model
.ecore .genmodel
Graphical
* Enel resultado
la mayoría de los casos,
no es correcto
Mapping
Model Model
4 6 7
.gmfmap
.gmfgraph
8
GMF
Tooling
Generator
9 GMF editor
Model (diagrammer)
5 Model
.gmfgen
.gmftool
5. Definición del modelo que permite especificar orden concreto. Otro problema inherente a GMF
los componentes de la paleta de herramientas es su respuesta ante la evolución del metamodelo
del editor (gmftool). del DSL. En estos casos, dependiendo de la
6. Generación del modelo de correspondencias naturaleza de los cambios, es muy probable que
(.gmfmap) entre los elementos gráficos, los sea necesario volver a generar y refinar el modelo
controles de la paleta y los elementos del de correspondencias, ya que los cambios
metamodelo de nuestro DSL. Para ello GMF realizados durante el refinamiento no fueron
proporciona un asistente que genera este almacenados durante el proceso. Igualmente,
modelo a partir de los anteriores. conviene mencionar que la documentación
7. Es habitual que las correspondencias disponible no es mucha y sobre todo, la
recogidas en el modelo generado no sean complejidad y opacidad del código generado, que
correctas, con lo que es necesario refinar dificulta la tarea de modificarlo cuando se quiere
dicho modelo manualmente. que el diagramador soporte funcionalidades
8. Generar el modelo generador de GMF alejadas de las tradicionales.
(.gmfgen) a partir del modelo de
correspondencias. 2.2. GenGMF
9. Generar el código Java que implementa el
diagramador. GenGMF [4] es una herramienta construida sobre
GMF proporciona un buen entorno para la EMF y GMF, cuya base teórica es la idea de que
generación automática de diagramadores, como en muchos casos las representaciones de los
prueba el hecho de que sea la base tecnológica del distintos elementos varían en pequeños detalles,
resto de propuestas que se estudian en este trabajo como por ejemplo el color, provocando que el
y de la contribución que presentamos. No desarrollador tenga que definir cada una de esas
obstante, el proceso de desarrollo que soporta no representaciones de forma independiente, dando
resulta trivial ni intuitivo, especialmente para lugar a modelos de gran tamaño y con
desarrolladores inexpertos. Esta complejidad se información duplicada.
debe fundamentalmente a la complejidad de los Para solventar este problema GenGMF
modelos asociados (gmfgraph, gmftool y propone utilizar un nuevo modelo denominado
gmfmap) y la cantidad de pasos que se deben gengmf. El objetivo de este modelo es definir
llevar a cabo de forma secuencial y siguiendo un
GMF Project
EMF Project
Domain
2 EMF
3 EMF editor
Generator
Model (tree-like)
1 Model
.ecore .genmodel
GenGMF Mapping
Model
4 6 Model
.gmfmap
.gengmf
Graphical
Model
7
GMF
Tooling GMF editor
Generator
Model (diagrammer)
5 Model 8
.gmfgen
.gmftool .gmfgraph
Con todo ello, podemos concluir que GenGMF no un lenguaje imperativo que permite crear,
soluciona los problemas detectados al evaluar consultar y modificar modelos EMF.
GMF, ya que la inclusión del nuevo modelo tan Además de esta familia de lenguajes, Epsilon
sólo permite automatizar una pequeña parte de proporciona varias facilidades para llevar a cabo
todo el proceso. No obstante, GenGMF sí tareas comunes en el marco de la IDM. Una de
proporciona algunas ideas ventajosas (que de ellas es EuGENia, una herramienta para
hecho estábamos explotando antes de la aparición simplificar el desarrollo de editores GMF [3].
de este proyecto) como el empleo de plantillas o la A partir del metamodelo ecore, o su
definición de un modelo que contenga especificación textual con Emfatic [6], EuGENia
información suficiente para generar de forma genera automáticamente los modelos gmfgraph,
automática otros modelos implicados en el gmftool y gmfmap. Para generar estos modelos, es
proceso. necesario haber anotado previamente el
metamodelo utilizando un conjunto de
2.3. EuGENia anotaciones predefinidas. EuGENia utiliza dichas
anotaciones para saber cuál queremos que sea la
Epsilon es una plataforma para la construcción de representación gráfica de un elemento concreto o
DSLs para tareas relacionadas con la gestión de el control correspondiente en la paleta de
modelos [8] que incluye varios lenguajes para herramientas. No obstante, un conjunto
tareas como la transformación (ETL) o la predefinido de anotaciones no suele ser suficiente
validación de modelos (EVL). A su vez, la base de para que el editor generado tenga exactamente las
la plataforma es EOL (Epsilon Object Language), características y comportamiento deseados. Por
ello, EuGENia es capaz también de procesar tres
.ecore
EMF
Annotated 2 Generator
3 EMF editor
(tree-like)
Model
.genmodel Synchronize
genmodel - ecore 6
Graphical
5 Model
.gmfgraph
Customization Tooling
4 Models Model
.gmftool
Mapping
Model
.gmfmap
7
8 GMF 9 GMF editor
Synchronize
gmfgen - ecore
Generator
(diagrammer)
Model
.gmfgen
Nótese que los pasos 1, 2 y 3 son los mismos que de GMF (GMFgen) y el código Java que
se detallaban al hablar de GMF. implementa el diagramador. Además, el uso de
4. Definir los ficheros de personalización Eugenia añade dos nuevas tareas al proceso: la
codificados en lenguaje EOL. sincronización de los modelos genmodel y
5. Generar, a partir del modelo ecore y los gmfgen con el metamodelo ecore. No obstante, las
ficheros de personalización, los modelos GMF mejoras aportadas por EuGENia sirven de base
(gmfgraph, gmftool y gmfmap). para la propuesta de este trabajo.
6. Sincronizar los modelos ecore y genmodel.
7. Generar, a partir del modelo de mapeo, el 3. Kybele GMF Generator
modelo generador de GMF (gmfgen).
8. Sincronización de los modelos ecore y En las secciones anteriores se ha planteado la
gmfgen.
importancia de automatizar el proceso de
9. Generar el código Java que implementa el desarrollo de diagramadores en el contexto de la
diagramador. IDM y se han mostrado algunas de las
Así, EuGENia no sólo reduce el número de herramientas que han surgido para soportar esta
modelos que debe definir el desarrollador, sino
tarea. Igualmente, en el marco de trabajos
que, además permite la reutilización de los anteriores a la aparición de GenGMF habíamos
ficheros de personalización (o al menos parte de identificado ya esta necesidad, empezando a
ellos) en diferentes desarrollos. Sin embargo, a trabajar para dar respuesta al problema [13].
pesar de estas mejoras el proceso de generación
En esta tercera sección presentamos
no es completamente automático, pues el KybeleGMFgen (Kybele GMF Generator),
desarrollador sigue siendo el encargado de generar nuestra contribución para soportar la generación
el editor tree-based de EMF, el modelo generador automática de diagramadores para modelos EMF.
Nuestra solución, que está basada en GMF y estos cinco lanzadores en un único lanzador, de
Eugenia, pretende explotar las ventajas forma que podamos aprovechar las ventajas que
proporcionadas por estas herramientas y proporciona la herramienta de Epsilon mientras
solucionar su principal desventaja, que no es otra reducimos los pasos a seguir para generar el
que el número de tareas que el desarrollador debe diagramador. El siguiente paso para aumentar el
realizar manualmente. grado de automatización del proceso pasa por
liberar al usuario de las tareas relativas al
Reducción del número de tareas a realizar por desarrollo del editor tree-based de EMF. Para ello,
el desarrollador. A través de menús contextuales,
bastará con que la herramienta realice de forma
EuGENia proporciona un conjunto de lanzadores
automática las tareas 2 y 3. Con todo, el proceso
para llevar a cabo las tareas 5, 6 y 8 de la Figura 3,
de generación de un diagramador GMF utilizando
mientras que GMF proporciona lanzadores para
KybeleGMFGen se reduce a los tres pasos
las tareas 7 y 9. La primera mejora que propone
mostrados en la Figura 4.
KybeleGMFgen es recoger la funcionalidad de
Graphical
Model
Domain OR
Model
(ECORE) 1 3
.gmfgraph
Tooling
.ecore
Annotated Model
.gmftool
Mapping
Model
2 .gmfmap
Customization
Models
GMF
GMF editor
Generator
(diagrammer)
Model
Synchronize
gmfgen - ecore
.gmfgen
(a) (b)
Una vez definido el metamodelo, añadimos un definir algunos elementos gráficos, configurar la
conjunto de anotaciones GMF para dirigir el paleta de herramientas y especificar las
proceso de generación tal como muestra la parte correspondencias entre los elementos de los
derecha de la Figura 5. Por ejemplo, indicamos modelos GMF.
que la representación de los objetos Model será el Para facilitar la tarea de codificar ficheros de
diagrama completo y que los objetos Structured personalización hemos elaborado una librería de
Type y TypedTable se representarán como nodos operaciones comunes que se recogen en el fichero
en el diagrama, que incluirán unas etiquetas, etc. Operations.eol y proporciona operaciones como la
En este punto podríamos generar directamente creación de etiquetas con un formato predefinido
el diagramador, pero obtendríamos un editor muy para representar estereotipos; inserción de
simple que solo permitiría “dibujar” cajas que compartimentos; inclusión de controles en la
representaran tipos estructurados y tablas tipadas. paleta de herramientas; definición de
Para obtener un editor más complejo codificamos correspondencias, etc. La Figura 6 muestra una
los ficheros de personalización (Ecore2GMF.eol, pequeña parte del fichero de personalización
FixGenModel.eol y FixGMFGen.eol). En este utilizado en el caso de estudio.
caso, utilizaremos el fichero Ecore2GMF.eol para
(a) (b)
Figura 7. (a) Invocación de la generación con KybeleGMFgen. (b) Ejemplo de uso del diagramador
En la actualidad existe un gran número de las facilidades de que se dispone para denir
aplicaciones heredadas que fueron construidas las acciones asociadas son dependientes de la
opment ), tales como Oracle Forms 6 o Bor- Una característica de los entornos RAD es
land Delphi 5, y que están siendo migradas a que el código de los eventos puede interac-
plataformas más modernas. Estas migraciones cionar directamente con una base de datos, sin
son realizadas manualmente en la mayoría de necesidad de invocar a funciones de la lógica
los casos. Recientemente ha emergido la Mod- de negocio que se encarguen de dicha tarea.
ernización Dirigida por Modelos, como forma Esto supone un problema cuando pretendemos
de conseguir automatizar las tareas propias de abordar la modernización de este código, dado
los procesos de evolución de software a través que hoy en día es una práctica habitual separar
de la aplicación de las técnicas básicas del De- las aplicaciones en capas con el n de facilitar
sarrollo Dirigido por Modelos ( Model Driven el mantenimiento, legibilidad y extensibilidad
Development, MDD). de la aplicación.
Refinamiento
DECLARE
DECL n Number;
DECL val
VARCHAR2(50);
BEGIN M2M
n := 1;
SELECT value
INTO val
FROM mappings
T2M M2M
Modelo Abstracto
Código Fuente Modelo de Código
de Eventos
(PL/SQL) (PL/SQL)
DECLARE
DECL n Number;
DECL val
VARCHAR2(50);
BEGIN
n := 1;
SELECT value
M2M
INTO val
FROM mappings
Patrones
Usuario Repositorio de
conformes
al DSL patrones
(patrones Forms)
Es deseable, por tanto, analizar los eventos cionado, y las conclusiones y trabajo futuro.
de GUI y disponer de una representación de
los mismos que sea independiente de entornos, 2. Visión general de la arquitectura
lenguajes y tecnologías, que pueda ser fácil-
mente estructurada en capas, y que en deniti- La arquitectura de modelos propuesta para
va contenga toda la información que sea posi- realizar el proceso de ingeniería inversa del
ble deducir del código fuente con el objetivo código de manejo de eventos en aplicaciones
de automatizar los procesos de generación de RAD se muestra en la Figura 1. Aunque es-
nuevas aplicaciones en la mayor medida posi- ta arquitectura esta orientada a la extracción
ble. del comportamiento de los eventos de Oracle
Por tanto, el propósito de este trabajo es Forms y PL/SQL, el esquema puede ser gen-
mostrar una aproximación de Modernización eralizado para otras tecnologías RAD.
Dirigida por Modelos para aplicar ingeniería En primer lugar, partimos de código de la
inversa de los eventos de aplicaciones RAD aplicación RAD original, código PL/SQL de
destinada a facilitar la migración a otras Oracle Forms en nuestro caso. El código se in-
plataformas, lo que nos permitirá la automati- yecta en un modelo que lo representa mediante
zación total o parcial del proceso. Se propone una transformación texto a modelo( T2M ), y
una representación independiente del lengua- que conformará con un metamodelo de la sin-
je para el código de manejo de eventos, y un taxis abstracta de PL/SQL.
DSL para establecer la correspondencia entre El segundo paso consiste en obtener el mod-
patrones código y tal representación. También, elo abstracto de eventos, que se utiliza para:
se describen varias usos de esta representación i) representar el código fuente de forma inde-
al automatizar la ingeniería inversa. pendiente a lenguajes y tecnologías, mediante
La sección 2 se muestra una visión gener- acciones habituales en los entornos RAD (co-
al de la arquitectura de modelos para realizar mo por ejemplo leer de la interfaz o escribir
el proceso de ingeniería inversa. La sección 3 en base de datos), y ii) eliminar detalles que
muestra el metamodelo empleado para repre- son superuos para analizar el comportamien-
sentar la información extraída de los eventos, to de los eventos. La obtención de un mod-
en la sección 4 se describe el DSL de patrones, elo abstracto de eventos a partir del modelo
y en la sección 5 se describen varios ejemp- de código PL/SQL se consigue mediante una
los de aplicación. Las secciones 6 y 7 nalizan transformación modelo a modelo (M2M). Co-
presentando respectivamente el trabajo rela- mo explicaremos más adelante, a su vez esta
ModelRoot
1 1 0..n
EventDefinition
1
+ targetElement
RADReadable
0..n in 1
0..n 0..n 0..n 0..n
RADVariable RADAction
0..1 out 0..n
Primitiva Signicado
ReadFromUI Lee un valor de un control de la GUI
WriteToUI Modica un valor de un control de la GUI
WriteToVar Escribe un valor en una variable temporal
ReadFromDB Lee valores de base de datos
ModifyUI Modica atributos grácos de los controles de la GUI
ManipulateData Realiza una operación sobre datos, por ejemplo, la obtención de una subcadena en
base a una cadena
SelectionFlow Control de ujo selectivo
ShowMessage Muestra una ventana modal emergente
Invoke Invoca a una función o procedimiento
cuadro 1 se muestran algunas de las primitivas elo propio que represente el código de forma
identicadas. Las primitivas se aplican sobre independiente de la plataforma, o utilizando
una o más variables de entrada, y si se tra- un metamodelo estándar como KDM [7] para
ta de una operación de escritura, tendrán una este n.
variable de salida asociada (referencia out ). El elemento ModelRoot actua como raíz del
Además, como se observa en el metamodelo, metamodelo, y contiene los eventos ( EventDef-
la entrada de una primitiva (dependencia in inition ), así como las variables globales a los
entre RADAction y RADReadable ) puede ser éstos, de modo que las variables de interfaz,
otra primitiva, lo que permite componer las las de base de datos y las predenidas puedan
primitivas para expresar acciones más com- ser reutilizadas. La metaclase EventDenition
plejas de un modo más compacto, esto es, sin tiene un nombre, untipo de evento, está aso-
necesidad de utilizar variables temporales para ciada al elemento targetElement que dispara
almacenar el resultado de otras primitivas. Es- el evento (normalmente un control de la inter-
ta representación mantiene, en cierta medida, faz), y contienen las variables y acciones que
la estructura del código original lo que facil- denen el comportamiento a realizar cuando
itará análisis de grano grueso. Otras repre- se activa el evento.
sentaciones más atómicas (como SSA [9] [10])
son útiles para análisis de grano no, y serán
4. Abstracción de código mediante
consideradas en futuros trabajos.
un DSL de patrones
Estas primitivas conforman un subconjun-
to básico suciente para comprender la fun- Para obtener el modelo abstracto de eventos
cionalidad del evento a alto nivel. Sin embargo, a partir del modelo de código fuente, la aproxi-
si en fases posteriores del proceso de modern- mación directa sería crear una transformación
ización pretendemos generar código a partir de modelo a modelo. Sin embargo, este enfoque
los eventos, necesitamos anar más en la es- presenta dos problemas fundamentales: a) el
pecicación de algunas de las primitivas para codigo de la transformación sería muy verboso,
incluir información más detallada. Por ejemp- b) incorporar nuevos casos de análisis impli-
lo, sería necesario modelar las condiciones de caría modicar la transformación.
las primitivas de control, o la funcionalidad de Para superar estas desventajas, se ha dis-
las primitivas de manipulación de datos. Con eñado un DSL para establecer corresponden-
el objetivo de representar toda la información cias entre patrones de código PL/SQL y prim-
del sistema original, en un futuro se evaluará itivas del modelo abstracto de eventos. La
la posibilidad de relacionar el metamodelo ab- dinámica consiste en aplicar los patrones so-
stracto de eventos con el metamodelo de la tec- bre el código de los manejadores de eventos
nología fuente, ya sea mediante un metamod- del sistema heredado, de modo que para ca-
«from SemanticActions»
«from PL/SQL» source FormsPattern target RADAction
Statement 1..n 1..n
SimpleRegExpr CompositeRegExpr
+not: boolean +operator: OpType
GenericVariable GenericVarGroup
+expr: string
+id: string +id: string
1..n
Con el objetivo de denir los patrones de que realizar un DSL manualmente para cada
tencia del DSL empareje con un trozo de mod- La sintaxis abstracta del DSL corresponde
elo de sintaxis abstracta mediante el uso de co- al metamodelo que aparece en la Figura 3.
modines (por comodin entendemos un elemen- El metamodelo hace corresponder un conjun-
to que permite emparejar una parte cualquiera to de sentencias PL/SQL con un conjunto de
del modelo de código). Además, se ha decidido primitivas. Este metamodelo tiene referencias
extender la propia sintaxis de PL/SQL para cruzadas con el metamodelo de PL/SQL, de
facilitar la escritura de los patrones, pues es modo que las metaclases Statement, Expres-
menos verboso que utilizar la sintaxis abstrac- sion y Variable representan sentencias, ex-
ta. presiones y variables de PL/SQL respectiva-
un repositorio de patrones (escritos con el En ocasiones ocurre que para denir los pa-
DSL). Así, es posible incorporar de un modo trones necesitamos especicar que algunos el-
sencillo nuevos patrones que sean dependientes ementos de un trozo de código no son rele-
de las convenciones de las empresas de desar- Generic-
vantes. Por esta razón, las metaclases
rollo, sin necesidad de modicar las transfor- Statement, GenericExpression y GenericVari-
maciones. able han sido denidas para actuar como co-
Se observa que tanto el DSL y el repositorio modines al expresar los patrones. Generic-
de patrones son dependientes de la tecnología Variable puede tener un identicador (id ) para
origen del proceso de modernización. En el fu- referirse a la misma variable en otra parte del
patrón y/o en la parte derecha de la regla en almacenar el nombre de la tabla y los atrib-
(nótese que con id no nos estamos reriendo utos, razón por la cuál en el patrón se especi-
al nombre de un variable concreta del código ca un guión para ignorarlos. Se especica que
PL/SQL). Mediante el atributo pattern tam- la variable (que identicaremos por X) en la
bién es posible especicar aquellas variables que se almacene el resultado de la consulta
cuyo nombre cumple con una determinada ex- debe concordar con un patrón, que concreta-
presión regular. La metaclase GenericExpres- mente es un patrón que dene las variables que
sion reemplaza a cualquier expresión, y utiliza se reeren a controles GUI. Por esta razón,
el atributo varGroup para especicar el iden- este patrón se traduce como una lectura de
ticador del grupo de variables que se usan en base de datos (ReadFromDB) que se escribe en
la expresión (de manera que pueda utilizarse una variable de interfaz (WriteToUI).
en la parte derecha de la regla). Respecto al
El tercer patrón traduce una asignación de
metamodelo abstracto de eventos se denen
una variable de cualquier tipo a una variable
dos tipos nuevos, GenericVarGroup y Gener- local. El cuarto patrón se utiliza para resolver
icVariable que representan a las variables y
variables de interfaz. Cuando se aplica un pa-
grupos de variables respectivamente, que se
trón, puede ocurrir que la parte derecha de la
han identicado en el modelo PL/SQL.
regla se reera a GenericVarGroup o Generic-
En el cuadro 2 se muestran algunos de los Variable. En estos casos es necesario aplicar
patrones establecidos para la tecnología Ora- otras reglas para resolver estas partes. Por
cle Forms. Para facilitar la comprensión de los ejemplo, es necesario traducir los tipos Gener-
mismos se utiliza una sintaxis más verbosa que icVariable del modelo abstracto de eventos en
corresponde directamente con el metamodelo tipos de variables concretas ( UIVar, Temp-
del DSL. Var,...). Por esta razón es necesario especicar
El primer patrón transforma una senten- patrones (como por ejemplo el cuarto patrón)
cia IF en una sentencia de control de u- para resolver estos casos.
jo de selección (SelectionFlow). El elemento Vamos a ilustrar el proceso de aplicación
GenericExpression se utiliza para representar de los patrones mediante un ejemplo. En
cualquier expresión, pues no nos interesa un el entorno Oracle Forms 6 se pueden aso-
tipo de expresión en concreto, aunque sí que ciar disparadores PL/SQL a la ejecución
nos interesan el conjunto de variables que se de un conjunto predeterminado de even-
utilicen en dicha expresión, a las cuales iden- tos. A continuación se muestra el códi-
ticaremos como V. go de un disparador asociado al evento
El segundo patrón representa una consulta WHEN_VALIDATE_ITEM del campo de
SELECT de base de datos que escribe en una texto USERNAME, que se ejecuta cuando se
variable. De momento no estamos interesados produce un cambio en el campo de texto.
1 WriteToVar (: USER_DATA . USERNAME , name ) naturaleza(UI, base de datos, etc.) y las agru-
/* línea 4 */ pa. Esta información puede ser a su vez uti-
2 SelectionFlow ( name ){
/* línea 5 */ lizada para dividir la aplicación original en ca-
3 WriteToUI ( ReadFromDB ( name ) , : USER_DATA . EMAIL ) pas, ya que cada fragmento de código de cierta
/* líneas 6 y 7 */
4 } naturaleza puede ser asignado a la UI, al con-
trolador, o a la lógica de negocio.
[5] R. Heckel, R. Correia, C. M. P. Matos, [8] B. K. Rosen. Data Flow Analysis for Pro-
M. El-Ramly, G. Koutsoukos, and L. F. cedural Languages. J. ACM, 26(2):322
Andrade. Architectural Transformations: 344, 1979.
From Legacy to Three-Tier and Services.
In Software Evolution, pages 139170.
[9] B. K. Rosen, M. N. Wegman, and F. K.
Zadeck. Global Value Numbers and Re-
2008.
dundant Computations. In POPL '88:
Proceedings of the 15th ACM SIGPLAN-
[6] A. M. Memon. An Event-Flow Model of SIGACT symposium on Principles of pro-
GUI-Based Applications for Testing: Re- gramming languages, pages 1227, 1988.
search Articles. Software Testing Verica-
tion and Reliability, 17(3):137157, 2007. [10] S. Staiger. Reverse Engineering of Graph-
ical User Interfaces Using Static Analy-
ses. In WCRE '07: Proceedings of the
[7] OMG. Knowledge Discov- 14th Working Conference on Reverse En-
ery Meta-Model (KDM) v1.0. gineering, pages 189198, 2007.
http://www.omg.org/spec/KDM/1.0/,
2008.
Mario Cervera1, Manoli Albert1, Victoria Torres1, Vicente Pelechano1, Javier Cano2,
Begoña Bonet3
1 2 3
Centro de Investigación en Prodevelop S.L. Conselleria de Infraestructuras y
Métodos de Producción de Software, 46001 Valencia, Spain Transporte,
Universidad Politécnica de fjcano@prodevelop.es Generalitat Valenciana,
Valencia, 46010 Valencia, Spain
46022 Valencia, Spain bonet_beg@gva.es
{mcervera, malbert, vtorres,
pele}@pros.upv.es
Abstract 1. Introduction
Over the last two decades many approaches have A Software Production Method (SPM) is an
contributed to establish a solid theoretical basis in integrated set of activities, roles, products, guides
the area of Method Engineering, but very few and tools for providing efficient and effective
engineering tools have been developed to provide support in the software development process. In
software support to their research results. This the Software Engineering (SE) field, CASE
situation is mainly due to the complexity of environments provide software support to SPMs
developing Computer-Aided Method Engineering contributing to improve the software development
environments that enable the specification of process in terms of productivity, maintainability,
Software Production Methods (SPM) and the reusability and quality of the developed software.
construction of CASE tools to support them. In However, despite the benefits that the use of
order to reduce this complexity, we advocate for CASE tools provides, these are not used as widely
the use of the MDD paradigm, which promotes as expected. One of the reasons for this is that
the use of models as the primary artifact in the CASE tools are implemented to give support to a
development process. Following this paradigm, in single SPM, paying no attention to the flexibility
this paper we present a Model Driven Method required by real software projects. As a result,
Engineering approach to perform the automatic developers find difficult to work with such tools
construction of tools that support SPMs by means as they do not allow them to adapt the SPM to the
of model transformations. This work is requirements of a specific project [21].
contextualized within a more challenging proposal One way to overcome this problem is by
that provides a methodological framework and a reconsidering the way in which these tools are
software infrastructure for the construction of built. The construction of such tools is one of the
SPM, covering from their specification to the main concerns of the Method Engineering (ME)
construction of the tool support. discipline. ME is defined as the engineering
discipline to design, construct and adapt methods,
Keywords techniques and tools for the development of IS [2].
Within the ME field, Computer Aided Method
Method Engineering, Model Driven Development, Engineering (CAME) environments enable the
CAME environment, CASE tool generation. construction of SPMs and the software tools that
support them. However, providing such support is
1
This work has been cofinanced by the Conselleria de Infraestructuras y Transporte by means of the Fondo Europeo de
Desarrollo Regional (FEDER) and the Programa Operativo de la Comunitat Valenciana 2007-2013.
not an easy task being a clear example the low becomes evident in [17] where a study of different
implementation degree and deficiencies found in CAME environments is presented. This study
existing CAME environments [17]. concludes that existent environments are
To improve this situation, in this work we incomplete prototypes that only cover part of the
advocate for the use of the MDD paradigm, which ME process. This is one of the reasons why these
proposes using models as the primary artifact of tools have not achieved the expected industrial
the development process [1], in the ME field. success and just MetaEdit+ [13] has been
Thus, this work provides a Model Driven Method commercialized. Examples of these CAME tools
Engineering approach to perform the construction are MERU, which supports Prakash’s and Gupta’s
of tools that support SPMs by means of model proposals [7], DECAMERONE, which supports
transformations. The work is being developed as Brinkkemper’s [3], MENTOR [22], MERET [11]
part of a more challenging proposal [4]. This or KOGGE [21].
proposal contributes to the ME area by providing These CAME environments, in general,
a methodological framework and a software present important deficiencies. Between these
infrastructure for the construction of SPMs. The deficiencies we highlight: (1) lack of support to
methodological framework covers from the the definition of SPMs and (2) lack of support to
specification of the SPM to the construction of the the automatic generation of CASE tools from the
tool support. The present work focuses on the last SPM definitions. This situation points out that
phase of this proposal where software tools are there is an actual need for tools that provide better
built from SPM specifications. support to ME. The problem is the high
The remainder of the paper is structured as complexity that entails the construction of these
follows. In section 2 we briefly present the state of tools as they must provide support both to the
the art focusing on the limitations of the existing SPM specification and the CASE tool generation.
CAME environments. Then, in section 3 we In order to overcome this problem some
provide a brief overview of the ME proposal in approaches apply the MDD paradigm using
which this work is contextualized. Section 4 metamodelling languages either to define design
presents the strategy designed to automatically notations [6] or SPM specifications [11].
obtain software tools to support specific SPMs. However, we find that these approaches do not
Finally, section 5 draws some conclusions and really take advantage of the possibilities that the
further work. MDD techniques offer. As stated in [1], “the
application of MDD techniques improves
2. State of the art developers’ short-term productivity by increasing
the value of primary software artifacts (e.g. the
The first research work in the ME field was models) in terms of how much functionality it
developed in the early nineties by Kumar and delivers”. Following this statement and contrary to
Welke who established the basis of this area [14]. what current ME approaches do, we want to
leverage models going one step further. Defining
Later, these foundations have been consolidated
with several proposals such as Brinkemmper’s [2] the SPM as a model and considering this model as
and Hofstede’s [12]. Since then, different a software artifact allows us to face the
proposals try to provide an answer to the existing implementation of the generation of software
problems in this area. This is the case of proposals support tools by means of model transformations.
such as Ralyté’s [15, 19], Henderson-Sellers’ [10], The use of model transformations as the means to
Prakash’s [18] or Harmsen’s [9] which tackle the carry out the tool generation is the main concern
method construction by assembling pieces or of this paper and is thoroughly detailed in section
fragments, proposing techniques for the efficient 4.
selection and assembly of these pieces. These
proposals have contributed to establish a solid 3. ME proposal overview
theoretical basis for the ME area. However, the
existing tool support for this basis does not live up In order to put into context the work presented in
to the expectations due to the complexity of this paper, this section briefly introduces the
putting this theory into practice. This problem proposal presented in [4]. This proposal covers
different stages of the ME lifecycle, in particular Flow Connector: It represents the order in
from the specification of the SPM to its which two associated tasks (each one in a
implementation (where the tool that supports the different end) are executed.
SPM is built). Figure 1 presents a graphical Gateways: It represents points within the
overview of the proposal. Each of its phases is SPM where the flow is diverged or converged
detailed in the next subsections. depending on the gateway type.
Guide: It is a document that provides some
3.1. Method design assistance to perform a task or to manipulate a
specific product.
During this phase, the method engineer builds the
Method Model by identifying all the elements We distinguish two parts in the Method Model, the
involved in the SPM. The most significant product part, which represents the artifacts that
elements used in the Method Model construction developers should construct during the execution
are the following: of a SPM project, and the process part, which
Task: It represents an activity performed consists of the procedures that developers must
during the execution of a SPM instance (e.g. follow to construct such products. For the
business process analysis, web specification, construction of the Method Model we provide a
etc.). Method Base repository. The Method Base
Product: It represents an artifact that is either contains method fragments (descriptions of IS
consumed or generated in a task (e.g. business engineering methods, or any coherent part thereof
process model, structural model, etc.). [8]) that can be reused in the design of new
Role: It represents an agent that participates in Method Models. It is important to note that the
a SPM performing different tasks. This can Method Model does not contain details about the
refer to a human being agent (e.g. analyst, languages or technologies that are going to be
developer, etc.) or to an automated system. used during the execution of the SPM; this is done
in the next phase.
2
An Eclipse feature is a group of Eclipse plugins.
The core of the generation process is a model The generation process of figure 4 has been
transformation that obtains a software tool implemented in the CAME environment
supporting the SPM specified in the Configured developed to support the proposal [4]. In this
Method Model. As shown in the figure, the context, the generated tools are built as Eclipse
transformation uses the product and process parts applications, in particular based on the MOSKitt
of the SPM model to give support to both parts as tool [16]. This means that these tools are built as
follows: MOSKitt reconfigurations that only contain the
The support provided for the product part set of plugins that implement the software support
involves providing all the resources that required by the SPM.
enable the manipulation of the SPM products. The use of the MOSKitt platform implies that:
This support is given by the software (1) the software resources that give support to the
components that make up the infrastructure of product part of the SPM correspond to Eclipse
the tool and correspond to the assets that were plugins and (2) the final tool is obtained from a
associated to the SPM elements in the Method Product Configuration File (.product file). This
Configuration. type of files gathers all the required information to
The support provided for the process part automatically3 generate an Eclipse-based tool such
corresponds to a new component that enables as MOSKitt. So, considering that the tool is
the execution of SPM instances by means of a obtained from a Product Configuration File, the
process engine. During the SPM execution,
this component invokes the different software 3
The Eclipse Product Export Wizard (functionality
resources that allow the software engineers to provided in org.eclipse.pde) automatically generates an
create and manipulate the SPM products. Eclipse-based application from a .product file.
model transformation is in fact a model-to-text support part: (1) identifying the software
(M2T) transformation implemented using the resources necessary to support the tasks and
Xpand language [24]. This transformation takes as products of the SPM and (2) solving the
input the Configured Method Model and generates dependences between software resources.
a .product file through which the final tool will be
automatically generated. In order to generate this Identifying software resources
file, the M2T transformation must identify the
software resources (Eclipse plugins) in charge of The M2T transformation explores the SPM model
providing support to the SPM. Once these and identifies the software resources that are
resources have been identified, the transformation necessary to support the tasks and products of the
includes in the Product Configuration File the list SPM. The software resources are identified by
of features that need to be deployed in the final means of the assets that were associated to these
tool (MOSKitt construction is based on features). elements during the Method Configuration phase.
More insights on this M2T transformation and Note that when a task or a product does not have
the tools obtained for product and process support an associated asset, the generated tool will not
in the final tool are presented in the next provide support to that element.
subsections. It is also important to highlight that the
integration of these resources into the MOSKitt
4.1. Software support for the product part reconfiguration representing the final tool can be
automatically performed since these resources
This section focuses on the part of the M2T correspond to features and plugins created within
transformation that obtains the tool support for the the Eclipse/MOSKitt platform itself. Thus, the
product part of the SPM. This product support integration of tools developed outside of the
refers to the tools (editors, transformations, etc.) context of Eclipse/MOSKitt cannot be guaranteed.
that have to be integrated into the final tool to In figure 5 two Xpand rules of the M2T
enable the manipulation of the SPM products and transformation are shown. In these rules the list of
tasks. For instance, a SPM that includes a product features of the Product Configuration File is
such as a “Business Process Model” requires the generated. The first rule is invoked for each
inclusion within the tool supporting the SPM of a instance of the class ContentElement (i.e. tasks
proper editor to manage this kind of models. and products). This rule invokes the second rule,
Furthermore, to obtain a valid product support which produces the output. The second rule
it is also necessary to solve the dependencies of accesses the property “FeatureID” of the content
the software components required to support the elements. This property is created during the asset
SPM product part with other software association and contains the identifier of the
components. Therefore, we distinguish two steps feature (software resource giving support to the
in the M2T transformation that obtains the product content element) packaged in the asset.
Solving dependencies between software Eclipse views (see Figure 65). Each of these views
resources provides a specific functionality but their common
goal is to facilitate the user participation in a
Once the required software resources are specific project. The details of these views are the
identified, it is necessary to solve the potential following:
conflicts that can arise when integrating these Product Explorer: This view shows the set of
resources (plugins) into the same platform products that are handled (consumed,
(MOSKitt). To achieve this goal, we specify the modified and/or produced) by the ongoing and
dependencies between software resources within finished tasks of the process. This view can
the assets. This specification allows the be filtered by roles so that users belonging to a
transformation to retrieve the dependencies for specific role have only access to the products
each software resource identified in the previous they are in charge of. Then, from each
step and to include them in the Product product, the user can open the associated
Configuration File. editor to visualize or edit its content.
As an example consider the asset of figure 3 Process: This view shows the tasks that can
containing the MOSKitt BPMN editor. This asset be executed within the current state of the
defines a dependency with the MOSKitt MDT project. The execution of the tasks can be
component4. Therefore its feature must also be performed automatically (by launching the
included in the .product file so that the plugins transformation associated to the task as a
implementing this component are also included in software asset) or manually by the software
the final tool. engineer (by means of the software resource
associated to the output product of the task).
4.2. Software support for the process part Similarly to the Product Explorer, this view
can be filtered by role, showing just the tasks
In addition to the support provided for the product in which the role is involved in.
part of the SPM, according to our proposal, the Guides: This view shows the list of guides
generated tool also provides support for the associated to the task selected in the Process
process part. This support guides and assists users view. The objective of these guides is to assist
during the execution of SPM instances (projects). the user during the execution of such task,
The process support is provided by means of a providing some insights on how the associated
software component (the Project Manager products should be manipulated. These guides
Component) that is common to all SPMs. This correspond to resources that were associated
component implements a graphical user interface to tasks during the configuration step of the
(GUI) that enables the execution of SPM SPM.
instances. To make this possible, the Project Product Dependencies: This view shows the
Manager Component uses the Configured Method dependencies that exist between the products
Model at runtime (runtime in this context that are handled in the project. So, it allows
corresponds to the SPM instances execution in the users to identify which products cannot be
CASE tool). created or manipulated because of a dependent
Considering these aspects of the process product has not yet been finished. In addition,
support, the M2T transformation must always these dependencies are organized by roles.
include in the product configuration file a pre- This organization gives to the user the
defined feature that groups the set of plugins that knowledge of who is responsible of those
implement the Project Manager Component. products he/she is interested in.
The Project Manager Component endows the
generated tool with a GUI composed of a set of
4 5
The MOSKitt MDT component implements the Available also at
functionality that is common to all the MOSKitt http://users.dsic.upv.es/~vtorres/moskitt4me/
graphical editors (such as copy & paste, view creation,
etc.).
Regarding the implementation of the Project keeps the state of the running SPM instances.
Manager Component, it has been divided into four Given a SPM instance it provides a set of
components of a lower level of granularity. The methods that return the current tasks and also
M2T transformation that generates the product allow the method engineer to mark them as
configuration file always includes a feature that completed in order to enable the progress of
groups the Eclipse plugins that implement these the process. Note that, to make this progress
four components. Even though the possible, the component must access the SPM
implementation of these components is model and retrieve the distribution of the tasks
independent of the SPM, as stated previously, they along the SPM process.
need the information stored in the Configured Product Management. This component is in
Method Model to work properly in the generated charge of the management of the products and
tool. Figure 7 depicts graphically these four tasks. Regarding products, the component
components. identifies the editor that is required to
Project Manager. This is the core manipulate such product. Regarding tasks, we
component. It implements the GUI of the differentiate between automated and manual
Project Manager Component and gives tasks. For automated tasks, the component
support to the process part of the final tool. To obtains the transformations that have to be
do so, this component uses the other three. executed. For manual tasks it obtains the
Process Management. This component editor that allows creating and editing the
implements a light-weight process engine that products manipulated in this task. All this
information is contained in the SPM model, in support. Specifically, this process is divided into
particular in the assets associated to the tasks two phases, being the last one the central focus of
and products included in the model. this paper.
Therefore, this component also needs to Regarding future work, we are working on the
access the SPM model to get this information. improvement of the CAME environment that
Method Specification. This component loads supports our proposal. We are enhancing: (1) the
the different elements of the SPM model management of the dependencies between the
(roles, tasks, products, etc.) to facilitate later resources that have to be included in the final tool
access to them. All these elements are supporting the SPM under construction, and (2)
obtained from the SPM model. the workflow engine that enables the execution of
the SPM process and gives support to the process
5. Conclusions part of the proposal.
[6] Grundy, J. C., Venable, J. R.: Towards an [15] Mirbel, I., Ralyté, J.: Situational method
Integrated Environment for Method engineering: combining assembly-based and
Engineering in Proceedings of the IFIP roadmap-driven approaches. Requirements
8.1/8.2 Working Conference on Method Engineering V.11, Nº 1, (2006)
Engineering, Hall, 45-62 (1996) [16] MOdeling Software Kitt (MOSKitt),
[7] Gupta, D., Prakash, N.: Engineering Methods http://www.moskitt.org
from Method Requirements Specification. [17] Niknafs, A., Ramsin, R.: Computer-Aided
Requirements Engineering, Vol. 6 (2001) Method Engineering: An Analysis of
[8] Harmsen, A. F., Arnhem, T., Ernst, M., Existing Environments. CAiSE, 525-540
Consultants, Y. M., Gegevens, C., (2008).
Bibliotheek, K., Haag, D., Frank, H. A.: [18] Prakash, N.: Towards a Formal Definition of
SITUATIONAL METHOD ENGINEERING Methods. Requirements Engineering. 1: Vol.
PROEFSCHRIFT 1968. 2. - pp. 23-50 (1997)
[9] Harmsen, F., Brinkkemper, S.: Design and [19] Ralyté, J., Rolland, C.: An Assembly Process
Implementation of a Method Base Model for Method Engineering. CAiSe. - pp.
Management System for a Situational CASE 267-283 (2001)
Environment. APSEC (1995) [20] Reusable Asset Specification (RAS) OMG
[10] Henderson-Sellers, B.: Method Engineering Available Specification version 2.2. OMG
for OO Systems Development. Document Number: formal/2005-11-02
Communications of the ACM Vol. 46. Nº 10, [21] Roger, J. E., Suttenbach, R., Ebert, J.,
pp. 73-78, (2003) Süttenbach, R., Uhe, I., Uhe, I.: Meta-CASE
[11] Heym, M., Osterle, H.: A Semantic Data in Practice: a Case for KOGGE. Springer ,
Model for Methodology Engineering. 5th 203-216 (1997)
Workshop on Computer-Aided Software [22] Si-Said, S., Rolland, C., Grosz, G.:
Engineering, pp. 142-155. IEEE Press, Los MENTOR: A Computer Aided Requirements
Alamitos (1992). Engineering Environment CAiSE, 22-43
[12] Hofstede, A., Verhoef, T. F.: On the (1996)
Feasibility of Situational Method [23] Software Process Engineering Meta-model
Engineering. Information Systems. 6/7 Vol. (SPEM) OMG Available Specification
22. (1997) version 2.0. OMG Document Number:
[13] S. Kelly, K. Lyytinene, M.Rossi. MetaEdit+ formal/2008-04-01
A Fully Configurable Multi User and [24] Xpand,
MultiTool CASE and CAME Environment. http://www.eclipse.org/modeling/m2t/?projec
CAiSE 1996. t=xpand
[14] Kumar, K., Welke, R. J.: Methodology
Engineering: A Proposal for Situation-
Specific Methodology Construction.
Challenges and Strategies for Research in
Systems Development, John Wiley & Sons,
Inc., 257-269 (1992).
Abstract
will be stored in a centralized server where the enables the knowledge processing, sharing and
ADK connects to and downloads locally. reuse between applications.
Openness and scalability are major factors, The SIB OSGi Bundle exposes a set of
therefore connectors for different communication services using the public interfaces ISIB (shows
protocols and different languages are feasible. The all the methods to interact with the SIB using
Smart Application Wizard includes the SSAP Message type communication), which
OWL2Classes facility, which translates several controls the communication between
ontologies into programming languages classes in Gateways/KP and SIB, and IViewer (exposes
order to be used with the SOFIA middleware. methods to observe the content and to register
When this class is used, all its interactions are sent changes within the SIB).
to the SIB; therefore programmers do not need to The Semantic Model is based on Jena
have expertise knowledge about ontologies. (Semantic Web Framework), which provides an
API to allow the storage of ontologies, classes,
3. Implementation individuals, properties and all data related to
ontologies. It is assumed that languages can be
A KP is divided in four layers: 1. Logic. A used for the interaction with the model are OWL
developer is only responsible for programming (or RDF-XML) and N3. Decisions are based on
this layer and it represents the functionalities a the definition of the SSAP Message Protocol
final user or a company wants to create. 2. defined in Description of XML encoding of SSAP
Semantic model. This layer is automatically document (internal Wiki). This model maintains a
generated by the OWL2Classes tool of the ADK. full class hierarchy of already connected nodes
It is an API with the classes in a specific and the individuals (instances or triples) that has
programming language representing ontologies joined the SIB. All KPs must send in their first
selected in the wizard tool. Thus, they are the ontology model connection to the SIB, so that, all
concepts to exchange with the smart space. 3. individuals defined in that KP can be understood
SSAP. This layer gathers all APIs dedicated to by the SIB and other KPs in the Smart Space.
deal with the SIB. The upper layer knows how to When a KP is removed from the Smart Space all
invoke the appropriate methods of this API.[2] the information about this KP is also removed
Connection. The different connectors are plugged from the SIB Semantic Model, including all the
in this layer to connect with the SIB. It is also inserted individuals.
responsible for Semantic Information Broker The ADK Subscription Manager is
(SIB) discovery. responsible for maintaining the information about
Hence, the complexity related with ontologies the subscribed KPs and Session Manager manages
and communication protocols are totally the KPs connected to the SIB at a given moment.
encapsulated in a very easy API formed by plain Only connected KP-nodes are allowed to perform
classes (model layer). Developers only have to the SSAP operations in the SIB. The SIB into a
instantiate them and use their getters/setters in Sofia smart space needs to interoperate with the
order to interact with the smart space. KPs of several smart applications that are running
into the smart space, which enables the KP to
change information into the SIB and the SIB
4. Testing and Deployment communicates those change to several KPs
subscribed to them. KP can be executed in any
The SIB is the responsible for the interoperability physical device with communication capabilities
between heterogeneous smart applications and to interoperate with a SIB of the smart space. The
devices. Its core is differentiated in three parts; use of Gateways is a solution to avoid problems
1.Sessions. Refers to the KP connected to the SIB when having devices with different
at a given moment. 2. Subscriptions. Subscribed communication protocols.
nodes are notified when certain conditions in the A modular and extendible architecture is
semantic model are produced. 3. Semantic Model achieved by having the OSGI platform as a
provides the interoperability level needed to module container, where the SIB or the Gateways
connect different devices, platforms, sensors or are OSGI bundles and SIB bundle changes will
data using the SOFIA Smart Space context. It also
not affect any Gateway bundle. This architecture to design easy applications visually linking the
will be enhanced with new Gateways supporting different parts semantically [2], [3]. This approach
new communication protocols and increasing the will gain high dynamicity and composability
amount of devices where smart applications can inside a smart space, as the dependencies are not
be deployed, freeing new Gateway developers of established statically but semantically and could
any responsibility regarding opened sessions be solved at runtime based on semantics. This
(KPs-SIB) as the fragment bundle will be feature will be ready with the second version of
extended by the Gateway. the ADK.
Moreover, two specific Gateway OSGI
Bundles are been looked at the moment to support References
TCP/IP and Bluetooth connections. The platform
is also open to develop new Gateways supporting [1] W3C, Ontology Driven Architectures and
more connection protocols. Potential Uses of the Semantic Web in
SIB includes a server to represent any server Systems and Software Eng.
visually, which main functions are start and stop online:http://www.w3.org/2001/sw/BestPracti
the SIB and a viewer to visualize the content of ces/SE/ODA/, 2006
the embedded SIB and has three tabs: Sessions, [2] Vanden Bossche, M., Ross, P., MacLarty, I.,
Subscriptions and Semantic model (to check Van Nuffelen, B., Pelov, N.: “Ontology driven
insertions and removals among connected KPs software engineering for real life
and the SIB, key tool to test KP). applications,” in Proc. 3rd Intl. Workshop on
Semantic Web Enabled Software Engineering,
5. Conclusion 2007
[3] de Oliveira, K. M., Villela, K., Rocha, A. R.,
The ADK has already achieved its main goal, to Travassos, G. H.: “Use of ontologies in
aid developers programming high quality smart software development environments,” in
applications; nevertheless SOFIA aims to push Calero, C., Ruiz, F., Piattini, M. (eds)
this concept to the limit allowing final users to Ontologies for Software Engineering and
build their own applications. To do so, we are now Software, 2006
defining a smart application model (within ODD)
* This work is part of the project "Software Process Management Platform: modelling, reuse and
measurement" (TIN2004/07083) and the project “Thuban: Natural Interaction Platform for Virtual
Attending in Real Environments” (TIN2008-02711).
testing software for applications validation is for automatic generation of database instances is
performed. In section 5, some conclusions and proposed. The input of this method consists of
future lines of research are presented. SQL statement, database schema, and assertions
to define the user requirements. The output is a set
2. Related Works of constraints to validate the desired database
instances.
In general, in order to validate the user We think that applying black-box techniques
requirements a wide range of traditional software, could be more simple and practical, especially
testing techniques have been proposed, but when there are an enormous number of
relatively little effort has been spent on the testing interactions with a database. An example of the
database applications [2]. In [3] the issues which difficulty in applying white-box techniques is the
make testing database applications different from case of the validation of active database
other types of software have been identified, and a applications. Each trigger has an independent
tool has been developed for populating a database structure but in execution time it is very difficult
with meaningful data which satisfies constraints. to detect all possible paths to be validated. Thus,
The cited work considers only the constraints we believe that using the equivalence-class testing
which can be expressed in the database schema by technique could make the validation of database
using SQL’s Data Definition Language. Our work applications easier. The equivalence-class testing
agrees with the issues in testing database is a fundamental technique for functional testing
applications presented in the cited work. which checks the software without worrying about
Nevertheless, the difference between the two its implementation and structure [9]. In this type
works is that in our work the testing software is of testing, the examiner’s responsibility is to
derived from the constraints which are expressed provide input or initial data and to validate the
in a UML class diagram. These constraints can be output results. The main objective is to check
whether the tested software fulfils the user
a basic type such as (primary key, foreign key,
and unique key) and specification of OCL clauses. requirements or not.
Our approach joins the UML in aspects that have Our approach starts from the specification of
been widely accepted and supported by many constraints in the design phase, which are then
implemented according to the chosen database
CASE tools in the software validation field.
In [4], static analysis techniques (also called system (SQL Server, Oracle, MySQL). Not only
white-box techniques) have been used to extract are the basic constraints of the relational DBMS
useful information in a web database application. considered (primary keys, unique or foreign key),
but also those constraints which are more complex
Static analysis testing is a fundamental structural
technique that depends on software structure and and which can be implemented by triggers (see
implementation. That is, the white-box approach OCL2Trigger [12]).
has been used to construct an application graph
which systematically generates selected paths 3. MDA for Deriving Testing Software
based on that graph. Each path represents a
possible scenario for use of the application. A test The main objective of deriving testing software
case is organized as an XML file and is from the OCL specifications is to ensure that
automatically executed. In [5] [6] and [7], the triggers application used to enforce these
white-box testing technique is also applied to specifications fulfills the user requirements. In this
validate a database application. The main section, we will explain our approach for deriving
objective is to validate all possible paths in the functional testing software from the OCL
execution flow of a program. By means of these specifications according to the MDA framework.
paths all the program statements are executed and There are three phases for adaptation of MDA to
examined at least once. In [8] a white box method our approach (see figure 1).
Class Diagram
PIM/UML
OCL
Transforming OCL
to SQL Testing
Software Model
PSM/SQL Testing Validation
Testing
Components Cases Queries
Transforming SQL
Components to DBMS
Testing Software Model
Testing
Software MS-SQL DB2 ORACLE
The first one, called PIM, represents the for testing applications, and validation queries to
logical view of the specification of integrity ensure the correctness of the tested application. In
constraints using OCL clauses in a class diagram. this work, we consider the generating of test cases
The second one, called PSM, describes the and validation queries while the examiner must
technology used to build the necessary prepare validated initial data to be inserted before
components of the testing software. In this phase, the testing is begun.
the SQL notation is used to refer to the recent
2003 standard [10]. The standard SQL is used to 3.1.1 Validation Queries
describe these components because we focus on To ensure the correctness of the integrity
testing relational database applications. The third constraints each OCL clause in the class diagram
phase is called Testing Software which describes is mapped to a validation query. Each query is
the software technology which can be applied applied after a test case is run. Although an OCL
directly in a target commercial DBMS such as expression specifies invariant, pre-condition, post-
Oracle, DB2, and MS Server. condition, and other types of constraints, in this
Two models are used to carry out the work the invariant constraints are considered. An
transformation rules between these phases invariant constraint is an OCL expression that can
automatically: Transforming OCL to SQL be associated with a class, a type or interface in a
components Model, and Transforming SQL UML class diagram to define an integrity
components to DBMS testing software Model. In constraint [1]. It must be true for all instances of
the following we present a brief description of element type at any time. The OCL invariant
these models. constraints are also used to specify relationship
constraints in a class diagram such as multiplicity,
generalization, etc., although these constraints are
3.1. Transforming OCL to SQL Testing already included in the diagram [11].
Software Model Let us consider that we have a scenario Si
consisting of a set of classes (each class is mapped
According to Figure 1, each OCL constraint is to a relational table), and each one of these classes
transformed into two testing software contains a set of OCL clauses to define the
components. Each one of these components is integrity constraints. Each one of these OCL
related to an issue in testing database application. clauses is mapped to a SQL query. In this section,
These issues are defined in [16] as specifying we will show the mapping rules which are used to
database states, applying test cases, and observing transform OCL clauses to SQL queries (℘i⇒σi),
database state after test execution. According to where ℘ is an OCL expression, σ is a negation
these issues, the testing software components are
SQL expression corresponding to℘, and i is one
defined in our work as initial data to be inserted
of the mapping rules. We use the Relational
before the testing is begun, test cases to be applied
the input conditions because no DBMS is able to cases by generating a test case for each tuple in
execute any invalid state. It means that if there is the context relation (the relation in which the
any syntax error in the specification of these testing is performed).
events, the DBMS itself will reject this operation In this work, we will focus on applying the
by raising a compilation error. As in the case of invalid testing cases because we believe that their
the critical events, the validation of attribute executions contribute a certain confidence in
values of the input conditions is also carried out detecting possible defects in the tested application.
by the DBMS itself. This means that the input “Test cases representing unexpected and invalid
conditions must always be valid. input conditions seem to have a higher error-
For example, if we insert a tuple into a table, detection yield than do test cases for valid input
the DBMS first verifies the correctness of the conditions” [15].
inserted tuple before placing it into the Let us consider that a relation A contains the
corresponding table, or when a tuple is deleted following schema: A={a1.PK, …, an}, {(p1, …), (p2,
from a table, the DBMS validates first that the …), ……(pm, …)}. It has n attributes and m tuples,
deleted tuple exists in the corresponding table and a1 is the primary key of A. {p1, p2,…., pm} are
before deleting it. Nevertheless, from the database the primary keys values. The testing cases which
semantic point of view, it is possible to identify are defined on A are shown as follows:
two types of input conditions, valid and invalid
classes. For example, the insertion of t1(x, y) into tk={event(A.ai),Invalid(ai.value), (∀pj∈A,
a table could be valid for the semantic, while the j=1…m)}
insertion of t2(x, z) into the same table could be where (tk) is an index number for each test
invalid for the semantic. In these two cases, the case. The event(A.ai) is a critical event which
DBMS accepts the insertion, but the difference is modifies an associated attribute in the relation A.
that the first case produces a correct semantic This event can violate the expression rules shown
while in the second a false semantic is produced. in the previous section. The Invalid(ai.value) is the
In accordance with what we have stated above, associated invalid attribute value for that event.
table 1 specifies one valid class for each critical As we previously stated, we apply the invalid
event and two equivalence classes for each testing cases only. The (∀pj∈A, j=1…m) means
attribute value: one valid class when the attribute that the testing cases are applied for each primary
value fulfils the corresponding constraint and one key value (i.e., for each tuple) in the relation A.
invalid class when the attribute value does not According to standard SQL for the Delete and the
fulfil the constraint. Update events we can define a condition (WHERE
Once the valid and the invalid equivalence clause) to limit the modified tuples. For example,
classes are defined, in the next step the necessary using the condition (WHERE a1=pj) limits the event
testing cases corresponding to each one of these only on the tuple which has pj as a primary key
classes is derived. A test case is defined as a value. For the Insert event no such condition is
combination of classes from different needed. Therefore, the testing cases for insertion
classifications. For each test case exactly one class will be applied only once for each relation, and
of each classification is considered [14]. In the user needs to use a new primary key value to
addition to that, to increase the confidence level in apply the insertions.
our approach we will increase the number of these
Table 1.The valid and invalid equivalence classes of the rules expression
3.2. Transforming SQL Components into transformed into a related statement in a target
DBMS Testing Software Model DBMS (1 to 1). Here, we are also using a template
for each statement and for each DBMS. The
Although most Relational DBMS use SQL execution of these templates is done according to
components, there are some differences between a similar algorithm which has been shown in the
the specific characteristics of these DBMS. These case of mapping standard SQL queries to a target
differences make that testing software of one DBMS Select statement.
system cannot be used directly with another The following statement is used for mapping the
system without modification, although sometimes Update event as a DML statement corresponding
these differences are too small to be significant. to the expression rule (c) using the MS SQL
Once the standard SQL components are derived in Server.
the previous section, these components are DML_Upd:=“UPDATE Context_table SET
mapped to target DBMS testing software. The a=V WHERE PK=Value;”
mapping is performed directly, that is, each SQL
component is mapped into one related component The other invalid test cases of the expression rules
in a target DBMS (1 to 1). As shown in the are generated in the same way as the previous one.
following processes:
3.2.1 Mapping standard SQL queries to target 4. Application Example
DBMS Select statement
A standard SQL query is mapped to one Select In this section, an application example is
statement of a target DBMS. To do this mapping, presented. The aim of applying testing software is
DBMS Select templates are used. A select to ensure that the application fulfils the user
template is a generic query template in which requirements. To do that, the initial data, test
some values are established as parameters so that cases, and validation queries involved in this
different particular constraint situations can be process are automatically generated. These
derived by giving different values to the components are saved into text files which are
parameters. There is one template function for ready to be directly submitted to our tool. Before
each DBMS and for each expression rule starting the testing, the class diagram or schema
considered in this work. The below example, a (SCH) is divided into subschema (Sub1, Sub2, ……,
generic template of the expression rule (d) is Subn) or scenarios. Subi is a subschema which
presented to illustrate the transformation of the contain relations (R1, R2, …., Rm) and constraint
standard SQL query into Oracle 11g. defined for these relations.
Let us consider the following employees’
SELECT * FROM Context_table database; DEPT and EMP are two relations of a
WHERE PK IN subschema (Subi).
(SELECT FK FROM Related_table
GROUP BY FK HAVING COUNT(*) DEPT (deptno PK, name, budget);
Operator Value); EMP (empno PK, name, age, sal, deptno FK);
This select statement is used to validate the Let us consider that the following integrity
database state whenever a test case contains one constraints are defined in the above schema.
of the following critical events ((34)Ins(A.a), ℘a: “the age of an employee must be equal to or
(37)
Ins(B.a), (40)Del(A.a), (43)Del(B.a), (46)Upd(B.a)). more than 24”.
All other templates are applied in the same way as Context 〈EMP〉 〈self.age>=24〉
the previous one.
℘c: “the total salary of employees must not
3.2.2 Mapping test cases into target DBMS exceed the department’s budget”.
DML statement Context 〈EMP〉
Once the test cases are calculated according to 〈allInstances.sal->SUM()>self.DEPT.budget〉
what has been stated in section (3.1.3), mapping
the test case into standard DML statement is ℘d: “every department has at least two
performed directly; that is, each SQL statement is employees”.
As a result, our tool defines 8 test cases should not return any selected rows, which means
(s1,s2,…,s8) for the employees’ database that the data in EMP is still consistent. Of course,
example. In the next step, we submit the previous the examiner can include valid test cases for
test cases and the initial data to be evaluated evaluating the application software; in this case
according to the generated validation queries. The the tool will accept the modification and the
tool applies the DML statements upon the initial expected results “No selected row” of the
data and validates the results according to the validation queries is also returned because these
algorithms shown in section (3.1.2). The final queries are only looking for the rows which do not
results of the validation are reported as shown in fulfil the corresponding constraints. The results
table (3). For example, if the invalid test case S1 shown in table (2) ensure the consistency of the
is applied on the EMP table then our tool rejects generated initial data before applying them to
S1 and no modification is performed. Therefore, validate the application.
we apply the validation query Q1 to check if there
is any inconsistency data in EMP. Here the Q1
Table 2. Our tool report about the expected results when applying the test cases.
Validation
Cases Table Event Tool Action Expected Results
queries
S1 EMP Update Reject Q1 No selected row
S2 EMP Update Reject Q1 No selected row
S3 EMP Insert Reject Q1 No selected row
S4 DEPT Update Reject Q2 No selected row
S5 EMP Update Reject Q3 No selected row
S6 EMP Update Reject Q3 No selected row
S7 EMP Insert Reject Q3 No selected row
S8 EMP Delete Reject Q4 No selected row
S9 EMP Delete Reject Q4 No selected row
[4] Juristo, N., A. Moreno, and A. Silva, Is the Business Strategies to Enterprise
European industry moving toward solving Architectures (PoEM 2008), J. Stirna and A.
Requirements Engineering problems? IEEE Persson, Editors. 2008, Springer LNBIP 15:
Softw., 2002. 19(6): p. 70-77. Stockholm, Sweden. p. 62-76.
[5] Zowghi, D. and C. Coulin, Requirements [14] Pastor, O., S. España, and A. González, An
elicitation: a survey of techniques, approaches ontological-based approach to analyze
and tools in Engineering and managing software production methods, in Information
software requirements, A. Aurum and C. Systems and e-Business Technologies. United
Wohlin, Editors. 2005, Springer-Verlag New Information Systems Conferences (UNISCON
York, Inc. p. 19-46. 2008), R. Kaschek, et al., Editors. 2008,
[6] Nuseibeh, B. and S. Easterbrook, Springer Lecture Notes in Business
Requirements Engineering: a roadmap, in Information Processing (LNBIP): Klagenfurt,
Conference on The Future of Software Austria. p. 258-270.
Engineering, in ICSE'00. 2000, ACM: [15] Eclipse. Eclipse Modeling Framework
Limerick, Ireland. p. 35-46. (EMF). 2010 05-2010]; Available from:
[7] Kabanda, S. and M. Adigun, Extending model http://www.eclipse.org/modeling/emf/.
driven architecture benefits to requirements [16] OMG. Meta Object Facility (MOF) 2.0
engineering, in 2006 Annual Research Query/View/Transformation specification
Conference of the SAICSIT on IT Research in (version 1.0). 2008 [cited 2010 05/2010];
Developing Countries. 2006, South African Available from:
Institute for Computer Scientists and http://www.omg.org/spec/QVT/1.0/.
Information Technologists: Somerset West, [17] CIT. MOSKitt: MOdeling Software Kitt.
South Africa. p. 22-30. 2010 [cited 2010 05-2010]; Available from:
[8] Alférez, M., et al., A model-driven approach http://www.moskitt.org/.
for software product lines requirements [18] Visio Stencil and Template for UML 2.2;
engineering, in 20th International Conference Available from:
on Software Engineering & Knowledge http://softwarestencils.com/uml/index.html.
Engineering (SEKE'2008). 2008: San [19] España, S., et al., An empirical comparative
Francisco, USA. p. 779-784. evaluation of requirements engineering
[9] AuraPortal BPMS; Available from: methods. J. Braz. Comp. Soc., 2010. 16(1): p.
http://www.auraportal.com 3-19.
[10] MOSKitt Módulo para Modelado de [20] Nielsen, J., Heuristic evaluation, in Usability
Procesos; Available from: inspection methods, J. Nielsen and R.L. Mack,
http://www.moskitt.org/cas/moskitt-modulos- Editors. 1994, John Wiley and Sons: New
funcionales/. York, USA.
[11] Lockemann, P.C. and H.C. Mayr, [21] Vilbergsdóttir, S.G., E.T. Hvannberg, and
Information system design: techniques and E.L.-C. Law, Classification of usability
software support, in Information Processing problems (CUP) scheme: augmentation and
86, H.-J. Kugler, Editor. 1986, North-Holland: exploitation, in 4th Nordic Conference on
Amsterdam, The Netherlands. Human-Computer Interaction: changing
[12] España, S., A. González, and Ó. Pastor, roles. 2006, ACM: Oslo, Norway. p. 281-290.
Communication Analysis: a Requirements [22] Lewis, J.R., IBM computer usability
Engineering method for information systems, satisfaction questionnaires: psychometric
in 21st International Conference on Advanced evaluation and instructions for use. Int. J.
Information Systems (CAiSE'09). 2009, Hum.-Comput. Interact., 1995. 7(1): p. 57-78.
Springer LNCS 5565: Amsterdam, The [23] Communicational Analysis Tools; Available
Netherlands. p. 530-545. from:
[13] González, A., S. España, and Ó. Pastor, http://hci.upv.es/communicational_analysis_to
Towards a communicational perspective for ols/
enterprise Information Systems modelling, in
IFIP WG 8.1 Working Conference on The
Practice of Enterprise Modeling: from
models and establishes model transformations execution. The events are written according to the
between the different MDA abstraction levels. In MXML (Mining XML) metamodel [8], an XML
addition, ADM defines the standard KDM format used in the process mining field to obtain
(Knowledge Discovery Metamodel), which has event logs. The proposed technique is further
also been recognized as standard ISO 19506 [10]. supported by specific information provided by
KDM provides a common repository structure that business experts and system analysts who know
makes it possible to exchange information about the system.
existing software artifacts involved in LISs. KDM The runtime models represent the events
can be compared with the Unified Modeling related to the underlying business processes that
Language (UML) standard; while UML is used to occur during system execution, thus these models
generate new code in a top-down manner, ADM- provide another valuable source of knowledge to
based processes involving KDM start from the understand what is actually going on in a LIS
legacy source code and build a higher level model from a dynamic perspective [24]. To facilitate the
in a bottom-up manner [13]. use of runtime models for modernizing LISs, this
There are several works in literature that paper provides a model transformation between
address the problem of preserving the embedded levels L1 and L2 of the MARBLE framework to
business knowledge in software modernization represent the runtime models according to the
processes. Zou et al developed a MDA-based KDM standard. Due to the fact that KDM is
framework for extracting business processes considered as the common modernization format
through static analysis of source code based on a for representing any legacy artifacts, these models
set of heuristic rules [26]. Pérez-Castillo et al. can be used for any modernization framework.
[20] propose MARBLE, an ADM framework that The remainder of this paper is organized as
uses the KDM standard to obtain business follows. Section 2 briefly introduces MARBLE,
processes from legacy source code. Source code, the modernization framework for which the
however, is not the only legacy artifact considered technique is proposed. Section 3 presents the
to recover business knowledge. Di reverse engineering technique to obtain runtime
Francescomarino et al, for example, consider models, and Section 4 shows the model
graphical user interfaces of Web applications to transformation defined to represent runtime
recover business processes [5]. Paradauskas et al. models in KDM. Finally, Section 5 provides
[19], in turn, present a framework to recover conclusions and discusses future work.
business knowledge through the inspection of the
data stored in databases. Ghose et al [7] propose a 2. MARBLE
set of text-based queries in source code and
documentation for extracting business knowledge. MARBLE (Modernization Approach for
In addition, Cai et al. [2] propose an approach that Recovering Business processes from LEgacy
combines the requirement reacquisition aided by systems) [20] is an ADM-based framework for
system users with static analysis. All these works
recovering business processes from legacy
are mainly based on a static view of LISs, and systems and business knowledge preservation.
runtime models are often ignored to preserve the MARBLE is organized into four abstraction levels
business knowledge. However, since there exists (cf. Section 2.1) representing four different kinds
much valuable information that is only known of artifacts needed to obtain the embedded
during system execution, there is a big potential business processes. In addition, MARBLE
for exploiting runtime knowledge as well. specifies three model transformations (cf. Section
This paper presents, within MARBLE, a 2.2) to complete the path obtaining each kind of
reverse engineering technique based on dynamic model at a specific level from the previous one
analysis (combined with static analysis) of source (see Figure 1).
code to obtain runtime models. Firstly, the static
analysis syntactically analyzes the source code
and injects pieces of source code in a non-invasive 2.1. Abstraction levels defined in MARBLE
way in specific parts of the system. Secondly, the
dynamic analysis of the modified source code MARBLE defines four abstraction levels related
makes it possible to write events during system to four different kinds of models: L0 to L3. These
models are progressively refined from legacy model, but at a higher abstraction level. This
software artifacts in L0 until business process model represents the entire LIS from a
models are obtained in L3 (see Figure 1). platform-independent point of view at an
L0. Legacy information system. This level intermediate abstraction level (PIM). This
represents the entire legacy system in the real model is represented according to the
world, i.e. a set of interrelated software metamodel of the KDM standard. KDM
artifacts like source code, user interfaces, provides a common repository structure that
databases, documentation. makes it possible to exchange information
L1. Software artifacts models. This level about artifacts involved in the LIS.
contains a set of models representing one or L3. Business process model. L3 is the top
more software artifacts of the LIS. L1 models level and corresponds to a business process
can be seen as platform-specific models model that represents the recovered business
(PSM) because they represent different views processes. This model can be seen as
or concerns of the system from a computer-independent models (CIM), since it
technological point of view at a lower depicts a business view of the system from a
abstraction level. As a consequence, L1 computation independent viewpoint at the
models must be represented according to highest abstraction level. MARBLE uses the
specific metamodels (e.g. a hypothetic L1 metamodel of the BPMN (Business Process
level could be formed by a code model Modeling and Notation) standard [18] for
represented according to the Java metamodel representing the business process model.
and a database model depicted according to BPMN offers a well-known graphical notation
the SQL metamodel). that is easily understood by both system
L2. KDM model. This level integrates all analysts and business experts.
knowledge of the L1 models in a single
L1 L2
MM
applied to different software L3
artifacts as static/dynamic (BPMN)
analysis, slicing, and so on
L0 L1
MM L2
KDM
(KDM)
MML1
(Java MM)
code{
}
2.2. Model transformations in MARBLE pieces of the source code (represented in the
KDM model) are transformed into well-
Besides different abstraction levels, MARBLE known structures of business processes. Then,
defines three model transformations between the the pattern matching following those patterns
four abstraction levels (see Figure 1). is implemented using QVT [22].
L0-to-L1 transformation. The first
transformation takes the different software 3. A Technique to Obtain Runtime models
artifacts from the LIS (L0) and obtains a
specific model for each artifact (L1). This Despite source code models are valuable models
transformation takes software artifacts into at level L1 of MARBLE, there are specific,
account depending on the specific business relevant aspects of the source code (e.g. the
process recovery method based on MARBLE accurate execution order of the pieces of source
(since MARBLE defines a generic code, dead source code) which are lost if only
framework). So far, we consider a recovery static analysis is used. Thus, dynamic analysis can
method using MARBLE, which considers be used together with static analysis, additionally
legacy source code as the unique software considering knowledge related to system
artifact, since it is the artifact that embeds execution, to obtain more meaningful business
most business knowledge [14]. In this case, knowledge. For this reason, we propose a
the L0-to-L1 transformation consists of the technique based on dynamic analysis to extract
static analysis of the source code files carried runtime models at level L1 of MARBLE.
out by means of a syntactical parser, which The technique proposes the representation of
generates a source code model according to runtime models as event logs derived from the
the proper metamodel. system execution. Event logs are commonly used
L1-to-L2 transformation. The second in the process mining field as the input for several
transformation establishes the model mining algorithms to discover the business
transformation between the code model (the process of an organization [3]. Thereby, event
PSM model in L1) and the KDM code model logs save the list of business activities carried out
(the PIM model in L2). The KDM metamodel in an organization according to their business
is divided into different metamodel packages processes. Usually, these event logs are obtained
organized into four abstraction layers. Each from Process-Aware Information Systems (PAIS)
package focuses on modeling a different [6], i.e., process management systems (e.g.
concern of the LIS. Currently, the KDM Enterprise Resource Planning (ERP) or Customer
model in L2 only considers the KDM Relationship Management (CRM) systems). The
packages code and action that conform to the nature of these systems (in particular their
program element layer. These packages are process-awareness) facilitates the registration of
enough to represent all concepts of the code events throughout process execution.
models of L1 at a higher abstraction level in The vast majority of LISs, however, are non
L2. This model transformation is formalized process-aware systems that also support the
by means of QVT (Query / Views / business processes of organizations. Obtaining an
Transformations) [17]. event log of a non process-aware system and
L2-to-L3 transformation. The third representing it in a model at level L1 of MARBLE
transformation aims to obtain a business implies five key challenges:
process model in L3 from the KDM model in Challenge C1. Missing Process-Awareness.
L2. This transformation consists of two steps: Process definitions are implicitly described in
(i) a model transformation that obtains a set of legacy code. A traditional LIS consists of a
preliminary business process models; and (ii) control flow graph implicitly representing the
an optional manual intervention by business business process it supports. Thus, it is not
experts for refining the obtained business obvious which events (related to a specific
processes to improve them. So far, the model business activity) should be recorded in the
transformation of the first step uses a set of event log. To address this challenge, the
business patterns [21], which define what technique considers the “a callable unit / a
business activity” principle proposed by Zou gives an overview of the technique, the tasks
et al. [25]. carried out and their inputs/outputs.
Challenge C2. Granularity. While some of
the callable units of LISs support the main 3.1. Static analysis to modify the source code
business functionalities, many callable units
are very small and do not directly support any The static analysis modifies the original source
business activity (e.g. setter/getter methods, code in a non invasive way to enable the
printer methods, etc.). registration of events during system execution
Challenge C3. Discarding Technical Code. (see Figure 2). To address the previously
Legacy source code not only contains business introduced challenges, the static analysis is
activities, but also technical aspects which supported with information provided by business
have to be discarded when the runtime model experts and system analysts. In Task 1, business
is obtained. experts establish the start and end business
Challenge C4. Process Scope. Due to the fact activities of the business processes to be
that traditional LISs do not explicitly define discovered (Challenge C4). In parallel, system
processes, it has to be established when a analysts examine in Task 2 the legacy source code
process starts and ends. Unfortunately, this and filter the domain set of the directories, files or
information is only known by business experts specific callable units that support business
and system analysts. activities. This information is used to reduce
Challenge C5. Process Instance Scope. It is potential noise in the runtime model due to
not obvious how business activities and the technical source code (Challenge C3). Task 3
multiples instances of a process should be consists of the mapping by system analysts
correlated. To solve this challenge the system between start/end business activities and the
analyst’s knowledge is necessary. callable units supporting them (Challenge C4). In
Our technique for obtaining runtime models addition, system analysts establish through Task 4
representing an event log is based on a static the correlation data set for each callable unit
analysis of source code combined with a dynamic which is uniquely identifying a process instance
analysis. Firstly, the static analysis examines the (Challenge C5). Each correlation data is mapped
legacy source code and modifies it by injecting to one or more parameters of each callable unit by
code for writing specific events during its system analysts. Finally, Task 5 carries out the
execution (cf. Section 3.1). After the static syntactic analysis of the source code. A parser
analysis has been conducted, the modified source analyzes and injects on the fly the sentences for
code is dynamically analyzed at runtime by means writing the event long during system execution.
of the injected sentences (cf. Section 3.2). Figure 2
1. Provide Starting/
Starting/Ending Ending
Business Business
Business
Activities Activities
Expert
Problem Starting/
2. Set Files/ 3. Map Starting/
Domain Ending
Directories of Ending Activities
Callable Callable
Problem Domain with callable units
Units Units
Correlation
4. Define
System Sets of
Correlation Set of
Analyst Callable
Attributes
Units
Figure 2. The overall process carried out by means of the proposed technique.
Task 5 is automated following the algorithm 3.2. Dynamic analysis to obtain runtime models
presented in Figure 3. During the static analysis,
the source code is broken down into callable units After having modified the source code through
(Challenge C1), although the algorithm only static analysis it is released to production. The
modifies the units of the domain set selected by new code makes it possible to obtain runtime
system analysts in Task 3 (Challenge C3). In models representing the event log of the LIS.
addition, fine-grained callable units (e.g., setter, These runtime models are represented in
getter, constructor, toString and equals callable MARBLE according to a metamodel based on the
units) are automatically discarded (Challenge C2). MXML format [8], which is used in the process
After that, two sentences are injected at the mining field.
beginning and the end of each filtered callable Figure 4 shows the MXML metamodel, which
unit. The first sentence writes a start event related provides the WorkflowLog metaclass to represent
to the business activity mapped to the callable an event log as a set of instances of the Process
unit. This sentence is injected between the metaclass. Each Process element contains several
signature and the body of the callable unit. The ProcessInstances, which have a sequence of
second sentence writes an end event for the AuditTrailEntry elements. Each AuditTrailEntry
respective business activity and is injected at the element represents an event and consists of four
end of the body. Both sentences have additional main elements: (i) the WorkflowModelElement
parameters like the correlation data defined for that represents the executed activity; (ii) the
the unit and the information whether or not the EventType that represents if the activity is being
unit represents a start or end activity. This executed (start) or was completed (complete); (iii)
additional information is used when the injected the Originator that provides the user who starts or
sentences invoke the writeEvent function at completes the activity; and finally (iv) the
runtime, which writes the respective event into the Timestamp that records the date and time of the
runtime model (cf. Section 3.2). event. Moreover, all these elements can have a
injectTraces (CallableUnits, DomainCallableUnits, Data element including additional information
StartingCallableUnits, EndingCallableUnits) endorsed into Attribute elements.
ModifiedCallableUnits ɸ Dynamic analysis is automatically carried out
c‟ null during system execution. Thus, when the control
For (c CallableUnits) flow of the LIS reaches an injected sentence, a
If (c DomainCallableUnits and
new event is added to the event log. The events
isFineGrainedUnit(c))
If (c StartingCallableUnits) are written by means of the writeEvent function.
position „first‟ Before adding the new event representing a
Else If (c EndingCallableUnits) business activity to the runtime model, it is
position „last‟ necessary to find out the correct process and
Else process instance where the event must be added.
position “intermediate” The adequate process and process instance are
sentence1 “writeEvent (c.name, „start‟,
located by means of Xpath expressions [4]. If the
position, c.correlationSet)”
sentence2 “writeEvent (c.name, „complete‟, process is null, then a new process is created. In
position, c.correlationSet)” addition, these expressions take the correlation
c‟.signature c.signature data into account to establish the correct process
c‟.body sentence1 + c.body + sentence2 instance. The attributes that contain the
ModifiedCallableUnits correlation data were already established during
ModifiedCallableUnits {c‟} static analysis, however, their values are only
Else
known during system execution.
ModifiedCallableUnits
ModifiedCallableUnits {c}
Return ModifiedCallableUnits
models. The EventModel metaclass represents the extension mechanism of the KDM metamodel: the
runtime model, which contains a set of extension families. The EventModel includes an
EventResource and EventAction elements. An ExtensionFamily element (see Figure 6), which
EventResource element can be specialized into a defines four Stereotype elements: <process>,
State element, a Transition element, an Event <processInstance>, <originator> and
element, or it can even be a container of other <timestamp>. Each stereotype has a
EventResources. The Event element is used to TagDefinition element that is used by stereotyped
model the AuditTrailEntries of the runtime model elements of the runtime model to put the specific
represented according to the MXML metamodel value by means of a respective TaggedValue
in L1. The feature name represents the element.
WorkflowModelElement, and the feature kind Therefore, the problematic elements are
represents (with a ‘start’ or ‘complete’ value) the represented in KDM as follows: (i) A process is
EventType. represented as an EventResource element
The transformation is formalized by means of annotated with the <process> stereotype and
QVT-Relations (the declarative language of the containing a TaggedValue with the name of the
QVT standard). A relation transforms a MXML process. (ii) A process instance is also represented
model in L1into an instance of the EventModel as an EventResource element, which is nested
metaclass. This relation calls to the relation within another EventResource that represents a
„auditTrailEntry2Event‟ that transforms each process. This EventResource is annotated with the
AuditTrailEntry in L1 into an Event in L2 (see <processInstance> stereotype and contains a
Figure 6). TaggedValue with the process instance
The event metamodel package of KDM makes identification. (iii) The originator is represented as
it impossible to represent the process and process a TaggedValue associated to an Event stereotyped
instance where the event belongs as well as the as <originator>. (iv) The timestamp is also
originator and timestamp of the event (see Figure represented with a TaggedValue in an Event
5). For this reason, the proposal uses the default annotated with the <timestamp> stereotype.
<<checkonly>> <<enforce>>
MXML KDM Event
p : Process auditTrailEntry2Event eventModel:eventModel
name=xProcessName MXML
<<checkonly>> runtimeExtension : ExtensionFamily
pi : ProcessInstance MXML
name=xProcessInstanceName stP : Stereotype sT : Stereotype
stPI : Stereotype sO : Stereotype
<<checkonly>>
tP : TagDefinition tT : TagDefinition
ate:AuditTrailEntry tPI : TagDefinition tP : TagDefinition
tag =’process’ tag =’timestamp’
timestamp tag =’processInstance’ tag =’originator process : EventResource
eventType
name=’Process’
t : Timestamp vP:TaggedValue
type : EventType originator
value=xProcessName processInstance :
name = xDate vPI:TaggedValue
type = xEventType
workflowModelElement EventResource
value=xProcessInstanceName
e : WorkflowModelElement o : Orignitaror tP : TagDefinition name=’ProcessInstance’
Figure 6. The QVT relation ‘auditTrailEntry2Event’ to transform runtime models in L1 to KDM models in L2.
Despite the fact that the order of the events model transformations implemented by means of
can be derived from the timestamp information, QVT-Relation. Due to the fact that the runtime
the relation „auditTrailEntry2Event‟ (see Figure 6) model is represented following the KDM
establishes at level L2 the same sequence of standard, the proposed technique can be used in
events register in the model at level L1. This order other modernization frameworks based on ADM
is represented as an EventRelationship element as MARBLE.
within each Event representing a reference to the The future work will focus on the validation
next Event element. of the proposal by means of a case study involving
Finally, the relation „auditTrailEntry2Event‟ a real-life LIS in a healthcare context. Another
(see Figure 6) maps each Event to a CodeElement research direction in the future will be the use of
of the KDM code model. The resource runtime the runtime models combined with other models
layer of the event package is above the program of KDM as the code and data model in order to
element layer (that contains the code and action obtain more meaningful business process models
metamodel packages), thus the elements of a at level L3 of MARBLE.
runtime model can be mapped to the callable units
represented in the KDM code model. As a Acknowledgement
consequence, the feature location is also improved
throughout the modernization of a LIS. This work was supported by the FPU Spanish
Program; by the R+D projects funded by JCCM:
5. Conclusions and Future Work ALTAMIRA (PII2I09-0106-2463), INGENIO
(PAC08-0154-9262) and PRALIN (PAC08-0121-
Software modernization projects typically take 1374); and the PEGASO/MAGO project
several software artifacts as source of knowledge (TIN2009-13718-C02-01) funded by MICINN
into account like, for example, source code, and FEDER. In addition, this work was supported
databases, user interfaces. Thereby, modernization by the Quality Engineering group at the
projects often recover knowledge from a static University of Innsbruck.
point of view. However, a dynamic approach
allows modernization projects to extract more References
meaningful knowledge, which cannot be
recovered analyzing artifacts in a static way only. [1] Bianchi, A., D. Caivano, V. Marengo, and G.
For this reason, this paper proposes a technique, Visaggio, "Iterative Reengineering of Legacy
within a specific modernization framework (i.e., Systems". IEEE Trans. Softw. Eng., 2003.
MARBLE), to obtain runtime models by means of 29(3): p. 225-241.
dynamic analysis of source code. [2] Cai, Z., X. Yang, and W. Wang. "Business
Firstly, the proposed technique statically Process Recovery for System Maintenance -
analyzes the legacy source code, and modifies it An Empirical Approach". in 25 th
by injecting special sentences that make it International Conference on Software
possible to register execution events. Secondly, Maintenance (ICSM'09). 2009. Edmonton,
during system execution, the modified code is Canada: IEEE CS p. 399-402.
dynamically analyzed through the injected [3] Castellanos, M., K.A.d. Medeiros, J.
sentences and a runtime model is written at level
Mendling, B. Weber, and A.J.M.M. Weitjers,
L1of MARBLE. The obtained runtime models Business Process Intelligence, in Handbook of
represent an event log according to the MXML Research on Business Process Modeling, J. J.
metamodel, and depict a sequence of executed Cardoso and W.M.P. van der Aalst, Editors.
events related to business activities of the business
2009, Idea Group Inc. p. 456-480.
processes embedded in the source code. [4] Clark, J. and S. DeRose, XML Path Language
Moreover, the runtime model is transformed into a (XPath). 1999, World Wide Web Consortium
runtime model represented at level L2 of (W3C).
MARBLE according to the KDM metamodel. For
[5] Di Francescomarino, C., A. Marchetto, and P.
this purpose, an extension of the event package of Tonella. "Reverse Engineering of Business
the KDM metamodel is proposed as well as a Processes exposed as Web Applications". in
13th European Conference on Software [17] OMG, QVT. Meta Object Facility (MOF) 2.0
Maintenance and Reengineering (CSMR'09). Query/View/Transformation Specification.
2009. Fraunhofer IESE, Kaiserslautern, 2008, OMG.
Germany: IEEE Computer Society p. 139- [18] OMG, Business Process Model and Notation
148. (BPMN) 2.0. 2009, Object Management
[6] Dumas, M., W. van der Aalst, and A. Ter Group. p. 496.
Hofstede, Process-aware information systems: [19] Paradauskas, B. and A. Laurikaitis, "Business
bridging people and software through process Knowledge Extraction from Legacy
technology. 2005: John Wiley & Sons, Inc. Information Systems". Journal of Information
[7] Ghose, A., G. Koliadis, and A. Chueng. Technology and Control, 2006. 35(3): p. 214-
"Process Discovery from Model and Text 221.
Artefacts". in IEEE Congress on Services [20] Pérez-Castillo, R., I. García-Rodríguez de
(Services'07). 2007 p. 167-174. Guzmán, O. Ávila-García, and M. Piattini.
[8] Günther, C.W. and W.M.P. van der Aalst, "A "MARBLE: A Modernization Approach for
Generic Import Framework for Process Event Recovering Business Processes from Legacy
Logs". Business Process Intelligence Systems". in International Workshop on
Workshop (BPI'06), 2007. LNCS 4103: p. 81- Reverse Engineering Models from Software
92. Artifacts (REM'09). 2009. Lille, France:
[9] Heuvel, W.-J.v.d., Aligning Modern Business Simula Research Laboratory Reports p. 17-20.
Processes and Legacy Systems: A [21] Pérez-Castillo, R., I. García-Rodríguez de
Component-Based Perspective (Cooperative Guzmán, O. Ávila-García, and M. Piattini.
Information Systems). 2006: The MIT Press. "Business Process Patterns for Software
[10] ISO/IEC, ISO/IEC DIS 19506. Knowledge Archeology". in 25th Annual ACM
Discovery Meta-model (KDM), v1.1 Symposium on Applied Computing (SAC'10).
(Architecture-Driven Modernization). 2010. Sierre, Switzerland: ACM p. 165-166.
http://www.iso.org/iso/catalogue_detail.htm?c [22] Pérez-Castillo, R., I. García-Rodríguez de
snumber=32625. 2009, ISO/IEC. p. 302. Guzmán, and M. Piattini. "Implementing
[11] Khusidman, V. and W. Ulrich, Architecture- Business Process Recovery Patterns through
Driven Modernization: Transforming the QVT Transformations". in International
Enterprise. DRAFT V.5. Conference on Model Transformation
http://www.omg.org/docs/admtf/07-12-01.pdf. (ICMT'10). 2010. Málaga, Spain: Springer-
2007, OMG. p. 7. Verlag p. In Press.
[12] Miller, J. and J. Mukerji, MDA Guide [23] Sneed, H.M., Estimating the Costs of a
Version 1.0.1. www.omg.org/docs/omg/03- Reengineering Project. Proceedings of the
06-01.pdf 2003: OMG. 12th Working Conference on Reverse
[13] Moyer, B. (2009) Software Archeology. Engineering. 2005: IEEE Computer Society.
Modernizing Old Systems. Embedded [24] van der Aalst, W., H. Reijers, and A.
Technology Journal, Weijters, "Business Process Mining: An
http://adm.omg.org/docs/Software_Archeolog Industrial Application.". Information Systems,
y_4-Mar-2009.pdf 2007. 32(5): p. 713-732.
[14] Müller, H.A., J.H. Jahnke, D.B. Smith, M.-A. [25] Zou, Y. and M. Hung. "An Approach for
Storey, S.R. Tilley, and K. Wong. "Reverse Extracting Workflows from E-Commerce
engineering: a roadmap". in Proceedings of Applications". in Proceedings of the
the Conference on The Future of Software Fourteenth International Conference on
Engineering. 2000. Limerick, Ireland: ACM. Program Comprehension. 2006: IEEE
[15] Newcomb, P. "Architecture-Driven Computer Society p. 127-136.
Modernization (ADM)". in Proceedings of the [26] Zou, Y., T.C. Lau, K. Kontogiannis, T. Tong,
12th Working Conference on Reverse and R. McKegney. "Model-Driven Business
Engineering. 2005: IEEE Computer Society. Process Recovery". in Proceedings of the 11th
[16] OMG. ADM Task Force by OMG. 2007 Working Conference on Reverse Engineering
9/06/2009 [cited 2008 15/06/2009]; Available (WCRE 2004). 2004: IEEE Computer Society
from: http://www.omg.org/. p. 224-233.
Escuela Politécnica
Universidad de Extremadura
Resumen [18].
En este trabajo se atacarán dos problemas
Gran parte de los sistemas de desarrollo de que se producen en este ámbito. De un lado, los
software dirigido por modelos limitan a los problemas derivados de la complejidad de los
desarrolladores a la hora de elegir la arquitec- modelos necesarios para desarrollar las aplica-
tura software en la que se va a basar la aplica- ciones. Por otro lado, los problemas motivados
ción a desarrollar o las tecnologías que se van por la elección de una metodología de desa-
a utilizar para la implementación. Este artícu- rrollo dirigido por modelos como las citadas
lo adopta la forma de Position Paper en el anteriormente.
que se argumenta cómo facilitar el paso de la
Los modelos que deben crearse durante un
arquitectura preliminar a la detallada y exi-
desarrollo capturan toda la información nece-
bilizar la elección de la tecnología de construc-
saria para generar la aplicación. Esto hace di-
ción tratando la arquitectura como una línea
fícil la tarea de crear dichos modelos partiendo
de producto.
de un diseño de alto nivel de la aplicación que
contenga los requisitos de la misma. Además,
zados. Esto hace que no sea posible utilizar de la arquitectura elegida. Este es un proceso
uno de estos sistemas cuando la aplicación a complejo que requiere amplios conocimientos
desarrollar deba cumplir con requisitos tecno- de la arquitectura y de los patrones de diseño
lógicos distintos a los soportados. que se van a aplicar.
Este es un Position Paper en el que se ar- Para ejemplicar este proceso se puede pen-
gumenta cómo facilitar el paso de la arquitec- sar en una aplicación que deba soportar una
tura preliminar a la detallada y exibilizar la gestión básica de clientes. La aplicación debe
elección de la tecnología de construcción. Para permitir almacenar los datos de los clientes,
ello se propone un enfoque novedoso en el que actualizarlos cuando sea necesario y realizar
las arquitecturas software de las aplicaciones búsquedas sobre ellos. Para este ejemplo tan
a desarrollar se tratan como líneas de produc- sencillo el diseño inicial de la aplicación podría
to [6]. El método presentado en este trabajo estar compuesto de un diagrama de clases en
se encuentra en un estado inicial. El principal el que aparezca la clase Cliente, con los atri-
objetivo que se persigue con la presentación butos necesarios para almacenar toda la infor-
de este trabajo en un estado tan temprano es mación relativa a los clientes y algunos méto-
el de obtener las impresiones de la comunidad dos. Adicionalmente se podría disponer de un
acerca de la validez del mismo y las posibles diagrama de casos de uso en el que aparezcan
carencias que pueda contener. los casos de uso relativos a la gestión de los
El resto del artículo se distribuye de la si- clientes y posiblemente algunos diagramas de
guiente forma: en la segunda sección se deta- secuencia o actividad. En la gura 1 se observa
llan los antecedentes que han llevado al desa- el diagrama de clases con la clase Cliente.
rrollo de este trabajo; en la tercera sección se
Convertir el diseño preliminar obtenido ex-
describe como modelar la arquitectura y los
clusivamente a partir de los requisitos sin te-
frameworks a utilizar y como, aplicando di-
ner en cuenta los detalles de la arquitectura a
cha información, transformar el diseño de alto
utilizar, en un diseño especíco para una apli-
nivel de la aplicación en un diseño detallado
cación con una arquitectura en tres capas no
especíco de dichos frameworks y conforme a
es un proceso trivial. Además los diagramas
la arquitectura elegida; en la cuarta sección se
que componen este diseño empiezan a compli-
enumeran algunas posibilidades para transfor-
carse. En la gura 2 puede verse el diagrama
mar dicho diseño en código y por último se
de clases para la aplicación de gestión de clien-
detallan las conclusiones y los trabajos futu-
tes adaptada a una arquitectura en tres capas.
ros.
En él, la clase inicial Cliente se ha dividido en
tres clases que encapsulan el comportamiento
las aplicaciones hace necesaria la utilización Este diseño se complica aun más si se es-
de técnicas, cada vez más avanzadas a su vez, tablece una arquitectura con mayor grado de
para abordar los desarrollos con ciertas garan- detalle. Aunque el diseño anterior corresponde
tías. Las arquitecturas software [25] y los pa- a una arquitectura en tres capas, esta arquitec-
trones de diseño [15] son técnicas creadas en el tura raramente se utiliza en una forma tan sen-
ámbito de la ingeniería del software para tratar cilla. Habitualmente esta arquitectura se enri-
este problema. Con su utilización se pretende quece con patrones de diseño como el patrón
describir y reutilizar aquellas estructuras que Data Access Object (DAO) [31] para la capa
dan lugar a aplicaciones estables y de calidad. de persistencia o con la utilización de MVC
Uno de los principales retos, a la hora de [18] para la presentación. Si incorporamos es-
desarrollar una aplicación para una arquitec- tos elementos al ejemplo utilizado se obtiene
tura concreta, consiste en adaptar el diseño un diagrama de clases similar al mostrado en
preliminar de la aplicación a las peculiaridades la gura 3. En este diagrama se observa como
gestión de clientes
las pruebas unitarias y de integración. Puede en los modelos especícos del sistema utiliza-
verse claramente la complejidad de dar el paso do [3]. Como se ha podido ver en el ejemplo
del diseño inicial de una aplicación a un dise- esta es una tarea difícil y que requiere grandes
el ejemplo mostrado aquí, una clase de diseño llar como del sistema de desarrollo utilizado.
de alto nivel ha dado lugar a más de cinco cla- Esto conlleva una serie de consecuencias ne-
ses en el diseño especíco de la arquitectura. gativas, entre las que destacan la elevada curva
En una aplicación real con decenas o cientos de aprendizaje, que obliga a proporcionar una
de clases en el diseño inicial, el paso a un dise- formación muy especíca, la dependencia del
ño especíco supone una tarea ardua y difícil conocimiento de personas que pueden abando-
que requiere grandes conocimientos. nar el equipo de desarrollo o la dependencia de
Por otra parte, la mayoría de los sistemas de un conocimiento que nunca acaba de residir en
desarrollo dirigido por modelos, exceptuando las empresas de desarrollo sino en las personas
y más recientemente en aplicaciones RIA (Rich El segundo problema que se abordará en es-
Internet Application) [22], se centran en la uti- te trabajo se presenta una vez que se dispone
lización de una única arquitectura software de de un diseño especíco para una arquitectura,
forma implícita. Esta arquitectura no puede como el que se muestra en el ejemplo. Partien-
ser elegida ni modicada por los usuarios de do de este diseño es posible pasar a la imple-
este tipo de sistemas. Además, para utilizar mentación del sistema, ya sea manualmente o
estos sistemas es necesario convertir los dise- mediante transformaciones de modelo a códi-
go. Para facilitar la incorporación de arquitec- te puesto que existen numerosos frameworks
turas software y patrones de diseño a los desa- que cubren una misma funcionalidad o con-
rrollos han surgido un gran número de frame- cepto cada uno con distintas características.
works orientados a objetos [12]. La utilización El desarrollador debería poder decidir que fra-
de estos frameworks permite trasladar a la im- mework o frameworks se adaptan mejor a las
plantea una serie de inconvenientes. Uno de los o frameworks que puedan aparecer.
mo framework de presentación
Spring [28] y Struts [30]. Este conjunto de fra- cultad de obtener un diseño especíco para un
meworks es uno de los más utilizado para el conjunto de frameworks. Esta labor se compli-
desarrollo de aplicaciones web en Java. En la ca aun más si se tiene en cuenta que en proyec-
gura se observa como se han tenido que rea- tos reales suele intervenir un número más ele-
lizar importantes modicaciones para adaptar vado de frameworks para encargarse de otras
el diseño al uso de estos frameworks. Por mo- tareas como la seguridad, el log o las pruebas.
Por lo tanto, el paso de un diseño detalla- rrollo de software dirigido por modelos tratan
do, conforme a una arquitectura software, a un con el desarrollo de sistemas con arquitecturas
diseño especíco para un conjunto de frame- complejas y cuyo código utiliza frameworks de
works puede simplicarse si es visto como una desarrollo como los tratados en este proyec-
ción debe tener en cuenta que se pueden utili- ría web. con trabajos como WebML [7], UWE
zar distintos frameworks, para una misma la- [19], OOWS [24], RUX [20], etc.
bor, dentro de un mismo proyecto (por ejemplo Sin embargo estos trabajos no permiten a
en una aplicación web puede utilizarse Struts los desarrolladores tomar decisiones arquitec-
para la capa de presentación, pero utilizarse tónicas o sobre los frameworks a utilizar. No
un framework AJAX para proporcionar ma- obstante, en el mismo ámbito de la ingeniería
yor dinamismo a algunos apartados). También web existe una excepción. El trabajo de Me-
se debe soportar la utilización de frameworks liá y Gómez [21]. En este trabajo los autores
en determinados subconjuntos de la aplicación proponen una extensión a los métodos ante-
(por ejemplo un framework de seguridad para riores denominada Web Software Architecture
la parte privada de una aplicación). (WebSA). El propósito de esta extensión es
un diseño especíco para los frameworks se- mismos la posibilidad de denir la arquitec-
leccionados por el desarrollador, a la vez que tura que se quiere utilizar. Para conseguir es-
se mitigan los problemas que plantea el uso de te objetivo añaden dos modelos: el modelo de
Cualquiera de estas alternativas podría modelos funcionales de OOH para generar las
caciones modeladas según el método descrito Estos trabajos guardan una estrecha rela-
en este artículo. ción con el trabajo presentado aquí, especial-
6. Estado actual y trabajos futuros conceptos de más alto nivel. Por lo tanto, este
sistema sirve como prototipo de la propuesta
aquí presentada y ayuda a identicar parte de
Como ya se ha mencionado en secciones an-
los benecios de la misma. Sin embargo, si-
teriores, el método presentado en este trabajo
gue siendo necesario mucho trabajo para que
se encuentra en un estado inicial y aún queda
la herramienta de soporte a la totalidad de las
mucho trabajo por desarrollar.
propuestas aquí presentadas.
Uno de los principales puntos en los que se
debe profundizar en el desarrollo de este mé-
todos pasa por la denición exhaustiva de las 7. Conclusiones
características de las arquitecturas que se quie-
ran soportar. Para ello se debe crear un modelo En este articulo se ha presentado un método
de características de cada una de las arquitec- para ampliar las posibilidades de los desarro-
turas que permita capturar toda la variabili- lladores a la hora de utilizar un sistema de
dad de las mismas, de forma que este modelo desarrollo dirigido por modelos. La principal
pueda instanciarse para cada aplicación con- aportación de este método consiste en que se
creta con unas características arquitectónicas permite a los desarrolladores decidir las carac-
válidas. Este modelo será aplicado en la trans- terísticas arquitectónicas y los frameworks de
formación para obtener un diseño especíco de desarrollo que se van a utilizar para generar
la aplicación. Debido a esto, es posible cubrir with Webml and Webratio. Human Com-
un mayor número de posibilidades a la hora de puter Interaction Series. Springer Lon-
modelar una aplicación y se facilita la adapta- don, 2008, 221-261.
ción a nuevas arquitecturas o tecnologías que
se deseen incorporar.
[8] Clements, P.C., Shaw, M. The Golden
Age of Software Architecture Revisited.
IEEE Software 26(4): 70-72 (2009)
Agradecimientos
[9] Czarnecki, K., Helsen, S., Eisenecker, U.
Este trabajo ha sido nanciado por W. taged conguration through specializa-
los proyectos TIN2008-02985, PDT08A034, tion and multilevel conguration of fea-
PRE09156 y la Fundación Valhondo Cala. ture models. Software Process: Improve-
ment and Practice 10(2): 143-169 (2005)
[2] Antkiewicz, M., Czarnecki, K. [11] Fairbanks, G., Garlan, D., Scherlis, W.
Framework-Specic Modeling Lan- Design fragments make using frameworks
guages with Round-Trip Engineering. easier. SIGPLAN Not. 41, 10 (Oct. 2006),
MoDELS 2006: 692-706 75-88.
[3] Bass, L., Clements, P., Kazman, R. Soft- [12] Fayad, M., Schmidt, D. C. Object-
ware Architecture in Practice chap. Ar- oriented application frameworks. Com-
chitecture Based Development. SEI Series mun. ACM 40, 10 (Oct. 1997), 32-38.
in software engineering, Addison-Wesley,
1998, 285-302 [13] Fayad, M., Schmidt, D. C., Johnson, R.E.
Object-oriented Application Frameworks:
[4] Berrocal, J., García-Alonso, J., Murillo, Problems and Perspectives. Wiley, NY,
J.M. Facilitating the selection of architec- 1997.
tural patterns by means of a marked re-
quirements model. ECSA 2010 [14] Fowler, A. A Swing Architecture Over-
view. http://java.sun.com/products
interface paradigm in Smalltalk-80. J. Ob- [24] Pastor, O., Fons, J. and Pelechano,
ject Oriented Program. 1, 3 (Aug. 1988), V. OOWS: a method to develop Web
26-49. applications from Web-oriented concep-
tual models. International Workshop on
[19] Kraus, A., Knapp, A. and Koch, N. Web-Oriented Software Technology (IW-
Model-driven generation of web applica- WOST 2003), pp. 65-70
tions in UWE. 3rd International Works-
hop on Model-Driven Web Engineering [25] Shaw, M., Garlan, D. Software Architec-
(MDWE 2007). ture. Perspectives on an emerging disci-
pline. Prentice Hall, New Jersey, 1996.
[20] Linaje, M., Preciado, J. C., Sánchez-
Figueroa, F. Engineering Rich Internet [26] Shaw, M., Clements, P.C. The Golden
Application User Interfaces over Legacy Age of Software Architecture. IEEE Soft-
Web Models. IEEE Internet Computing ware 23(2): 31-39 (2006)
[21] Meliá, S., Gómez, J. The WebSA Ap- tigating Reading Techniques for Object-
proach: Applying Model Driven Enginee- Oriented Framework Learning. IEEE
Trans. Software Eng. 26, 2000.
ring to Web Applications. J. Web Eng.
5(2): 121-149 (2006) [28] Spring Framework.
http://www.springsource.org/
[22] Meliá, S., Gómez, J., Pérez, S., Díaz, O.
[29] Spring Roo.http://www.springsource.org
Architectural and Technological Variabi-
/roo
lity in Rich Internet Applications. IEEE
Internet Computing 14(3): 24-32 (2010) [30] Struts. http://struts.apache.org/
[23] Murugesan, S., Deshpande, Y., Hansen, [31] Sun Microsystems. Core J2EE
S. and Ginige, A. Web Engineering: A Patterns - Data Access Object
New Discipline for Development of Web- http://java.sun.com/blueprints/corej2eep
based Systems. First ICSE Workshop on atterns/Patterns/DataAccessObject.html
Web Engineering (WebE99), USA, 1999.
Thus, the main advantages of EMF4CPP interfaces dened using either CORBA
can be summarized as follows: IDL, Java, or C++, and tests performed
on them, including both static (e.g. out-
• There is no standard C++ type mapping
put values given input values, either ob-
for the Ecore metamodel. EMF4CPP can
tained from previous execution logs or
be seen as a rst step to standarize this
using mathematical functions), and dy-
mapping. This, not only has the direct
namic (e.g. workow-based) tests. A DSL
benet of being able to use the dier-
was developed for specifying these tests.
ent EMF tools (and Ecore metamodels)
The test specication allowed us to au-
to describe the data model of C++ appli-
tomatically generate both testing clients
cations, but also it represents a basis to
and mocking servers. Finally, we also
interoperate with future MDD tools that
modelled the run-time behavior of the
use C++ as the programming language.
testing process, i.e. which tests have been
• It oers a reective API for models and performed, calls made, including input
metamodels, being able to interoperate and output values, which tests failed or
with other tools in intermediate model succeeded, etc. In the case, for example,
ing as a basis for tools that exploit a way of representing the modelled run-
C++ idioms and patterns for dealing with time tests state into C++ classes (as it
model creation and transformation. Also, can be done with the Java version using
projects that have to support several im- the EMF tools.) These classes were ob-
• By providing a standard C++ mapping, ing about Qt4-based GUIs [12], abstract-
we can easily embed scripting languages ing the properties and characteristics of
such as Python, Lua, or Ruby for writing Qt graphical widgets in order to do run-
tools that manage models and metamod- time usability assessment and validation
els. We have already implemented pre- of input and output values. The ab-
liminary support for Python (PyEcore). straction was actually performed by doing
a model-to-model transformation of the
• Finally, initial results (in Section 3) show original model of Qt widgets to the ab-
C++ around 1.5 times faster and with stract model of widget properties needed
35% less memory footprint in managing for either usability or validation in GUIs.
model data structures. This is a key For instance, in some usability processes,
factor in embedded systems, that usu- we were interested in the containment re-
ally have strong memory and processing lation of widgets, as well as relative po-
power constraints. Also, it represents a sitions, instead of the actual type of the
real-world advantage in dealing with big- widget (i.e. if a widget could be seen as a
ger models (for instance, those resulting container widget.) Alternatively, for in-
of using ADM/KDM [14].) put validation, text boxes and spin boxes
were treated just as widgets producing a
Along with these benets, the development
value that could be checked for validity.
of EMF4CPP was motivated mainly by two
The usability and validation algorithms
industrial projects carried out under the Cát-
were performed on the dierent abstract
edra SAES-UMU [16]:
models for widgets. As Qt is based on
• Generic Interface Testing: We de- C++, and as those algorithms are per-
veloped an abstract model for describing formed mostly at run-time, we needed a
ECORE
C++
to C++
compiler
generator
Ecore.ecore libecore.so
(ECORE Metamodel) C++ source files (Runtime library)
ECORE
C++
to C++
compiler
generator
Foo.ecore libFoo.so
(ECORE Metamodel) C++ source files (Runtime library)
<conforms>
<linked>
C++ user
application <linked>
FooModel.xmi libecore.so
(a Foo model) libecorecpp.so
(Runtime libraries)
The mapping of attributes and references of would be translated into both a class with the
classes is as follows: same name, and a type MyClass_ptr , with
the semantics of a raw C++ pointer. Given
• For each attribute or reference P, acces-
getP() setP()
the strict meaning of containment (ownership)
sor ( ) and mutator ( ) meth- vs. non-containment references in the Ecore
ods are provided. Unlike the Java map- metamodel, a class always knows which of its
ping, accessor methods for attributes do own structural features to free when an in-
not modify the object instance, so they stance of that class gets reclaimed (as opposed
usually return a constant C++ reference to Java, where memory management is auto-
to the real attribute. matic.)
vided by the EObject class for explicit those oered by Java. So, we implemented
conversion between related types without enough API to be able to query and mod-
the need of temporary variables. ify models in a generic way, but those model
classes must have been previously generated
For the memory management, we decided to by the generator (conversely, Java allows cre-
use raw pointers to represent references. Thus, ating instances of metamodels without previ-
a class named MyClass in the metamodel ously having to generate model classes.) The
C++ Ecore runtime library. It contains three to the property containing the list of them. Fi-
meta-classes ( Company, Department, and Em- nally, the three new meta-classes are added to
3 Performance Comparison
Figure 6 shows the usage of the reective for a correct memory management.
API to create a Company class instance, es- Also, using any for the reective API boxed
tablishing its name attribute, then reading all the features of classes, including data types
it, and nally obtaining the list of references and even list of references (those declared, for
to Departments. Note the usage of the any example, as 0..*), which implied a memory
type and the special covariant list type EEL- copy of the whole list of references. So, we
istBase . had to tweak the reective API so that any s re-
u s i n g n a m e s p a c e company ; i m p o r t company ;
// C r e a t e a company // C r e a t e a company
s t d : : auto_ptr <Company> umu( Company umu =
companyFactory −>createCompany ( ) ) ; c o m p a n y F a c t o r y . createCompany ( ) ;
umu−>setName ( " U n i v e r s i t y Of M u r c i a " ) ; umu . setName ( " U n i v e r s i t y Of M u r c i a " ) ;
// C r e a t e a d e p a r t m e n t // C r e a t e a d e p a r t m e n t
Department_ptr catSAES = Department catSAES =
companyFactory −>c r e a t e D e p a r t m e n t ( ) ; companyFactory . createDepartment ( ) ;
catSAES−>setNumber ( 8 5 1 5 ) ; catSAES . setNumber ( 8 5 1 5 ) ;
// C r e a t e e m p l o y e e s // C r e a t e e m p l o y e e s
Employee_ptr a s e n a c = Employee a s e n a c =
companyFactory −>c r e a t e E m p l o y e e ( ) ; companyFactory . createEmployee ( ) ;
a s e n a c −>setName ( " A n d r e s Senac " ) ; a s e n a c . setName ( " A n d r e s Senac " ) ;
catSAES−>a ddEm ploy ees ( a s e n a c ) ; catSAES . g e t E m p l o y e e s ( ) . add ( a s e n a c ) ;
Employee_ptr d s e v i l l a = Employee d s e v i l l a =
companyFactory −>c r e a t e E m p l o y e e ( ) ; companyFactory . createEmployee ( ) ;
d s e v i l l a −>setName ( " Diego S e v i l l a " ) ; d s e v i l l a . setName ( " Diego S e v i l l a " ) ;
catSAES−>a ddEm ploy ees ( d s e v i l l a ) ; catSAES . g e t E m p l o y e e s ( ) . add ( d s e v i l l a ) ;
// S e t t h e d e p a r t m e n t manager // S e t t h e d e p a r t m e n t manager
catSAES−>s e t M a n a g e r ( d s e v i l l a ) ; catSAES . s e t M a n a g e r ( d s e v i l l a ) ;
// Add t h e d e p a r t m e n t // Add t h e d e p a r t m e n t
umu−>a d d D e p a r t m e n t s ( catSAES ) ; umu . g e t D e p a r t m e n t s ( ) . add ( catSAES ) ;
// I n i t i a l i z e t h e model // I n i t i a l i z e t h e model
umu−> _ i n i t i a l i z e ( ) ; // ( n o t n e e d e d )
// ( model i s d e l e t e d a u t o m a t i c a l l y ) // ( model i s d e l e t e d a u t o m a t i c a l l y )
turned references to the class elements. Also, consisted in reading a model conforming to the
unlike Java, C++ standard containers are not simple tree metamodel in Figure 7(a) with a
covariant with the generic type (for example, non-terminal root node with one million chil-
std::list<B> is not a subclass of std::list<A> dren leafs, doing a trivial model transforma-
even if B is a subclass of A ), so in case of hav- tion to build a model conforming to the meta-
ing to obtain a set of references using the re- model in Figure 7(b), and serializing the re-
ective API, we had to build a new list with sulting model.
generic EObject references. To overcome this The transformation included simple model
penalty, we implemented a covariant list type manipulations to measure the overhead of
exclusively for the reective API. working with the model structure itself. In
particular, it consisted on building an or-
To show the validity of the approach in the source model leafs. We implemented the same
performance evaluation test to compare it with For the comparison we measured the time
the Eclipse Ecore implementation. The test of loading the model (48MB of XML), model
transformation, and the time of writing the velopments. The current implementation al-
resulting metamodel (164MB), in a 3.0 GHz lows to generate C++ code from Ecore meta-
AMD Phenom II X4 940 with 8GB of RAM models and to manage and use models con-
Q8300 with 4GB of RAM under 32-bit Linux. Thorough the paper we mentioned a set of
The C++ code was compiled using GCC 4.4 features that were intended for future work,
with -O3 optimization. The Java code was such as to complete the Ecore to C++ map-
run under Sun JDK 1.6.0. We tested 32-bit ping, the fully reective API support, and
and 64-bit because of the dierence in point- the implementation of the change manage-
ers size, as model data structures are mainly ment API.
pointer-based. Also, we plan to develop infrastructure
Table 2 shows the times obtained for tools to manage models, and provide T2M,
both implementations. Model loading M2M, and M2T transformations, leveraging
times are around 1.13 times faster in 32- the C++ metaprogramming techniques to the
bit systems, with a clear bigger speedup MDD paradigm. For example, as an al-
of 1.64 in 64-bit systems. Processing times ternative to the text-to-model workows in
vary from 1.6 (in 32-bit) to 2.37 (in 64-bit) Eclipse, we want to explore using the metapro-
times faster in C++ than in Java. Model writ- gramming, the embedded DSL-based Spirit
ing times range between around 2 to 3.5 times parser [7] and monadic parsers similar to
faster in C++. Haskell Parsec [9] to automatically generate
models from C++-dened parsers. We also
EMF EMF4CPP Speedup
Load (32b) 3941 3503 1.13 want to explore bringing the mapping to C++-
Table 2: Times in milliseconds and speedup. is the specication of a higher level meta-
1 http://www.eclipse.org/forums/index.php?t=
Table 3 shows the memory usage after load- msg&goto=542311&.
metamodel (of which Ecore would be an in- [6] Gurtovoy, A., Abrahams, D.: Boost
stance) that allows a more seamless language MPL Library (2004), http://www.boost.
mappings (for example, Ecore species the org/doc/libs/release/libs/mpl
EJavaObject type, too tied to Java, instead [7] de Guzman, J., Kaiser, H.: The Spirit
of a more generic one). It could also include Parser (2009), http://boost-spirit.com
element characteristics such persistence or re-
[8] Jim Steel, Franck Fleurey, Jesús Sánchez
http://rmof.
mote access properties, allowing to model dis-
Service Oriented Archi- Cuadrado: RMOF (2005),
rubyforge.org/
tributed systems and
tectures (SOA). (last visited May 2010)
et al.: Boost C++ Libraries (2010), http: Metadata Interchange (XMI), version
[5] Free Software Foundation: The GNU [16] University of Murcia, SAES: Cátedra
Multiple Precision Arithmetic Library http://www.um.es/
http://gmplib.org/
SAES-UMU (2010),
(GMP) (2010), (last catedrasaes
visited May 2010)
dentro de un Pool para organizar actividades (ej. definen objetos de texto, de datos y grupos. El
Servicios al Cliente). estándar se encuentra actualmente bajo
El grupo de objetos de Flujo contiene los modificación ya que la última versión 2.0 beta1
distintos tipos de Actividad que representa el introduce nuevos elementos y cambia otros
trabajo que la organización realiza, y puede ser existentes en los estándares previos.
atómica o un sub-proceso compuesto de otras Por otro lado, el estándar SoaML define
actividades (ej. de Actividad atómica Solicitar servicio (Service) como un recurso que permite el
Préstamo). También están entre los Objetos de acceso a una o más capacidades provistas,
Flujo, los puntos de decisión utilizados para mediante la interface definida, que es ejercitado
controlar la divergencia y convergencia del flujo consistentemente con restricciones y políticas
del proceso, que puede ser paralelo (AND, nodos especificadas en la descripción del servicio. La
con cruz horizontal en Autorización de Préstamo), arquitectura general de servicios se especifica en
exclusivo (XOR, nodos con cruz inclinada), la colaboración ServicesArchitecture, donde se
inclusivo (OR, nodo con el círculo en blanco) o muestran los roles participantes y los contratos de
complejo. Incluye también los eventos que son servicios definidos. En la Figura 2 se presenta una
algo que ocurre en el curso del proceso afectando parte del modelo en SoaML correspondiente a la
su flujo, con una causa (trigger) y un impacto ServicesArchitecture para el proceso de negocio
(result) y pueden ser de inicio, intermedios o fin, y “Otorgar Préstamo” presentado antes, con tres
pueden tener un tipo como tiempo o error (ej. contratos de servicio a modo de ejemplo. Un
eventos de inicio y fin simples). servicio se provee por una entidad (provider, ej.
El grupo de objetos de conexión define los :Banco) para su uso por otros (consumers, ej.
objetos de flujo de secuencia que muestran el :Cliente), donde los consumidores del servicio
orden en que las actividades del proceso se pueden no ser conocidos para el proveedor. Un
realizan, desde el inicio hasta el fin, y el flujo de servicio puede tener una o más interfaces y un
mensajes entre dos participantes (las flechas contrato asociado. Un contrato de servicio
enteras son de secuencia y las punteadas de (ServiceContract, en el ejemplo uno es :Registrar
mensajes). Los objetos de flujo de secuencia solo solicitud) es una colaboración que define los
pueden utilizarse dentro de un mismo pool, entre términos, condiciones, interfaces y coreografía en
distintos pools se deben utilizar los objetos de que los participantes acuerdan para usar el
flujo de mensajes. En el grupo de Artefactos se servicio. Las interfaces pueden ser de tipo simple
Figura 2. Parte de la Arquitectura de servicios para el Proceso de negocio “Otorgar Préstamo” en SoaML
Las relaciones identificadas nos permiten transformadas. De los mensajes que entran a las
obtener los primeros elementos en el modelo actividades podemos identificar los servicios a
SoaML para definir la arquitectura de alto nivel. proveer (para su ejecución) en los ServicePoint
En la Tabla 2 se presenta un sub-conjunto de las asociados al participante que corresponde al pool
transformaciones QVT definidas. De cada Pool se que contiene a la actividad. De los mensajes que
obtiene un participante en la arquitectura que salen de las actividades podemos identificar los
serán quienes ofrezcan y requieran servicios, de servicios requeridos de otros participantes a los
cada Lane se obtiene un participante interno a que corresponde el Pool que contiene a la
éstos, que se utilizará en la definición de la actividad. En SoaML los ServicePoint y
arquitectura interna asociada al participante. Las RequestPoint son conjugados, esto es si un
actividades que se tendrán en cuenta para las participante brinda un servicio en un ServicePoint
transformaciones son las marcadas con el tipo habrá otro que lo requiera en un RequestPoint.
“Service” que indica que esa actividad será Debido a que en BPMN los mensajes pueden
soportada por un servicio. El marcado del modelo asociarse también a Pools sin necesidad de que
BPMN para generar servicios, lo realiza el estén específicamente asociados a una actividad
Arquitecto de software como parte del diseño de en el Pool, deben ser identificados para generar
servicios. Otras actividades podrán ser manuales o también los servicios asociados. Esto ocurre
de cualquier otro tipo de BPMN y no serán generalmente cuando de un Pool no se conoce su
La Figura 3 presenta el archivo XMI generado, y “Recibir información de crédito del cliente” de la
muestra los participantes generados interacción con el Centro de Información. Para el
correspondientes al Cliente, Banco y Centro de Cliente se generan los ServicePoint: “Recibir
Información de Crédito, más los participantes resolución”, “Firmar contrato del préstamo” y
internos al Banco “Servicios al Cliente” y “Recibir dinero del préstamo” de la interacción
“Autorización de Préstamo”. Para el Centro de con el Banco. Todos los ServicePoint generados
Información de Crédito se obtiene el ServicePoint tienen el nombre de la actividad asociada, el
del mismo nombre, ya que al no estar expandido atributo isService en True, y tienen asociado el
no se conocen sus actividades. Para el Banco se identificador del participante (interno) que los
obtienen los ServicePoint: “Registrar solicitud”, provee. Luego el archivo XMI se debe cargar en
“Entregar contrato del préstamo”, “Registrar el modelador para visualizar los diagramas y
contrato del préstamo” de la interacción de desde estos generar el código. En la Figura 4 se
mensajes con el Cliente, y el ServicePoint muestra en forma gráfica la parte del diagrama
ServicesArchitecture asociada con la generación reglas de mapeo entre los modelos que se
de estos elementos básicos. El diagrama generado automatizan parcial o totalmente. En [22] se
es parte del tipo de diagrama de agrega un modelo de valor desde el cual se
ServicesArchitecture para definir la arquitectura definen transformaciones a modelos de casos de
de alto nivel para el proceso de negocio. Estamos uso, automatizadas con ATL, que también se usa
trabajando en primera instancia con la vista en [23] definiendo dos tipos de reglas de
estructural de servicios, para luego incorporar la transformación: de generación básica para crear
generación de la parte dinámica asociada por elementos del modelo destino y de ligamiento
ejemplo, a los contratos. La generación de los para generar links entre éstos. A diferencia
participantes involucrados y de los ServicePoint y usamos metamodelos estándar existentes,
RequestPoint asociados para proveer y requerir derivando servicios directamente desde los
servicios entre ellos, corresponde a los elementos procesos de negocio, con QVT.
básicos con que se debe contar para presentar los En [24] se definen transformaciones
diagramas SoaML completos. Como puede conceptuales basadas en la sucesiva aplicación de
observarse en la Figura 4, se muestran los tres patrones desde la capa superior a la capa inferior,
participantes del proceso de negocio generados, utilizando grafos para hacer pattern matching. [25]
con ejemplos de puertos ServicePoint y define dos pasos para transformar procesos de
RequestPoint asociados a cada uno, mostrando el negocio en servicios: identificar tareas en los
tipo de las interfaces. Si bien aún no se generan procesos que son invocaciones a servicios, luego
los contratos de servicio, ni las interfaces integrando el modelado de procesos de negocio y
asociadas con sus operaciones, parámetros y tipos objetos en un modelo de servicios del negocio
de mensajes, la obtención de los elementos (Business Service Model, BSM) mediador entre
básicos de la ServicesArchitecture provee la base los requerimientos y su implementación. En
para el resto de las transformaciones. contraste utilizamos modelo de diseño de
servicios sin mediadores, y no proponemos
5. Trabajos relacionados nuevos patrones sino la utilización de patrones de
procesos existentes, los patrones de procesos de
Existen varias propuestas para transformar y negocio [26] principalmente para la validación de
los modelos. Estamos explorando también su uso
generar modelos de software desde procesos de
negocio utilizando lenguajes existentes como como guía en transformaciones más complejas.
QVT o ATL[18] o utilizando nuevos enfoques o
lenguajes definidos. BPMN es la notación más 6. Conclusiones y trabajo futuro
utilizada para modelar procesos de negocio, y
UML para el modelado de software y servicios. La propuesta presentada para obtener modelos
En [19] se proponen transformaciones de BPMN a de servicios en SoaML desde modelos de procesos
UML pero con foco en elementos de seguridad de negocio en BPMN mediante transformaciones
agregados al modelo BPMN, para obtener primero QVT, pretende automatizar lo más posible la
un DA de UML y de ahí derivar casos de uso y generación de servicios desde procesos de
clases de análisis. [20] también transforma BPMN negocio, en base a la utilización de notaciones y
en UML anotando el modelo BPMN con lenguajes estándares. Si bien las transformaciones
información a ser procesada por las corresponden a un conjunto reducido de reglas
transformaciones, obteniendo varios artefactos para un conjunto reducido de elementos
UML como DA, casos de uso y diagramas de seleccionados de BPMN y SoaML, creemos que
colaboración y deployment. Ambos trabajos proveen la base para la definición de
difieren del nuestro en que no usamos artefactos transformaciones para el resto de los elementos,
intermedios para pasar del modelo BPMN al que es en lo que estamos trabajando actualmente.
modelo SoaML sino que lo hacemos directamente. Estas transformaciones se integran en la
En [21] se modela el comportamiento de metodología BPSOM para desarrollo orientado a
sistemas Web con cuatro PIMs: servicios de servicios desde procesos de negocio definido en el
usuario, casos de uso extendidos, proceso de marco MINERVA que constituye el eje del
servicios y composición de servicios, definiendo trabajo de investigación. El marco está basado en
la integración y utilización de diversos estándares [5] Mellor, S., Clark, A., Futagami, T., Model
existentes para procesos de negocio, servicios y Driven Development - Guest editors
desarrollo dirigido por modelos. En ese sentido introduction, IEEE Computer Society,
BPMN, SoaML y QVT, alineado con MDA, son September/October, (2003).
estándares de OMG integrados para la generación [6] Soa Modeling Language (SoaML),v.1.0 Beta1,
automática de servicios presentada en este OMG, (2009).
artículo. De la misma forma el soporte de [7] Query/Views/Transformations (QVT), v.1.0,
herramientas definido está basado en el entorno OMG, (2008).
Eclipse, integrando diversos plug-ins que soporten [8] Business Process Modeling Notation (BPMN),
las distintas etapas del desarrollo. Adicionalmente OMG, (2008).
estamos trabajando en la definición de un plug-in [9] Delgado A., Ruiz F., García-Rodríguez de
de Eclipse propio para implementar el estándar Guzmán I., Piattini M:, MINERVA: Model
SoaML que se integre en el entorno. drIveN and sErvice oRiented framework for
El conjunto completo de transformaciones the continuous business processes
QVT con el soporte metodológico y de improVement & relAted tools, In: 5th IW on
herramientas integrado en el marco MINERVA Engineering Service-Oriented Applications
servirá para guiar todo el proceso de desarrollo de (WESOA’09), in ICSOC, Stockholm, (2009).
aplicaciones orientadas a servicios desde procesos [10] Delgado A., Ruiz F., García-Rodríguez de
de negocio. Creemos que MINERVA puede Guzmán I.,Piattini M., Towards a Service-
resultar una guía útil y soporte de herramientas Oriented and Model-Driven framework with
basado en Eclipse, para ser utilizado en business processes as first-class citizens, In:
organizaciones que requieran una integración 2nd IC on Business Process and Services
rápida y fácil de metodologías, herramientas y Computing (BPSC’09),Leipzig, (2009).
conceptos para adoptar los paradigmas BPM, SOC [11] Delgado A., Ruiz F., García-Rodríguez de
y MDD. Guzmán I., Piattini M., Towards an ontology
for service oriented modeling supporting
Agradecimientos. Este trabajo ha sido business processes, 4th. IC on Research
parcialmente financiado por la Agencia Nacional Challenges in Information Science (RCIS’10),
de Investigación e Innovación (ANII), Uruguay, Nice, (2010).
proyecto ALTAMIRA (Junta de Comunidades de [12] Delgado, A., García - Rodríguez de Guzmán,
Castilla-La Mancha, España, Fondo Social I., Ruiz, F., Piattini, M.: Tool support for
Europeo, PII2I09-0106-2463), proyecto PEGASO Service Oriented development from Business
/MAGO (Ministerio de Ciencia e Innovación Processes, 2nd Int. Work. on Model-Driven
MICINN, España, y Fondo Europeo de Desarrollo Service Engineering (MOSE’10), in TOOLS,
Regional FEDER, TIN2009-13718-C02-01). Málaga, (2010)
[13] SOA Tools Platform (STP) BPMN Modeler,
Referencias http://www.eclipse.org/bpmn/
[14] Magic Draw Cameo SOA+,
[1] Papazoglou, M.; Traverso, P.; Dustdar, S.; http://www.nomagic.com/
Leymann, F.: Service-Oriented Computing: [15] ModelPro, http://modeldriven.org/
[16] Medini QVT, ikv++ technlogies ag,
State of the Art and Research Challenge, IEEE
Computer Society, (2007). http://projects.ikv.de/qvt/
[2] Erl, T.,Service-Oriented Architecture: [17] Eclipse Process Framework Composer (EPF
Concepts, Technology, and Design, Composer), http://www.eclipse.org/epf/
[18] Jouault, F., Kurtev, I., Transforming Models
PrenticeHall, (2005).
[3] Krafzig, D., et.al, Enterprise SOA, SOA: Best with ATL (ATLAS Transformation
Practices, Prentice Hall, (2005). Language), Satellite Events at MoDELS
[4] Smith,H.,Fingar,P.,Business Process Conference (2006)
Management: The third wave, Meghan- [19] Rodríguez,A.; Fernández-Medina, E.; Piattini,
Kieffer, (2003). M.: Towards CIM to PIM Transformation:
From Secure Business Processes Defined in
BPMN to Use-Cases. 5th International [23] Touzi J., Benaben F., Pingaud H., Lorré J.P., A
Conference on Business Process Management model-driven approach for collaborative
(BPM’07), (2007). service-oriented architecture design, Int. J. of
[20] Liew,P., Kontogiannis,K. Tong,T., A Prod. Economics,Vol.121 Is. 1, (2009)
Framework for Business Model Driven [24] Gacitua-Decar V., Pahl C., Pattern-based
Development,12th Int. Workshop on Sw. business-driven analysis and design of service
Tech. and Eng. Practice (STEP’04), (2004). architectures, 3rd Int. Conf. on Software and
[21] de Castro, V., Marcos, E., López Sanz, M., A Data Technologies SE (ICSOFT’08), (2008)
model driven method for service composition [25] Rychly M., Weiss P., Modeling of SOA: from
modelling: a case study, Int. J. Web business process to service realization, 3rd Int.
Engineering and Tech., Vol. 2, No. 4, (2006) Conf. on Evaluation of Novel Approaches to
[22] de Castro V., Vara Mesa J. M., Herrmann E., SE, (ENASE 08), (2008)
Marcos E., A Model Driven Approach for the [26] van der Aalst, W.; ter Hofstede, A.;
Alignment of Business and Information Kiepuszewski, B.; Barros, A. 2003. Workflow
Systems Models, (2008) Patterns, In Distributed and Parallel
Databases, 14(3), pages 5-51.
All these variability issues make primordial to Table 2. Required variability in MARTE
consider variability in model analysis as they analysis elements
represent software behaviour and platform.
Different products of the line require performing Analysis Element Variability
different analysis varying from one product to End2EndFlow and Some functionalities may require
another one. As a result, analysis process and GaWorkloadEvent particular End2EndFlows and/or
GaWorkloadEvent. These terms
AnalysisContext term must be extended to address may be mandatory, optional or
SPL analysis. Therefore, this variability is related alternative.
to the next analysis concepts in a lower GaWorkloadBehaviour and A particular configuration requires
GaScenario specific scenarios that other
abstraction level in a SPL development: configuration may not require.
• Each product model requires analyzing That is to say, some system
specific behaviours (GaWorkloadBehaviour). behaviours can be analyzed in
Behaviour models must be developed or specific configurations.
GaStep Different operations may be
adapted for the specific model as not all executed by a model element in a
products of the line may have same features. scenario. GaStep may be
These models are composed by different mandatory, optional or alternative
depending on the model elements.
model elements due to SPL features diversity
PlatformResource Different execution platforms are
(e.g., different objects, lifelines or activities). necessary. Thus, different platform
A scenario may be composed by different designs and alternative resources
GaSteps, stimulated by different (DeviceResource or
ProcessingResource) that take part
GaWorkloadEvent and composed by different and can be replaced easily in the
scenarios (GaScenario). system are required.
• As software may run under different Alternative deployment designs
platforms, execution platform variability must due to alternative platform designs
are needed (software allocation).
be taken into account. Same scenario may run Parameters and tagged To represent alternative values
in different platforms (GaResourcesPlatform) values (hostDemand, SchedPrioRange,
and software to platform mapping (software etc.) in model elements.
allocation) may be different, e.g. in order to
analyzed which allocation is the one that best
suits required features.
3.1. Variability in AnalysisContext
• Non-functional properties may vary from one
specific model to another, as not all products
require same quality and not same model The aim of specifying AnalysisContexts is to
elements take part in the specific model. evaluate critical quality attributes in a specific
Information related to the quality attributes are scenario that an embedded system may execute. In
attached by specific stereotypes (PaStep, an embedded SPL different AnalysisContexts must
SaStep, GaExecutionHost, etc.) and tagged be defined due to the high variability that can be
values (hostDemand, ExecTime, etc.) that can found. This way, each specific product model can
be found in GQAM, PAM and SAM packages be validated in order to evaluate whether they
of the MARTE profile. satisfy required quality attributes.
• Not all products of the line require same AnalysisContext itself also requires variability
analysis, thus diverse AnalysisContext must be elements as a result of different behaviours of the
specified. specific product models of the line. This
variability issues are specified below:
MARTE profile is a UML profile • GaWorkloadBehaviour: It is defined by
specification for single real-time embedded End2EndFlows composed by GaScenarios
systems. But when concepts from SPL paradigm and GaWorkloadEvents. In schedulability
like variability are faced for example, other AnalysisContext (SaAnalysisContext),
mechanisms are necessary for a proper analysis End2EndFlows may be optional due to
and management. Therefore, analysis models have functional variability.
been studied to identify and specify required • GaWorkloadEvent: A GaScenario can be
system variability in analysis (see Table 2). activated by different GaWorkloadEvents and
these GaWorkloadEvents can have a different beginning. They can also be used in value
arrival pattern as defined in MARTE: expressions in dependent tagged values.
periodic, aperiodic, sporadic, burst, irregular, • AnalysisContext: This concept is the
closed and open. variability mechanism specified by MARTE
• GaScenario: A scenario is composed by a set for model analysis. It identifies the model
of GaSteps. Due to functional variability of elements (diagrams) of interest and specifies
the line, a GaStep or a set of them may be global parameters of the analysis. A specific
optional or alternative. product model may have several
• GaResourcesPlatform: An execution platform AnalysisContexts.
may be built by different resources and • UML mechanisms: A combinedFragment
different designs, concluding in execution defines an expression of iteration fragments
platform variability. Besides, software to [16]. There are different CombinedFragments,
platform mapping may be different. Thus, which are distinguished by its iteration
variant resources (DeviceResources and operator, such us: OPT, ALT, LOOP, etc. For
ProcessingResources), optional example, ALT operator designates that the
SchedulableResources and alternative CombinedFragment represents a choice of
software allocation are required. behaviour and at most, one of the operands
• As information related to quality attributes is can be chosen. On the other hand, OPT
attached in models representing behaviour and operator designates that the
execution platform, and quality attributes may CombinedFragment represents a choice of
vary from one model of the line to another, behaviour in sequence diagrams where the
stereotypes and tagged values may vary. Each only operand happens or nothing happens.
quality attribute has its own stereotypes and Abstract stereotype, inheritance, interface
tagged values. Tagged values may take implementation, etc. are also UML
alternative values and they may be dependent mechanisms that can help when analyzing
of other tagged values. SPL models, e.g., abstract stereotype can be
• Var: Each AnalysisContext is specified by a applied in activity diagrams.
set of variables, a scenario and a platform. The • Variability profiles: Functional variability has
set of variables depend on the scenario and the been a deep research topic. There are several
platform and they may be input, output or UML profiles for specifying variability where
input/output variables. some of them focus on functional aspects and
extend use cases to specify variability; others,
With the aim to be able to model required extend static models to specify variability and
variability in AnalysisContext existing few works model variability in behavioural
mechanisms have been analyzed: models.
• MARTE uses predefined model libraries to Gomaa’s [10] product line profile called
apply to real-time and embedded systems. PLUS is one of the most complete profile. It
These model libraries are containers of takes into account feature modelling, use
predefined data types, time, measurement cases, static and dynamic interaction
units, etc. that are used for example, to specify modelling, etc. Moreover “it is a well
data size unit kind of messages. As a container developed method applied to real-time
concept, it can store different model elements. systems that it is concerned with the
• Variables: Variables are a common behaviour view needed for performance
mechanism that it may be applied to let an analysis” [23]. Ziadi’s UML profile for
element in a generic way instead of instantiate Product Lines [25] is also a representative
into a specific element or until a decision is profile. It extends class and sequence
taken. MARTE defines variables by “$” diagrams to include variability and provides
symbol. Any value of the same type can be support for product derivation via PL
assigned to that variable. Usually it is assigned constraints that guide the derivation process. It
to tagged values until instantiation time, is the only one that concerns UML2.0 models
instead of bounding a specific value from the and not UML1.x models. UML-F [17], UML
profile for frameworks can be also useful product line. In [18] it is mentioned that feature
when product-lines have been developed modelling supports several areas of product line
following a framework based approach. CVL engineering, especially scoping and the
(Common Variability Language) is a configuration and derivation of products from the
variability specification language (still in reuse infrastructure, but also activities like project
development), that follows a separate planning and tracking, testing and customer
language approach, and allows expressing negotiations.
variability in a base model and relationships
between possible choices and the base model
[12]. 3.2. Example
Variability profiles apply stereotypes to
include variability in UML models. More than Elements and/or concepts that have been
one stereotype can be applied to UML aforementioned are intended to describe by the
elements. A UML class can be stereotyped as following example.
<<optional>> and <<DeviceResource>>. A feature model of an embedded software
Thus, more than one profile can be used in a product line and in particular of an elevator
model. This mechanism may help to identify system is represented in Fig. 2. The feature model
variable model elements in analysis. has been simplified for a better understanding
such as required and excluded relations among
These mechanisms may help modelling features.
variability in MARTE AnalysisContext. In Table 3 The functional features described possible
how the aforementioned variability mechanisms functionalities of the system to analyze and are
can be applied on MARTE analysis elements is related to those MARTE profile behaviour aspects
detailed. (WorkloadBehaviour) and more specifically to the
end-to-end operations of the system
Table 3. Mapping of analysis elements and (EndToEndFlow) and scenarios (GaScenario and
variability mechanisms that can be applied GaStep). In this case, self-healing optional feature
Analysis Element Variability
Mechanism
will be related with an optional EndToEndFlow
Workload GaWorkloadEvent Variability profile and a specific scenario.
Behaviour GaScenario CombinedFragments It also is related to the behaviour the variable
GaStep Variables design, e.g., if a system is centralized or
AnalysisContext
UML mechanisms
distributed. The elevator system will behave in
Platform GaPlatformResource Variability profile different ways in both cases, executing different
Resources Allocation model library GaSteps.
AnalysisContext Different types of processors with their
Variables
UML mechanisms properties, sensors, communication systems, etc.
Var ContextParameters Variability profile define the variable part of the platform used in
Variables PlatformResources.
AnalysisContext The analyses to perform may vary from one
product to another product of the line due to
To perform a proper analysis of variable require different quality attributes, or by the
embedded systems, it is not enough with the analysis type, method, etc. These concepts are
mechanisms that UML and MARTE provide. It is related to the AnalysisContext and stereotypes and
necessary to be able to model and manage that tagged values of the MARTE profile related to
variability. UML and MARTE afford variability quality attributes, e.g., to perform performance
modelling but not managing. Other mechanisms analysis, the models have to be annotated by the
are necessary for that purpose, e.g. feature models. stereotypes of the PAM package. The stereotypes
Feature modelling [13] was introduced as part of and tagged values used when annotating quality
the domain analysis and domain modelling phase attributes variability are also related to
to systematically describe the common and PlatformResources properties and also to
variable features shared among the products of a WorkloadBehaviour. For example,
requirements traceability management while analysis and identify critical analysis scenarios for
variability and verification phase is left for future each specific product model of the product line.
work. Traceability links from features to analysis models
Tawhid and Petriu model a software product will be required for that purpose too. Thus, the
line with functional variability and annotated with combination of the studied mechanisms for
MARTE profile to perform performance analysis embedded SPL analysis will be specified and will
[23]. Information related to performance is enable the creation of new mechanisms for
attached in a general way using variables. And in variability management. A case study will be also
order to validate quality aspects, concrete values performed to identify possible conflicts or
are assigned to those variables through ATL problems and validate the proposal.
(Atlas Transformation Language) transformations Another research way is to study whether
that are also used to obtain a concrete product existing tools could help in managing variability
model, but variability management is slightly like pure::variants [9], a tool for managing
defined. variability that focuses on development. As most
Espinoza et al. [5] propose to use a similar of the mechanisms focus on variability
diagram to SysML parametric diagrams in management of initial phases such as feature
MARTE analysis for complex non-functional modelling, they lack of a way to represent lower
evaluation scenarios taking into account variations level concepts. It becomes essential the study of
in the mapping from structure to architectural how existing methods and mechanisms can be
resources and parameterization i.e., propose to combined and/or extended for this purpose (next
composite existing design models to experiment step) trying to give traceability and a proper
with different implementation or design decisions variability management based on UML techniques
for the purpose of quantitative analysis. and standard profiles. We intend to extend the
Groher et. al. [11] present a tool-based work presented in [5] by Espinoza et al. to tackle
approach for managing crosscutting feature SPL model analysis. They propose analysis
variability in software product lines using aspect- composition view for analysis which can help on
oriented principles. SPL analysis but there is a lack of how this
The approaches mentioned before can be approach may be linked to variability
complementary to model analysis. None of them management or feature-oriented methods as it was
deals with all necessary issues for embedded a proposal for the analysis of a single-system.
software product line model analysis but the
contributions made by them can be combined to
reach variability goal in model analysis. Acknowledgements. This work was partially
supported by The Basque Government under
grants PI2009-1 (OPTIMA) and the Spanish
5. Conclusions and Future Trends Ministry of Science and Education under grants
TIN2007-61779 (OPTIMA) and TSI-020400-
In the present paper required variability issues in 2008-99 (EVOLVE). It has been developed by the
MARTE model analysis for SPL (as MARTE embedded system group supported by the
profile was defined for single systems analysis) Department of Education, Universities and
and diverse variability modelling mechanisms Research of the Basque Government.
have been analyzed. Modelling and management
mechanisms can be complementary and a suitable
combination of them could be beneficial to tackle References
SPL model analysis.
The future work to be carried out includes the
[1] UML Profile for Modeling and Analysis of
definition of a management mechanism for all
Real-Time Embedded Systems. formal/2009-
variability types identified for model analysis. 11-02 (2009)
Functional, quality attributes, platform, allocation [2] Albinet, A., Begoc, S., Boulanger, J. -. et al.:
and analysis variability must be considered and The MeMVaTEx Methodology: From
properly managed in order to perform model Requirements to Models in Automotive
Application Design, 4th European Congress [13] Kang, K., Cohen, S., Hess, J. et al.: Feature-
Embedded Real Time Software - ERTS'08, Oriented Domain Analysis (FODA)
Toulouse, France (2008) Feasibility Study, Technical Report, SEI
[3] Bosch, J.: Design and use of software (1990)
architectures: Adopting and evolving a [14] Le Dang, H., Dubois, H., Gérard, S.:
product-line approach. ACM Press/Addison- Towards a Traceability Model in a MARTE-
Wesley Publishing Co, New York, USA Based Methodology for Real-Time Embedded
(2000) Systems. Innovations in Systems and Software
[4] Deelstra, S., & Sinnema, M.: Managing the Engineering, Springer-Verlag London
Complexity of Variability in Software Product Limited, 4 (2008) 189-193
Families. (2008) [15] Martins, P.: Integrating Real-Time UML
[5] Espinoza, H., Servat, D., Gérard, S.: Models with Schedulability Analysis,
Leveraging Analysis-Aided Design Decision Technical Report, Tri-Pacific Software Inc...
Knowledge in UML-Based Development of (2003)
Embedded Systems, SHARK '08: Proc. of the [16] Superstructure Version 2.2. Object
3rd int. workshop on Sharing and reusing Management Group, formal/2009-02-02
architectural knowledge, ACM (2008) 55-62 (2009)
[6] Espinoza, H.: An Integrated Model-Driven [17] Pree, W., Fontoura, M., Rumpe, B.: Product
Framework for Specifying and Analyzing Line Annotations with UML-F, SPLC 2: Proc.
Non-Functional Properties of Real-Time of the 2nd Int. Conference on Software
Systems, Thesis. DRT/LIST/DTSI/SOL/07- Product Lines (2002) 188-197
265/HE (2007) [18] Schwanninger, C., Groher, I., Elsner, C. et
[7] Espinoza, H., Terrier, F., Gérard, S.: Model al.: Variability Modelling Throughout the
Driven Engineering and Real-Time Analysis Product Line Lifecycle. MODELS 2009, 5795
of Embedded Systems: The UML MARTE (2009) 685-689
Standard and its Challenges, ARTIST [19] SEI: A Framework for Software Product Line
Workshop at CAV 2007, Berlin, Germany Practice, Version 5.0. 2008
(2007) [20] Shi, J.: Model and Tool Integration in High
[8] Etxeberria, L., Sagardui, G., Belategi, L.: Level Design of Embedded Systems, Thesis.
Quality Aware Software Product Line (2007)
Engineering. Journal of the Brazilian [21] Sinnema, M., & Deelstra, S.: Classifying
Computer Society (JBCS), 14 (2008) Variability Modeling Techniques.
[9] GmbH, p.: Variant Management with Inf.Softw.Technol., 49 (2007) 717-739
Pure::Variants, Technical Paper, Available [22] OMG System Modeling Language (OMG
from http://web.pure-systems.com (2007) SysML) V1.0. formal/2007-09-01 (2007)
[10] Gomaa, H.: Designing software product lines [23] Tawhid, R., & Petriu, D.: Integrating
with UML: From use cases to pattern-based Performance Analysis in the Model Driven
software architectures. Addison Wesley Development of Software Product Lines,
Longman Publishing Co., Inc, Redwood City, MODELS 08, 5301 LNCS (2008) 490-504
CA, USA (2004) [24] Zha, X. F., Fenves, S. J., Sriram, R. D.: A
[11] Groher, I., Krueger, C. W., Schwanninger, Feature-Based Approach to Embedded System
C.: A Tool-Based Approach to Managing Hardware and Software Co-Design, ASME
Crosscutting Feature Implementations. DETC. (2005)
AOSD'08, (2008) [25] Ziadi, T., Hélouët, L., Jézéquel, J.: Towards a
[12] Haugen, Ø., Oldevik, B., Olsen, J.: Adding UML Profile for Software Product Lines, 5th
Standardized Variability to Domain Specific Int. Workshop on Product Familly
Languages, 12th International Software Engineering (PFE-5), LNCS 3014 (2003) 129-
Product Line Conference, SPLC'08. (2008) 139
139-148
Resumen
1. Introducción
Para poder beneficiarse de una orientación fabril
de la producción de software en una La implantación de Métrica3 y de cualquier otra
administración pública: aumento de la metodología de desarrollo de software en una
productividad, estandarización de la calidad del organización, pasa inevitablemente por la
producto y reducción drástica del plazo de los evaluación de su viabilidad y aplicabilidad. En el
entregables, incluido el prototipo ejecutable; caso de las administraciones públicas la
parece imponerse el uso de las tecnologías metodología de uso obligado es Métrica3.
dirigidas por modelos. Ahora bien, se debería Diseñada con espíritu unificador, tanto en su
considerar qué tipo de modelo es el más adecuado vertiente orientada a objetos como en la
para la especificación del motor MDD, si no se estructurada, define una nutrida secuencia de
dispone de la suficiente cultura UML ni de la actividades, técnicas y prácticas a realizar,
confianza en el dominio de las técnicas de MDA. cubriendo en su totalidad el ciclo de vida del
Una alternativa en este caso es utilizar un PSM sistema de información. Por contra penaliza su
origen poblado a partir del propio esquema aplicabilidad incrementando el coste de
relacional obtenido mediante ingeniería inversa. utilización. Son bien conocidos los beneficios y
Este modelo de diseño relacional ha sido aplicado las ventajas derivados de la implantación de una
de forma homogénea a todos los sistemas de metodología de desarrollo, pero para que pueda
información de la organización. A partir del PSM ser una realidad se requiere la provisión de
destino el motor genera un prototipo ejecutable instrumentos que permitan compensar los grandes
compuesto por un árbol de mantenimientos costes requeridos, con los limitados recursos
siguiendo el patrón previamente definido de disponibles. Requiere una herramienta que esté
maestro-multi-detalle, integrado con la gestión enfocada a la automatización, reutilización y
documental de la Conselleria de Treball i transferencia automática de los requisitos
Formació y la plataforma telemática del Govern capturados desde una fase a las siguientes. Una
Balear. A partir de los resultados obtenidos con el transformación de los modelos de elicitación de
motor, se estudia su integración con la plataforma requisitos a los entregables requeridos en plazo,
ofrecida por Moskitt.org, con el objeto de abrir incluido el sistema final ejecutable, sus pruebas
brecha hacia una arquitectura dirigida por y/o prototipos. Para ello se impone un enfoque
modelos y la implantación efectiva de Métrica3 en dirigido por modelos, que mediante la generación
esta administración pública. automática de los entregables conformaría una
implantación ágil de la metodología.
Palabras Clave Siguiendo los mismos criterios de economía
de medios, la solución que se adopte necesita ser
generación de código dirigida por modelos de viable para la coyuntura de la organización que
base de datos, ingeniería inversa, administración pretenda acogerse a este enfoque. Se parte de una
electrónica, Moskitt, Métrica3
situación en la que no existe una cultura UML unívoca de la especificación entidad-relación del
suficiente, ni dominio de las técnicas de MDA[19] sistema conforme al estándar corporativo. De esta
con las que dirigir el proceso software que se forma se salva el desnivel tecnológico del equipo
pretende implantar. Por otra parte, no se cuenta y se cubre la totalidad de los sistemas de
con un equipo de técnicos estable y información de forma casi automática, únicamente
suficientemente capacitados en todas las definiendo la lista de patrones de nombres de
tecnologías a cubrir para poder desarrollar el tablas que conformarán la aplicación a generar, así
software requerido por los estrictos estándares de como cierta información de configuración de la
desarrollo definidos por la Direcció General de generación. La solución arquitectónica ha sido
Tecnologia i Comunicacions (DGTiC) y la propia iterada según evolucionaba y con ella el propio
Conselleria de Treball i Formació (CTiF) de la motor de generación. En paralelo se han evaluado
Comunitat Autònoma de les Illes Balears (CAIB). diferentes plataformas y herramientas para
Inicialmente se evaluaron las herramientas de facilitar la implantación de la metodología del
generación de código de JBoss como Hibernate proceso software. Entre otras cabe destacar las
Tools y el framework de Seam, tanto su herramientas de Visual Paradigme, Enterprise
configuración como personalización mediante la Architect y Moskitt. El hecho de que Moskitt sea
adaptación de sus plantillas y procesos de una plataforma MDE que soporta a Métrica3 y
ingeniería inversa. Pero debido a la antigüedad de además de código abierto sobre Eclipse (el IDE de
las versiones requeridas por la plataforma se desarrollo utilizado por la CTiF) determinó su
imposibilitaba o dificultaba en exceso su elección. Por lo que se procedió a estudiar los
utilización. Además, el hecho de no tener pleno posibles caminos de integración con dicha
conocimiento de los metamodelos empleados por herramienta.
estas herramientas penalizaba el coste de El presente artículo pretende describir el
desarrollo de una solución suficientemente proceso de definición, construcción e integración
adaptada a la plataforma. Por tanto y con el objeto de un motor de generación de código estructural,
de convencer con tangibles se comenzó con el Es.Caib.SwFactory, para una estricta arquitectura
desarrollo de un motor de generación de código JEE/ ExtJs en un contexto desfavorable, orientado
propio que permitiera dar resultados modestos a formar parte esencial en una plataforma MDA
pero estables y conformes a los requerimientos para la administración balear. En la siguiente
definidos por los estándares a cumplir. sección se presentan los detalles del motor de
Para ello se definió previamente una solución generación de código. En el tercer apartado se
arquitectónica conforme a la plataforma que estudian posibles vías de integración con Moskitt
permitiera cubrir mediante una solución genérica, y finalmente en la cuarta sección se expondrán las
las necesidades de gestión de las aplicaciones conclusiones y trabajos futuros.
corporativas. Básicamente se pretendía migrar a
la plataforma JEE oficial un conjunto de
aplicaciones desarrolladas en Ms Access, entre
otras razones debido a la cancelación de las
licencias de uso por parte de esta administración.
Para ello, se identificó la solución maestro-detalle
de Ms Access como una interfaz deseable a la que
se le debía añadir una integración con la gestión
documental de la CTiF y con la plataforma
telemática de la CAIB.
Por otra parte debido a la carencia de técnicas
y recursos, y a la implantación extensiva de un
estricto estándar de base de datos en todos los
sistemas de información de la organización, se
eligió utilizar el PSM relacional de la base de
datos obtenido mediante ingeniería inversa para
dirigir el proceso de generación de código. Ya que
el esquema relacional representa una proyección
Figura 1. Etapas del proceso de generación.
Igual que la arquitectura, el motor ha partes del modelo necesitan para generar con las
evolucionado y el siguiente paso deberá abordar plantillas adecuadas cada una de las colecciones
su adaptación a MDA. Para ello se debería de ficheros del proyecto, se podría definir en una
redefinir el metamodelo en un PIM y tres PSM sola plantilla y un fichero de extensiones de
(como muestra la figura 5) para poder descargar XPand. De esta forma parece obvia la mejora de
de complejidad a la lógica de las plantillas de la mantenibilidad del motor.
FreeMarker que actualmente cuestan mantener, y Para poder ilustrar la complejidad de la que se
migrarlas a XPand para implementar las está hablando haremos un breve recorrido por los
transformaciones M2T. Y en segundo lugar, componentes arquitectónicos requeridos por la
redefinir los cálculos implementados por métodos plataforma. En primer lugar, existen dos partes
Java en el metamodelo como transformaciones claramente diferenciadas en la figura 5 que
M2M en ATL e integrarlas en el gestor de componen los dos proyectos JEE de la aplicación.
sincronización utilizado por Moskitt. Gracias a las De una parte, JEE/EJB Business Project, que
características y potencia expresiva de XPand se define el modelo de negocio en POJOs de la
podrían definir en unas pocas plantillas lo que aplicación, donde por cada entidad del modelo se
ahora requieren 8 procesos escritos en Java y otras implementa una clase DAO en tecnología JDBC y
22 plantillas de FreeMarker, para generar los un EJB Stateless Session Façade para ofrecer los
artefactos de la misma arquitectura. Ésto es servicios de negocio al resto de componentes, bien
debido a que a partir una sola plantilla XPand se clientes externos bien los servlets y JSPs del
pueden generar diferentes tipos de ficheros, proyecto web. De otra parte, el JEE/ExtJs Web
mientras que con FreeMarker se necesita una Project, además de definir los controller con
plantilla por cada fichero generado. Lo que ahora servlets y el maquetado con JSPs, se implementan
hacen los procesos de generación eligiendo qué las pantallas de la interfaz de usuario mediante
módulos ExtJs (una librería en Javascript requieren de al menos un JSON Reader para
orientada a objetos y patrones con soporte AJAX deserializar los datos, un Store para interpretar el
y multimedia bastante popular y llamativa). Son contenido de los mismos y una lista de ítems para
estos módulos ExtJs los que invocan a los servlets definir el aspecto, propiedades y validaciones de
mediante peticiones JSON, razón por la cual los campos.
Síntesis Ingeniería
Generación Inversa
n
Serialización
Import / Export
JEE
Figura 6. Jerarquía de clases IModelPersistor que facilitan la definición y extensión del motor.
El motor ha sido refactorizado para poder dar XMI mediante técnicas de EMF dinámico con el
soporte a operaciones distintas de la generación de objeto de facilitar la integración MDA.
aplicaciones en base a partes de esquemas
relacionales. El diseño se ha basado en la interfaz
IModelPersistor y su jerarquía de clases (figura 3. Estudio de integración con Moskitt,
6) que ofrece las operaciones de carga “load” y hacia una plataforma MDA para
descarga “save” de una instancia del modelo
Métrica3.
(conforma al metamodelo del motor) en base a
unos argumentos de configuración.
Se parte de una situación en la que se cuenta con
un estándar anticuado de desarrollo de
Clase Abstracta
aplicaciones, más orientado a facilitar las tareas de
AbstractModelPersistor implementa los
administración de servidores de aplicaciones que a
métodos load y save, es útil para persistores
favorecer la productividad y calidad del proceso
simétricos de serialización y deserialización,
software, que imposibilitan o dificultan en
tales como en el caso de:
extremo, la aplicación de herramientas ágiles de
JavaModelPersitor desarrollo. En consecuencia, no hay recursos para
EcoreModelPersistor utilizar la metodología que se declara de obligado
AbstractModelRevEngLoader solo permite cumplimiento, Métrica 3, y por ende sirve de
la implementación del método load para las pretexto para realizar una captura de requisitos
operaciones de ingeniería inversa, tales exigua e insuficiente, con lo que ello supone. Por
como en el caso de: tanto, se pretende resolver esta situación mediante
OracleRevEngModelLoader la implantación ágil de una metodología que
AccessRevEngModelLoader estandarice el trabajo, guiada por una herramienta
JavaReflectionRevEngModelLoader que le de soporte a los métodos y técnicas para la
AbstractModelGeneratorSaver solo permite elaboración de requisitos y la generación
la implementación del método save para las temprana de prototipos para validar y aceptar las
operaciones de generación de textos, como: diferentes iteraciones de las fases de requisitos,
CaibOracleDDLScriptGenerationSaver análisis y diseño, alineado con las restricciones
CaibModelVoPkLayerGenerationSaver arquitectónicas de la CAIB.
CaibDaoJdbcLayerGenerationSaver El Modeling Software Kit (Moskitt)[6] es la
CaibBusinessEjbLayerGenerationSaver primera herramienta open source orientada a dar
CaibWebServletLayerGenerationSaver soporte desde un enfoque MDA a la metodología
CaibWebExtJsLayerGenerationSaver Métrica3 sobre la plataforma de Eclipse, aunque
podría configurarse para cualquier otra
CaibJEEApplicationGenerationSaver
metodología de desarrollo. Existen otras
Figura 7. Clases abstractas de asistencia para la herramientas o planteamientos pero ni son open
definición de procesos del motor. source ni están basadas en MDA. Para implantar
con éxito en una organización una metodología de
Para facilitar la implementación de las clases desarrollo de software, se requiere la adecuada
Persistor se han definido tres clases abstractas de instrumentación de las prácticas definidas
apoyo que cumplen las siguientes características mediante el uso de herramientas específicas con el
(ver tabla de la figura 7). Las operaciones objeto de disponer de:
definidas permitirán evolucionar al motor para • Un procedimiento de desarrollo adaptable a la
ofrecer nuevas prestaciones de generación y de organización y a cada uno de los roles.
ingeniería inversa sobre Ms Access o paquetes • La construcción de modelos según las técnicas
Java. También se ha implementado un mecanismo y prácticas definidas por la metodología.
de serialización mediante clases Java generadas • La automatización del proceso de elaboración
(JavaModelPersistor) que además de permitir de modelos y entregables.
trabajar sin conexión a base de datos servirá de • La integración con las herramientas
prototipo para el desarrollo de los serializadores corporativas de gestión de proyectos y control de
versiones.
características getMetadata de JDBC con el objeto menor medida de editores UML con gestores de
de universalizar el motor a cualquier base de datos proyectos, como Enterprise Architect [95][98],
pero se dejo para más adelante por dos razones: en Rational Rose [100] o similares herramientas [97]
primer lugar, la extracción de los metadatos del que permiten dar soporte a una metodología, pero
diccionario se consiguió antes que de la api de no consiguen transformar los requisitos
JDBC; y en segundo lugar se pretende conectar el capturados en una fase en los de la siguiente,
metamodelo relacional con las Db Tools de manteniendo la trazabilidad desde el principio
Eclipse que son capaces de manipular cualquier hasta el producto final. A su vez, integrados con
base de datos vía JDBC. En una segunda fase se gestores documentales ad-hoc como Documentum
abordarán las bases de datos de Ms Access para [97] o Alfresco [98]. Pero que en cualquier caso y
obtener las modificaciones que se hayan podido tal como reconocen diversas fuentes [97][98], más
añadir y en una tercera fase los archivos de bien se ha utilizado una infraestructura para
paquetes Java para recuperar las jerarquías de generar la documentación exigida por Métrica3
clases de los sistemas en producción. que un verdadera utilización de la metodología.
En futuros trabajos dentro del proceso de De hecho, Roberto Canales, gerente de Autentia
migración a MDA se terminará la implementación [98], propone en su libro [24] la aplicación de
de EcoreModelPersistor y de las transformaciones metodologías ágiles y luego un mapeo del proceso
de síntesis, sincronización e ingeniería inversa del con la generación de los artefactos exigidos.
metamodelo del motor con los metamodelos de las De esta búsqueda se puede concluir que
Db Tools y UML2 que aún no se han Moskitt es la única plataforma abierta basada en
implementado o no han sido suficientemente MDA sobre Eclipse que soporte el proceso
probadas. Además queda pendiente migrar las software definido para la metodología Métrica3.
transformaciones implementadas por métodos Después de contactar con la dirección informática
Java a ATL y la generación basada en FreeMarker de la Conselleria de Transportes e Infraestructuras
a las plantillas de Xpand. También convendrá de la GVA ([91][92]) y parte del grupo de
construir un editor de parámetros de configuración investigación PROS [93][27] que ha asesorado a
con la ayuda de XText para convertir el motor en ProDevelop en la construcción de Moskitt, se han
un plug-in de Eclipse. podido esbozar los criterios para adaptar Moskitt a
A pesar de disponer Moskitt de buenos las particularidades de la CAIB. La dirección
argumentos a su favor, se ha intentado realizar una informática de la CIT-GVA ([91][92]) y la propia
búsqueda sistemática de trabajos similares en el empresa ProDevelop a través de sus listas de
mercado limitada a la información disponible en soporte y técnicos [94] han ofrecido
la web y a la iniciativa de respuesta de los asesoramiento a este proyecto. Con el objeto de
consultados. Existen otras herramientas o clarificar el conjunto de tecnologías a emplear, se
planteamientos pero ni son open source ni están ha contado con el asesoramiento de investigadores
basados en MDA. La búsqueda de trabajos de Pros [93] y de técnicos de ProDevelop [94].
similares se inició consultando al propio Consejo En el ámbito de la infraestructura para el
Superior de Administración Electrónica [96], seguimiento de proyectos y métricas software se
emisor de la metodología que aseguró no conocer ha contado con las observaciones y críticas a las
herramienta alguna que le diera soporte y herramientas integradas por Javier González
reconocieron no haber dedicado recursos a Álvarez, arquitecto JEE de Ahead Technology
Métrica 3 desde hace más de 3 años, si bien por [95]. Finalmente, se pretende aprovechar estos
parte del CSI la última herramienta ofrecida fue resultados para hacer converger los trabajos
para la versión 2. Después de insistir se indicó futuros con la hoja de ruta de Moskitt, con el
que se consultara el mercado y a las grandes objetivo final de implantar Métrica3 y su
consultoras de software como Accentur, Indra o plataforma MDA, en la producción de software de
Everis que a día de hoy no han dado su respuesta. la Conselleria de Treball i Formació del Govern
Buscando productos en el mercado se encontraron Autònom de les Illes Balears.
diferentes consultores y cursos donde se
proponían varios conjuntos de herramientas que
intentaban dar soporte a la metodología,
básicamente con una integración en mayor o
Javier Luis Cánovas Izquierdo, Belén Cruz Zapata, Jesús García Molina
Universidad de Murcia
{jlcanovas, b.cruzzapata, jmolina}@um.es
metamodelos. Por lo que sabemos se trataría del muestra una parte de esta jerarquía y en ella se
primer motor de ejecución de SMM disponible. observa que las medidas se clasifican en dos
La organización de este documento es la categorías: las que asignan un valor numérico de
siguiente. La Sección 2 describe el metamodelo acuerdo a una unidad de medida
SMM y comenta sus principales elementos. La (DimensionalMeasure) y las que retornan un
Sección 3 presenta la sintaxis textual propuesta, símbolo que indica que la característica
mientras que la Sección 4 describe el motor de considerada tiene un valor en cierto rango
ejecución implementado. La Sección 5 muestra (Ranking).
unos ejemplos de definición de medidas con Existen varios tipos de DimensionalMeasure,
Medea, los cuales han sido utilizados en un caso como las medidas simples o de aplicación directa
de estudio real. La Sección 6 presenta el trabajo (DirectMeasure), por ejemplo la medida que
relacionado y la Sección 6 finaliza el artículo con comprueba si un elemento satisface una propiedad
las conclusiones y trabajo futuro. retornando 0 o 1 (Counting); y las medidas
compuestas que representan operaciones que
involucran a varias medidas. Hay dos tipos de
2. El metamodelo SMM medidas compuestas: las que realizan el cálculo
entre dos elementos (BinaryMeasure) y las que
son aplicadas a un conjunto de elementos
Como hemos indicado, SMM es un metamodelo
que proporciona un formato estándar para (CollectiveMeasure). RatioMeasure es una
representar tanto las métricas de software como las subclase de BinaryMeasure que representa una
mediciones con dichas métricas. Aunque se ha relación entre dos medidas bases (por ejemplo, el
definido en el contexto de ADM, SMM permite número medio de líneas por módulo) y
AdditiveMeasure y MaximalMeasure son tipos de
representar métricas de cualquier tipo referidas a
CollectiveMeasure que representan una suma de
todo tipo de artefacto software representado
mediciones y la obtención de la medición máxima,
mediante elementos de un modelo conforme a un
respectivamente. Ambos tipos de medida
metamodelo (MOF según la especificación).
compuesta especifican las medidas en las que se
basan. Así, BinaryMeasure especifica sus
operandos con las referencias baseMeasure1 y
baseMeasure2, mientras que CollectiveMeasure
utiliza la referencia baseMeasure.
Para aquellas medidas que puedan ser descritas
por su nombre, ya que son bien conocidas, como la
complejidad ciclomática de McCabe, SMM ofrece
la metaclase NamedMeasure.
Figura 1. Elementos principales de SMM
Como se observa en la Figura 2a, todas las
La Figura 1 muestra los principales elementos medidas en SMM tienen asociado el ámbito de
de SMM. Los dos conceptos principales del aplicación (scope) y la característica que se está
metamodelo son medida (measure) y medición midiendo (characteristic). El ámbito permite
(measurement). Mientras que una medida define especificar el dominio de la medida, esto es, sobre
un proceso de evaluación (esto es, una métrica), qué tipos de elementos va a aplicarse. La
una medición es el resultado de la aplicación de característica es una cadena de texto que describe
una medida. Cada medición tiene asociada (a la propiedad que se mide, por ejemplo, líneas de
través de la referencia measurand) el conjunto de código o longitud de un fichero.
elementos que han sido medidos (en nuestro caso De forma paralela a la jerarquía de medidas,
elementos de modelos Ecore). Además, las SMM incluye una jerarquía de mediciones. Esta
mediciones también tienen asociada información jerarquía permite reproducir la estructura de una
(observation) acerca del momento y la herramienta medida pero con el objetivo de representar el
que ha sido utilizada para calcularla. resultado de la medición. Por ejemplo, para las
SMM incluye una jerarquía de medidas que medidas de tipo CollectiveMeasure existe la
representan distintas formas de evaluar medición CollectiveMeasurement. La Figura 2b
características de un elemento. La Figura 2a muestra una parte de la jerarquía de mediciones.
Figura 2. Jerarquías principales de SMM. (a) Jerarquía de medidas. (b) Jerarquía de mediciones
Figura 3. Ejemplo de modelo de sintaxis abstracta en SMM extraída del documento de especificación. Las medidas
definidas cuentan el número de módulos en los modelos de código de un modelo KDM
modelos que expresen medidas SMM. De este parten de la gramática para generar el metamodelo
modo, los usuarios dispondrían de un DSL y el parser que extrae modelos de la
completo, en vez de tener que definir las medidas especificación textual, como por ejemplo xText
como instancias de los elementos de la sintaxis [4]; y ii) las que generan el parser a partir del
abstracta con algún editor. La ejecución de las metamodelo, por ejemplo TCS [5] y EMFText [6].
especificaciones de medidas expresadas con dicho Nosotros hemos usado el lenguaje Gra2MoL,
lenguaje permitiría realizar las mediciones sobre creado especialmente para extraer modelos a partir
artefactos software representados como modelos de código fuente de un lenguaje de programación
Ecore y obtener los correspondientes modelos [7, 8], ya que realmente posibilita la extracción a
SMM. A continuación presentaremos la sintaxis partir de cualquier especificación textual conforme
del DSL Medea y comentaremos el proceso de a cualquier gramática libre de contexto. Por tanto
definición de dicha sintaxis, y en la siguiente se puede ver como un tercer enfoque para crear
sección describiremos su motor de ejecución. DSLs: dado un metamodelo destino y una
Consideramos que una sintaxis concreta gramática origen se establece la correspondencia
textual sería más apropiada que una gráfica, por la entre ellos mediante una transformación cuya
naturaleza de las métricas, el tipo de usuario, y ejecución produce el modelo a partir de una
sobre todo porque según nuestra experiencia es especificación conforme a la gramática, como
conveniente comenzar antes por un DSL textual expresa el esquema de la Figura 4 para el caso de
que por uno gráfico, como también se indica en Medea y SMM.
[3].
Es importante destacar que la definición de la
sintaxis concreta textual solamente afecta a la
parte de SMM encargada de la definición de
medidas, que es la parte que debe ser definida
manualmente. La parte de SMM dedicada a la
definición de mediciones se obtiene como Figura 4. Proceso de extracción de un modelo SMM que
representa medidas
resultado de la ejecución de las medidas, por lo
que no es necesaria su especificación por parte del Gra2MoL incorpora un lenguaje de consultas
usuario. especialmente creado para resolver las referencias
Existen diversas herramientas para crear DSLs entre elementos del código fuente, lo que lo hace
textuales basados en un metamodelo, las cuales se especialmente apropiado para utilizarlo en este
pueden clasificar en dos categorías: i) las que
caso como veremos más adelante. Esta ejemplo de la Figura 3a. El símbolo inicial es
característica es una ventaja frente a smm_model y la primera producción expresa que
aproximaciones como TCS o EMFText, donde es un modelo de medidas SMM está formado por un
necesario proporcionar un mecanismo para dicha conjunto de elementos, así como que una
resolución de referencias. especificación Medea comenzará por la palabra
Una definición de transformación en clave smm_model seguida del identificador que
Gra2MoL consiste en un conjunto de reglas que denota el nombre del modelo y de la definición de
especifican las relaciones entre los elementos de la los elementos encerrada entre llaves. Según la
gramática y los elementos del metamodelo. Cada segunda producción cada elemento puede ser de
una de estas reglas expresa cómo crear un los diferentes tipos considerados en SMM
elemento del metamodelo a partir de un elemento (librería, ámbito, característica, etc.). La tercera
de la gramática como se describe en [7]. Como establece que una librería contiene cero o más
muestra la Figura 4, el motor de ejecución de medidas y se expresa con la palabra clave libraries
Gra2MoL recibiría como entrada cuatro seguida del nombre de la librería y las definiciones
elementos: (1) la gramática GMedea definida para de las medidas entre llaves. La cuarta establece
SMM, (2) el metamodelo MMSMM de la sintaxis que hay dos tipos de medidas: ranking y
abstracta de SMM, (3) la definición de la dimensional. La quinta y la sexta definen la
transformación Gra2MoL TGra2MoL y (4) la estructura de una medida dimensional que puede
especificación Medea conforme a la gramática. ser de dos tipos: directa y compuesta.
Como resultado de la transformación, se obtiene
un modelo conforme al metamodelo destino, en smm_model:
'smm_model' ID ‘{’ elements* ‘}’
este caso SMM. ;
La creación de un DSL con Gra2MoL requiere
como primer paso la definición de una gramática elements :
libraries | scopes | charac |...
en formato ANTLR. Esta gramática libre de ;
contexto permite expresar tanto la sintaxis
abstracta como la concreta. Como es bien libraries :
'library' ID ‘{’ measures+ ‘}’
conocido, metamodelos y gramáticas son dos ;
formalismos para representar la sintaxis abstracta
de un lenguaje y existen algoritmos para convertir measures :
ranking | dimensional
gramáticas en metamodelos y viceversa [9]. En ;
general, dado un metamodelo, cada clase
corresponde a un símbolo no-terminal y para cada dimensional :
'dimensionalMeasure' name=ID ‘{’
uno de ellos hay una producción o regla gramatical 'scope' sc=ID
cuya parte izquierda es dicho símbolo no-terminal ('trait'tr=ID)?
y la derecha está formada por una concatenación 'unit' un=ID
'type' type
deducida de sus atributos y asociaciones, uno por ‘}’
cada atributo y clase destino de cada asociación ;
contenedora y referencia, aunque es posible aplicar
type :
diferentes estrategias para simplificar la gramática 'direct' ‘{’ 'operation' OP }
o mejorar la legibilidad. Por ejemplo, una jerarquía | 'collective' ‘{’
de herencia puede ser representada como una 'accumulator' accumulator
'baseMeasure' bm=ID
producción con una alternativa por cada subclase, ‘}’
en la que cada alternativa está formada por el | ...
símbolo no terminal que representa a la subclase, ;
por otro lado, también pueden incluirse caracteres El ejemplo de la Figura 3a podría ser
delimitadores, como por ejemplo las llaves, para expresado en Medea del siguiente modo:
definir bloques en el texto y facilitar la legibilidad.
A continuación mostramos un fragmento de la smm_model myModel {
characteristic ModuleCount
gramática definida, el cual nos permitirá describir scope codeModel{
la estructura de una especificación Medea para el class code::CodeModel
}
Figura 6. (a) Proceso de extracción de modelos KDM a partir de código PL/SQL. (b) Uso del motor SMM para el
cálculo de métricas
characteristic imperativeCount La estrategia seguida para definir esta medida
scope CallableUnit{
class code::CallableUnit es parecida a la mostrada en el ejemplo de la
} Sección 3 para calcular el número de módulos en
scope AbstractActionRelationship { un modelo. El objetivo genérico es contar el
class action::AbstractActionRelationship
} número de elementos de un modelo que cumplen
dimensionalMeasure impCount{ una determinada condición. La forma de describir
scope CallableUnit este comportamiento en SMM es utilizando una
trait imperativeCount
unit action::AbstractActionRelationship medida compleja que sume el resultado de una
type collective { medida simple, la cual comprueba si el elemento
accumulator sum cumple la condición. De esta forma, en la
baseMeasure impCountRecognizer
} definición anterior, la medida impCount es una
} medida de tipo CollectiveMeasure que se encarga
dimensionalMeasure impCountRecognizer{ de sumar el resultado de la medida directa
scope AbstractActionRelationship
trait imperativeCount impCountRecognizer. Esta última medida aplica la
unit action::AbstractActionRelationship expresión OCL especificada para comprobar que
type direct { una sentencia es de tipo imperativa y comienza
operation
"if(self.oclIsTypeOf(action::Reads)) con el carácter ‘:’, que es el formato para
then representar variables de la interfaz gráfica.
let rVar : action::Reads =
self.oclAsType(action::Reads) in
Además, se define la característica
rVar.from-> imperativeCount que representa a las medidas, así
exists(e| e.kind <> 'select' or como los ámbitos principales, los cuales también
e.kind <> 'insert' or
e.kind <> 'update') and
serán utilizados en las siguientes medidas. El
rVar.to. primer ámbito, llamado CallableUnit, establece el
oclIsKindOf(code::StorableUnit) and elemento CallableUnit, que representa a los
rVar.to.name.substring(1, 1) = ':
else
triggers en el modelo KDM, como ámbito de la
if(self.oclIsTypeOf(action::Writes)) medida impCount. El segundo ámbito, llamado
then AbstractActionRelationship, establece el elemento
let wVar : action::Writes =
self.oclAsType(action::Writes) in
AbstractActionRelationship, que representa a las
wVar.from-> sentencias del trigger, como ámbito de la medida
exists(e| e.kind <> 'select' or impCountRecognizer.
e.kind <> 'insert' or
e.kind <> 'update') and
La segunda métrica compuesta, llamada
wVar.to. declCount, está basada en la medida directa
oclIsKindOf(code::StorableUnit) and declCountRecognizer y se encarga de contar el
wVar.to.name.substring(1, 1) = ':'
else false
número de sentencias declarativas que interactúan
endif con la interfaz gráfica en un trigger. Su definición
endif" es similar a la anterior exceptuando la expresión
}
} OCL utilizada, la cual comprueba que el atributo
kind sea igual a alguno de los valores que
identifican a una sentencia declarativa (select,
characteristic reflectiveCount
scope AbstractActionRelationship{
class action::Calls
} Figura 7. Nivel de acoplamiento de tres formularios
dimensionalMeasure refCount{ Oracle Forms en un sistema de gestión de alumnos. Cada
scope CallableUnit
trait reflectiveCount
barra indica la proporción de triggers que contiene un
unit action::ActionElement tipo concreto de acoplamiento. Un trigger puede
type collective{ contener más de un tipo de acoplamiento.
accumulator sum
baseMeasure refCountRecognizer
}
} 6. Trabajo relacionado
dimensionalMeasure refCountRecognizer{
scope AbstractActionRelationship
trait reflectiveCount En la actualidad, dada la reciente aparición de la
unit action::Calls especificación SMM, no existe un gran número de
type direct{ trabajos relacionados con este metamodelo.
operation
"self.to. Precisamente, en [11, 12] se presentan
oclIsKindOf(code::MethodUnit) and aproximaciones generativas dirigidas por modelos
(self.to.name == ‘name_in’ or para la construcción de software de cálculo de
self.to.name == ‘copy’)"
} métricas, sin embargo, no utilizan los
} metamodelos de ADM.
La definición de medida directa anterior En [13] se presenta una aproximación con el
difiere de las dos anteriores en que el ámbito es mismo propósito que Medea. En ella los modelos
AbstractActionRelationship en vez de de medidas SMM se generan a partir de reglas que
AbstractCodeElement. En este caso la medida capturan patrones de métricas expresados como
simple se encarga de comprobar si un elemento es operaciones OCL. Los diferentes tipos de medidas
de tipo Calls y llama a un método reflexivo. de un modelo SMM se derivan de las tuplas que
Las métricas fueron aplicadas al código resultan al ejecutar el código OCL de la regla y un
PL/SQL de una aplicación Oracle Forms utilizada motor de ejecución SMM produce el modelo de
como parte del Sistema de Gestión Académica de medición. La principal diferencia con nuestra
alumnos de la Universidad de Murcia. Del modelo propuesta es que no se proporciona un DSL para
de mediciones obtenido, se aplicó una expresar medidas sino que el usuario debe usar las
transformación modelo a código para obtener un reglas existentes o crear nuevas reglas. Aunque se
fichero de valores separados por comas para poder comenta la implementación de un prototipo de
representarlos gráficamente. La Figura 7 muestra motor SMM, la herramienta aún no está disponible
el nivel de acoplamiento detectado en los triggers y no hemos podido evaluarla.
de tres de los formularios de la aplicación. La MoDisco [14] forma parte del proyecto GMT
información visualizada ayuda a comprender la de Eclipse y es un framework creado para obtener
dificultad del proceso de migración para cada modelos en el contexto de modernización dirigida
formulario. Considerando el acoplamiento de la por modelos. Ofrece una implementación para el
interfaz de usuario, en este caso el formulario metamodelo KDM y actualmente acaba de
EUProjects sería más difícil de migrar que los publicar una implementación del metamodelo
otros dos, sin embargo, también debería tenerse en SMM. Sin embargo, no dispone todavía de
cuenta otros aspectos como el tamaño y herramientas para la definición o ejecución de
complejidad del código. modelos SMM.
planificaciones más exactas en lugar de depender de esta forma el modelo será contaminado con
del programador para determinar que áreas serán información poco relevante para su contexto y por
afectadas por los cambios [2]. lo tanto el uso y mantenimiento será difícil. Por
En este trabajo, se presenta una propuesta para otro lado, la segunda estrategia consiste en
verificar la consistencia entre el modelo de almacenar la información en un modelo aparte, de
requisitos y los modelos conceptuales en el esta forma se pueden corregir las desventajas
proceso de desarrollo de una aplicación Web. Para mencionadas, esto debido a que, almacenando la
lograr esto son aplicadas un conjunto de técnicas información en un modelo conforme a un
entre las que destacan los modelos weaving [5]. metamodelo con una semántica claramente
Un modelo weaving es un tipo especial de modelo definida se permite un análisis automático por
utilizado para establecer y manejar las relaciones herramientas de Ingeniería de Software de una
(links) entre los elementos de los modelos, es forma más fácil. Es importante destacar que los
decir, está formado por una (o varias) relación(es) modelos de weaving corresponden con la segunda
entre los elementos del modelo de entrada y los estrategia mencionada en este apartado.
elementos equivalentes en el modelo de salida. Continuando con esta idea, existen propuestas
La propuesta presentada en este articulo se ha que proveen una base técnica para el soporte de
realizado en el marco del método de ingeniería trazabilidad en un contexto dirigido por modelos.
Web A-OOH [10] y está alineada con MDA En [14], el autor manifiesta como modificar
(Model Driven Architecture) pero es aplicable a transformaciones especificadas en el lenguaje
otras aproximaciones de ingeniería Web. ATL para dotar de soporte para trazabilidad en el
Finalmente, proveer de soporte para trazabilidad entorno de las transformaciones entre modelos. El
en MDWE permitirá dotar al equipo de desarrollo trabajo que toma como base nuestra propuesta es
de información de gran utilidad para realizar: (i) [3], donde se presenta una extensión del
un análisis de impacto (analizar como cambiar un metamodelo base para weaving [5] con la que es
modelo podría afectar a otro modelo relacionado a posible soportar trazabilidad en transformaciones
él), (ii) sincronización entre modelos (reflejar la entre modelos aplicando modelos de weaving. En
modificación de un modelo en otro relacionado a [6], por su parte, el autor presenta una propuesta
él), (iii) depuración basada en modelos (mapear la para trazabilidad aplicando diversos lenguajes de
ejecución paso a paso de una implementación de modelado para establecer y mantener links de
nuevo a su modelo de alto nivel) así como trazabilidad semánticamente ricos entre los
determinar el objetivo de una transformación [4]. elementos de los modelos participantes en las
Este artículo está organizado de la siguiente transformaciones, incluso coincide con nuestra
manera: la sección 2 resume la aplicación de propuesta con el uso del framework i* para
modelos weaving en ingeniería Web y delimita el especificación de requisitos.
área de interés de este trabajo. En la sección 3 se Actualmente existen algunos trabajos
describe nuestra propuesta para la trazabilidad de relacionados al campo de la MDWE que
requisitos Web aplicando un running example. implementan modelos weaving para solucionar
Finalmente, la sección 4 presenta las conclusiones distintos problemas, pero ninguno de ellos se
y trabajo futuro. enfoca en resolver los problemas asociados a la
trazabilidad entre modelos conceptuales en un
2. Trabajos relacionados proceso MDA a partir de la fase de especificación
de requisitos. Sin embargo, los modelos de
weaving han sido aplicados en distintos escenarios
En el aspecto de trazabilidad, actualmente
relacionados a la ingeniería Web, por ejemplo, en
existen dos estrategias para gestionar y almacenar
las aplicaciones Web orientadas a servicios
la información necesaria para la trazabilidad entre
(SOWA), en donde se muestra como un modelo
modelos: (i) la información se puede integrar en
weaving puede ser utilizado como contenedor para
los modelos a los que se refiere y (ii) la
información extra (decisiones de diseño) en el
información de trazabilidad se puede almacenar
momento de la ejecución de la transformación de
por separado en otro modelo [6]. La primera de
un modelo [20]. Otro escenario de aplicación de
estas dos opciones tiene como desventaja que la
los modelos de weaving es en la integración de
información es almacenada en el mismo modelo,
Figura 1. Modelo de trazabilidad al derivar modelos conceptuales a partir del modelo de requisitos en A-OOH.
Como se puede observar en la figura 1, a partir especificar un modelo de requisitos (CIM) y (ii)
de un modelo de entrada (modelo de requisitos) obtener los modelos de dominio y navegación
conforme al metamodelo i* para requisitos Web (PIMs) a la par del modelo de trazabilidad
se obtienen dos modelos mediante (modelo weaving).
transformaciones en lenguaje QVT (Query View
Transform). El primero se denomina modelo de 3.1. Especificación de requisitos en un CIM
salida (puede ser un modelo de dominio o de
navegación) y el segundo corresponde al modelo El desarrollo de aplicaciones Web involucra
weaving para trazabilidad entre los modelos de diferentes tipos de stakeholders con diferentes
entrada y de salida. necesidades y metas. Interesante resulta el hecho
Para ilustrar nuestro trabajo consideramos un de que estos stakeholders dependen uno del otro
running example en el cual el escenario es el para poder lograr sus metas y realizar sus tareas.
siguiente: una compañía que se dedica a la venta En nuestra propuesta, los requisitos Web se
de libros quiere administrar la venta de libros por definen un modelo de requisitos a nivel CIM
medio de una tienda en línea y de está forma, utilizando i* [12]. El modelo de requisitos sirve
atraer la mayor cantidad de clientes como sea para especificar las necesidades del cliente-
posible. Los pasos a seguir consistirán en: (i) usuario de la aplicación, en él es modelada la
[5] Del Fabro, M., Bézivin, J. and Valduriez, P. tool. Science of Computer Programming,
Weaving Models with the Eclipse AMW 2008. 72(1-2): p. 31-39.
plugin. in Eclipse Modeling Symposium, [16] Jouault, F. and Kurtev, I. On the
Eclipse Summit Europe. 2006. Esslingen, architectural alignment of ATL and QVT. In
Germany. Proceedings of the Proceedings of the 2006
[6] Drivalos, N., Paige, R., Fernandes, K. and ACM symposium on Applied computing
Kolovos, D. Towards rigorously defined (Dijon, France, 2006). ACM.
model-to-model traceability. in Proc. 4th [17] Molina, F., Pardillo, J. and Toval, A.,
Workshop on Traceability, ECMDA’08. Modelling web-based systems requirements
2008. Berlin, Germany. using WRM. Web Information Systems
[7] Escalona, M. and Koch, N., Requirements Engineering–WISE 2008 Workshops, 2008.
engineering for Web Applications: a p. 122-131.
comparative study. Journal of Web [18] Molina, F. and Toval, A., Integrating
Engineering, 2004. 2: p. 193-212. usability requirements that can be evaluated
[8] Escalona, M. J. and Koch, N. Metamodeling in design time into Model Driven
the Requirements of Web Systems. In Engineering of Web Information Systems.
Proceedings of the Web Information Advances in Engineering Software, 2009.
Systems and Technologies (Setubal, 40(12): p. 1306-1317.
Portugal, 2006). Lecture Notes in Business [19] Nicolás, J. and Toval, A., On the generation
Information Processing. of requirements specifications from software
[9] France, R. and Rumpe, B. Model-driven engineering models: A systematic literature
Development of Complex Software: A review. Information and Software
Research Roadmap. In Proceedings of the Technologies, 2009. 51(9): p. 1291-1307.
29th Int. Conference on Software [20] Vara, J., De Castro, M., Del Fabro, M. and
Engineering (ICSE) (Minneapolis, USA, Marcos, E. Using Weaving Models to
2007). IEEE. automate Model-Driven Web Engineering
[10] Garrigós, I.; A-OOH: Extending Web proposals. in Workshop of XIII Jornadas de
Application Design with Dynamic Ingeniería del Software y Bases de Datos
Personalization. 2008.PhD. Dept. Software (JISBD). 2008. Gijon, Spain.
and Computing Systems. University of [21] Yu, E.; Modelling strategic relationships for
Alicante. Alicante, Spain. process reengineering. 1995.PhD.
[11] Garrigós, I. and Gómez, J. Modeling user University of Toronto. Toronto, Canada.
behaviour aware websites with PRML. in [22] Yu, E. Towards modelling and reasoning
Web Information Systems Modeling support for early-phaserequirements
(WISM). 2006. Luxemburg, Germany. engineering. in Requirements Engineering
[12] Garrigós, I., Mazón, J.-N. and Trujillo, J. A (RE). 1997. Washington D.C., USA.
Requirement Analysis Approach for Using
i* in Web Engineering. In Proceedings of
the 9th International Conference on Web
Engineering (San Sebastian, Spain, 2009).
[13] Gotel, O. C. and Finkelstein, C. W. An
analysis of the requirements traceability
problem. in Proceedings of the First
International Conference on Requirements
Engineering. 1994.
[14] Jouault, F. Loosely coupled traceability for
atl. in European Conference on Model
Driven Architecture (ECMDA) workshop
on traceability. 2005. Nuremberg, Germany.
[15] Jouault, F., Allilaire, F., Bézivin, J. and
Kurtev, I., ATL: A model transformation