![Page 1: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/1.jpg)
Mining Metamodels From Instance Models: The MARS System
Faizan JavedDepartment of Computer & Information Sciences, University of Alabama at Birmingham
The Fourth Annual Southeastern Software Engineering Conference (SE)2
30th March 2005
![Page 2: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/2.jpg)
Motivation
Software artifacts like models and source code conform to a schema, and are stored in a repository.
Evolution of schema might be required to address new feature requests.
Repository artifacts might become obsolete if not transformed to conform to new schema.
Example: Java SDK – new versions restructure or rename API’s.
![Page 3: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/3.jpg)
Domain-Specific Modeling (DSM)
Raises level of abstraction, while narrowing design space to single domain of discourse.
Allows construction of models which follow domain abstractions and semantics allowing developers to work with domain concepts.
Metamodel: Defines key elements of domain.
Models: Defines specific configurations of the domain.
![Page 4: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/4.jpg)
DSM modeling with GME
GME: Generic Modeling Environment Metamodel: Networking
![Page 5: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/5.jpg)
DSM Modeling with GME
Model: CompanyA
![Page 6: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/6.jpg)
Challenges of Mining Domain Instance Models
Metamodel drift: inability to load models due to changes to metamodel.
Solution: Infer metamodel from instance models !
Grammar Inference community has done extensive work on similar problem, albeit for programming language domain.
![Page 7: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/7.jpg)
Challenges of Mining Domain Instance Models
Idea: Apply grammar inference techniques to the metamodel inference problem.
Problem: Modeling tools export XML files; mismatch in representation expected by grammar inference techniques.
Solution: Translate XML to textual DSL (Domain-Specific Language) !
![Page 8: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/8.jpg)
Tools Used in the Project
GME: Metamodel described with UML class diagrams, and constraints with OCL.
LISA: An interactive environment where users can specify, generate, compile, and execute programs in a newly specified language.
DMS: A program transformation system and re-engineering toolkit.
![Page 9: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/9.jpg)
Overview of the MARS system
![Page 10: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/10.jpg)
From GME models to MRL (Model Representation Language)
…….model NetDiagram {
WSGroup ; Perimeter ;
Host ; Network ;
WSGroup ; Host ;
Router ; fields;
connections Connection : Port -> Network ; Connection : Host -> Network ; Connection : Port -> Perimeter ;
Connection : WSGroup -> Network ; Connection : WSGroup -> Network ;
Connection : Host -> Network ; }
………..
XSLT
![Page 11: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/11.jpg)
From MRL to Inferred Metamodel
…….model NetDiagram {
WSGroup ; Perimeter ;
Host ; Network ;
WSGroup ; Host ;
Router ; fields;
connections Connection : Port -> Network ; Connection : Host -> Network ; Connection : Port -> Perimeter ;
Connection : WSGroup -> Network ;
Connection : WSGroup -> Network ;
Connection : Host -> Network ; }
………..
LISA+DMS
![Page 12: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/12.jpg)
Inferred vs. Original Metamodel
![Page 13: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/13.jpg)
Limitations and Observations
Generalization hierarchy can’t be inferred resulting in more elements in inferred metamodel.
Domain-Specific Visualization: graphic assigned to metamodel entities cant be inferred.
OCL Constraints: capture domain semantics that cant be captured with static diagrams. They are not explicitly indicated in domain models.
![Page 14: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/14.jpg)
Related Work
The XTRACT System:1) Infers DTD from XML documents2) Derives a regular expression for each element in the XML document.3) Uses the Minimum Description Length (MDL) principle to choose the best DTD from a set of candidate DTDs
o ECFG Based System (Chidlovskii):1) Represents XML documents as structured examples of an unknown ECFG.2) Uses existing grammar inference techniques to infer the ECFG.
![Page 15: Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham](https://reader036.vdocument.in/reader036/viewer/2022062715/56649d805503460f94a63d67/html5/thumbnails/15.jpg)
For more information:
Project Website:
http://www.cis.uab.edu/softcom/GenParse/mars.htm