Quality assessment of xtend model transformations
Download
1 / 42

Quality Assessment of Xtend Model Transformations - PowerPoint PPT Presentation


  • 71 Views
  • Uploaded on

Quality Assessment of Xtend Model Transformations. Phu H. Nguyen, [email protected] Supervisor: Prof. dr. Mark van den Brand Tutor: Ir. Marcel van Amstel. Agenda. Introduction Project goal Overview of Xtend model transformations Metrics

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Quality Assessment of Xtend Model Transformations ' - hasad-bryan


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Quality assessment of xtend model transformations

Quality Assessment ofXtend Model Transformations

Phu H. Nguyen, [email protected]

Supervisor: Prof. dr. Mark van den Brand

Tutor: Ir. Marcel van Amstel


Agenda
Agenda

Introduction

Project goal

Overview of Xtend model transformations

Metrics

How to extract data from Xtend model transformations

Tools

Case studies

Conclusions

/ Department of Mathematics and Computer Science


Introduction
Introduction

  • Model Driven Software Development (MDSD): the next level of software development

    • High level design models at the heart of the development process

    • Software development automation

    • Benefits : Productivity, agility, reliability

  • MDSD world:

    • Domain-specific languages (DSL)

    • Model transformations M2M (Model-to-Model)

    • Model transformations M2T (Model-to-Text)

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 2



M2m transform models to models
M2M : Transform models to models

ATL - the Atlas Transformation Language

QVT (Operational) - An implementation of OMG’s spec.

Xtend – openArchitechtureWare (oAW) ’s transformation language (also used for other tasks within oAW)

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 4


Model transformations m2m
Model transformations M2M

  • Is there a methodology for developing model transformations with high quality?

  • Need of assessing the quality of model transformations

  • Quality assessment of model transformations:

    • ASF+SDF: enabled

    • ATL: enabled

    • QVT: ?

    • Xtend: ?

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 5


Project goal
Project goal

The main goal is to enable quality assessment for Xtend model transformations by means of metrics.

Approach: assessing the internal quality of model transformations by extracting metrics from the model transformations directly.

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 6


Sub goals
Sub-goals

  • Four sub-goals:

    • Discover the details behind Xtend model transformations.

    • Establish a metrics suite enables quality measurement of Xtend model transformations.

    • Develop a tool that enables automatic calculation of those metrics.

    • Perform case studies to validate the results.

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 7


Oaw xtend model transformations
oAW & Xtend model transformations

An integrated, tested, one-stop toolkit for MDSD

oAW essentially makes it possible to process code generators for any type of model.

Any type of source code can be generated from the model sources.

/ Department of Mathematics and Computer Science


Features of oaw
Features of oAW

  • The most important features of oAW include:

    • support of various modeling tools

    • support of EMF (Eclipse Modeling Framework)

    • model-to-model transformations

    • model-to-code-transformations

    • eclipse integration

  • Migrated to Eclipse:

    • http://www.eclipse.org/workinggroups/oaw/

      • Xpand/Xtend/Check

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 9


Oaw components
oAW components

Metamodel definition: EMF, UML model

Graphical model editor: Eclipse GMF

Textual model editor: Xtext

Model transformation: Xtend

Model validation: Check

Code generation: Xpand

Metamodel extension: Xtext

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 10



Xtend
Xtend

  • OCL-like expression language used throughout oAW

  • Can be used in constraint checks, model transformations and generators

  • Add “methods” to meta types (Java calls are possible if necessary)

  • path expressions, set operations, (some) higher order functions

  • Polymorphism (multiple dispatch)

  • Tool support(syntax highlighting, code completion, debugger)


Xtend model transformations
Xtend model transformations…

… are defined in extension files (*.ext):

  • Import statements

    • Import name spaces (meta-models)

    • Import (reexport) built-in libraries or another extend files

  • Create extensions

  • Expression extensions

  • Java extensions

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 13


Xtend model transformations1
Xtend model transformations

Xtend has some special support for M2M transformations

  • Create-Extensions are used to create a new instance

    • A new element is created only once for the same set of parameters

  • Cached Extension can be used for perfomence improvements

    • The same value is returned each time the extension is called with the same set of parameters

  • Several utility extensions (built-in libraries) for naming, tracing, debugging, cloning, …

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 14


Book → Publication

  • Rules to transform a Book model to a Publication model:

    • Each Book instance → a Publication instance

    • The title of a Book → the title of a Publication

    • The total number of pages of a Publication is the sum of the pages of the Chapters of a Book.

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 15


Book publication
Book → Publication

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 16


Book publication extension file
Book → Publication: Extension File

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 17


Metrics for xtend model transformations
Metrics for Xtend model transformations

  • A set of metrics has been proposed for enabling quality assessment of Xtend model transformations

  • These metrics are specific for Xtend

  • Metric categories:

    • Extension metrics

    • Dependency metrics

    • Other metrics

  • Two types of metric:

    • Metrics that are measured over the entire transformation

    • Metrics that are measured on a smaller scale (per extension file, per extension…

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 18


Metrics for xtend model transformations1
Metrics for Xtend model transformations

Extension metrics

  • # Extensions

    • # Create/Expression/Java Extensions

    • # Private/Public/Cached Extensions

  • # Extensions per Extension File

  • # Extensions with Parameter

  • # Overloaded Extensions

  • # Parameters per Extension

  • # Unused Parameters per Extension

  • Cyclomatic Complexity per Extension

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 19


Metrics for xtend model transformations2
Metrics for Xtend model transformations

Dependency metrics

  • # Imported Standard Libraries per Extension File

  • # Imported Extension Files per Extension File

  • # Calls to Extensions in Standard Libraries per Extension

  • # Extension Calls per Extension

    • # Internal Extension Calls per Extension

    • # External Extension Calls per Extension

  • # Usages per Extension

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 20


Metrics for xtend model transformations3
Metrics for Xtend model transformations

Other metrics

  • # Extension Files

  • # Imported Namespaces (Metamodels) per Extension File

  • # Arounds

  • # Checks

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 21


How the XtendParser works

The XtendParser constructs an Abstract Syntax Tree while parsing an Xtend file.

The transformation functions after parsing *.ext files are represented as an in-memory model consisting of POJO’s (Plain Old Java Objects).

The basic type is org.eclipse.internal.xtend.expression.ast.SyntaxElement

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 22



Metric extractor tools
Metric Extractor Tools

  • Design requirements

    • Input: Extension files

    • Output: Metrics

      • New metrics can be defined easily

      • It is possible to quickly implement the calculation of a new metric


Metric extractor tools1
Metric Extractor Tools

  • In order to calculate the metrics, we need to extract data from the Xtend AST(s) to store in a well defined data model

    • “data” means all elements of Xtend model transformations

    • A well defined data model = data can be stored easily and metrics can be calculated easily.


Metric extractor tools2
Metric Extractor Tools

  • Which data model?

    • Relational data model: No

    • Java Objects

      • Store data easily: The Xtend AST consists of Java Objects

      • Easily implementing metrics calculation in Java

    • XML

      • Store data of the Xtend AST in XML

      • Easily calculating metrics by using Xpath, Xquery


Metric extractor tool 1 m2m qa
Metric Extractor Tool 1 – M2M QA

  • Data model = Java Objects






Gui for m2m qa
GUI for M2M QA

Implement GUI, as a jar file

Implement as an Eclipse plugin

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 32


Metric extractor tool 2
Metric Extractor Tool 2

  • Data model = XML

  • Native XML database eXist

  • XPath and XQuery are used for querying the XML data

  • GUI: A web application

    • Java, JavaBeans, JSP/Servlet and Java Server Faces.

    • Apache HTTP server Apache Tomcat 7.0.

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 33



DTD

<!ELEMENTxtendPrj (extendFile*)>

<!ATTLISTxtendPrj prjName CDATA#REQUIRED>

<!ATTLISTxtendPrj prjDir CDATA#REQUIRED>

<!ATTLISTxtendPrj rootExtFile CDATA#REQUIRED>

<!ELEMENTextendFile (importedNamespaces|importedExtFiles|extensions|arounds|checks)*>

<!ATTLISTextendFile extFileName CDATA#REQUIRED>

<!ELEMENT importedNamespaces (namespace*)>

<!ELEMENT namespace(#PCDATA)>

<!ELEMENT importedExtFiles (extFileName*)>

<!ELEMENT extFileName(#PCDATA)>

<!ATTLIST extFileName reexported CDATA#REQUIRED>

<!ELEMENT extensions (extension*)>

<!ELEMENT extension (extName|qualifiedName|parameters|returnType|extBody)*>

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 35


XML

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE xtendPrj SYSTEM "xtendPrj.dtd">

<xtendPrj prjName="" prjDir="../my.slco.project/src/" rootExtFile="../my.slco.project/src/slco2nqx/Bi2Uni.ext">

<extendFile extFileName="../my.slco.project/src/slco2nqx/Bi2Uni.ext">

<importedNamespaces>

<namespace>slco</namespace>

<namespace>channels</namespace>

</importedNamespaces>

<importedExtFiles>

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 36


Xpath xquery
Xpath, XQuery

# Extensions per Extension File: This metric counts the number of extensions per extension file.

element { "result" }

{

for $extFile in doc("xtendM2M/Bi2Uni.xml")//extendFile

return

element { "extCountPerExtFile" }

{

count(for $ext in $extFile//extension

return $ext)

}

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 37


M2m qa web application
M2M QA Web Application

Upload (zipped) extend files of an Xtend project

Browse data

Metrics calculation

Search

Download reports

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 38


M2m qa web application1
M2M QA Web Application

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 39


Summary
Summary

A set of metrics has been established to enabling quality assessment of Xtend model transformations

Extension file(s) are parsed by the XtendParser to get the corresponding AST(s)

2 types of data model => 2 tools

All the metrics can be automatically calculated by these two tools

The results extracted from both tools are the same

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 40


The end
The end.

/ Department of Mathematics and Computer Science

1-9-2010

PAGE 41


ad