MTBD: Model Transformation By Demonstration



Model transformations provide a powerful capability to automate model refinements. However, the use of model transformation languages may present challenges to those who are unfamiliar with a specific transformation language. We propose an approach called model transformation by demonstration (MTBD), which allows an end-user to demonstrate the exact transformation desired by actually editing a source model and demonstrating the changes that evolve to a target model. An inference engine built into the underlying modeling tool records all editing operations and infers a transformation pattern, which can be reused in other models.

MT-Scribe is an Eclipse plug-in to GEMS (Generic Eclipse Modeling System), which implements MTBD idea.

Keywords

Model-Driven Engineering, Model Transformation, GEMS, MT-Scribe

Overview

The MTBD process consists of five main steps.

1) User demonstration and operations recording. The demonstration is given by directly editing a model instance (e.g., add a new model element or connection, modify the attribute of a model element) to simulate a transformation task. A listener has been developed to monitor and capture all the operations occurring in the model editor.

2) Optimize recorded operations. Users may perform meaningless operations such as, first add a new element and modify its attributes, and then delete it in another operation, the result being that all the operations regarding this element actually did not take effect in the transformation process. This step is to eliminate all those meaningless operations.

3) Infer the transformation pattern. Based on the operations recorded, a transformation pattern is inferred, which describes the precondition of a transformation (i.e., where the transformation should be performed), and the actions of a transformation (i.e., how the transformation should be realized).

4) Precondition matching. By selecting a pattern from the repository, the MTBD engine automatically traverses the model instance to search all locations that match the selected pattern. A notification is given if no matching locations are found.

5) Replay operations and correctness checking. When a matching location is found, the recorded operations will be replayed to transform the current model instance. Model instance correctness checking is performed after every operation execution to guarantee that the replayed operation does not cause the violation of metamodel definitions.

 
Overview of MTBD

Case Studies

The first case study is implemented in the MazeGame domain.  a maze consists of rooms, which can be connected with each other. Each room can contain gold, a weapon or a monster with the powerValue attribute to specify the power. This domain is used to generate a textual game in Java, enabling players to type textual command to move in the maze and collect all the gold without being killed by monsters. A model instance describes a specific maze configuration. Collecting weapons during game-play increases a player’s power, which can be used to kill monsters.

MazeGame Metamodel

The second case study focuses on traditional UML refactoring. We will show how to use MT-Scribe to realize ExtractSuperClass refactoring.

 

Video Demos

Video 1:
The following video demonstrates the MazeGame metamodel and a transformation case - for those rooms that contain gold and a weapon, remove one gold piece, replace the weapon with a monster, and set the powerValue of the new monster to be half of the powerValue of the weapon being replaced.

Video 2:
The following video demonstrates another transformation case - for those three rooms in a row, if each contain a monster, then replace the monster in the third room with a weapon, and the powerValue of the weapon defined as the sum of the monsters in the first two rooms. In addition, reconnect the rooms so that the first monster room connects to the third weapon room, which then connects to the second monster room.

Video 3:

The following video demonstrates the ExtractSuperClass UML refactoring.

If you have any problems with these videos, or would like to see them in a different video format, please write to me

Publications

  1. Yu Sun, Jules White, Jeff Gray, Aniruddha Gokhale, Douglas C. Schmidt, "Model-Driven Automated Error Recovery in Cloud Computing," Model-driven Analysis and Software Development: Architectures and Functions, edited by Janis Osis and Erika Asnina, IGI Global, Hershey, PA, USA 2009 (Under review)

  2. Yu Sun, Jules White, and Jeff Gray, "Model Transformation by Demonstration," International Conference on Model Driven Engineering Languages and Systems (MoDELS), Spring-Verlag LNCS 5795, Denver, CO, October 2009, pp. 712-726. (18% Acceptance Rate)

  3. Yu Sun, Jules White, and Jeff Gray, "MT-Scribe: A Tool for Recording and Inferring Model Transformations," Tool Demonstration, International Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), Orlando, FL, October 2009.

  4. Yu Sun, "Supporting Model Evolution through Demonstration-based Model Transformation," Students Research Competition, International Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), Orlando, FL, October 2009.

Events

  1. Yu Sun, Jules White, and Jeff Gray presented two Tool Demonstration sessions (Session 1 and 2) in OOPSLA 2009, Orlando, FL. (Oct. 27 - 28, 2009)

  2. Yu Sun got to the top 5 finalist in ACM SIGPLAN Student Research Competition in OOPSLA 2009, Orlando, FL. (Oct. 28, 2009)

  3. Yu Sun got the 3rd place in 2009 ACM Mid-Southeast Conference Student Paper Competition, Gatlingburg, TN (Nov. 13, 2009)

People

Yu Sun. A Ph.D. candidate in the Department of Computer and Information Sciences at the University of Alabama at Birmingham (UAB) and member of the SoftCom Laboratory. His research interests include domain-specific modeling, domain-specific languages and model transformation techniques. He received his BS in Computer Science from Zhengzhou University, China and MS in Computer Science from  UAB.

Dr. Jules White. A Research Assistant Professor at Vanderbilt University’s Institute for Software Integrated systems. He received his BA in Computer Science from Brown University, his MS in Computer Science from Vanderbilt University, and his Ph.D. in Computer Science from Vanderbilt University. Dr. White’s research focuses on applying a combination of model-driven engineering and constraint-based optimization techniques to the deployment and configuration of complex software systems. Dr. White is the project leader for the Generic Eclipse Modeling System (GEMS), an Eclipse Foundation project.

Dr. Jeff Gray. An Associate Professor in the Computer and Information Sciences Department at UAB, where he co-directs research in the SoftCom Laboratory. His research interests include model-driven engineering, aspect orientation, code clones, and generative programming. Jeff received a Ph.D. in Computer Science from Vanderbilt University and both the BS and MS in Computer Science from West Virginia University. He is a member of the ACM and a Senior Member of the IEEE.

Acknowledgement

This work is supported in part by an NSF CAREER award (CCF-0643725).

Contact Us

123B Campbell Hall, 1300 University Blvd.
Birmingham, AL 35294

Email: yusun@cis.uab.edu

Tel: 205-934-5841

@Copyright 2009 - All Rights Reserved

Disclaimer for official UAB web pages