<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Solving the Movie Database Case with QVTo</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Christopher</forename><surname>Gerking</surname></persName>
							<email>christopher.gerking@uni-paderborn.de</email>
						</author>
						<author>
							<persName><forename type="first">Christian</forename><surname>Heinzemann</surname></persName>
							<email>christian.heinzemann@ipt.fraunhofer.de</email>
						</author>
						<author>
							<persName><forename type="first">Fraunhofer</forename><surname>Ipt</surname></persName>
						</author>
						<author>
							<affiliation key="aff0">
								<orgName type="laboratory">Software Engineering Group</orgName>
								<orgName type="institution">Heinz Nixdorf Institute</orgName>
							</affiliation>
						</author>
						<author>
							<affiliation key="aff1">
								<orgName type="institution">University of Paderborn</orgName>
								<address>
									<country key="DE">Germany</country>
								</address>
							</affiliation>
						</author>
						<author>
							<affiliation key="aff2">
								<orgName type="laboratory">Project Group Mechatronic Systems Design</orgName>
								<orgName type="institution">Software Engineering</orgName>
								<address>
									<settlement>Paderborn</settlement>
									<country key="DE">Germany</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Solving the Movie Database Case with QVTo</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">C716023ECCC5B56FB35151AADBD07667</idno>
					<note type="submission">Submitted to: TTC 2014</note>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T04:49+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>This paper proposes a solution to the IMDb movie database case of the Transformation Tool Contest 2014. Our solution is based on the Eclipse implementation of the OMG standard QVTo. We implemented all of the tasks including all of the extension tasks. Our benchmark results show that QVTo is able to handle models with a few thousand objects.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>This paper proposes a solution to the movie database case <ref type="bibr" target="#b2">[3]</ref> of the Transformation Tool Contest 2014. The objective of the movie database case is to derive a set of performance results that indicate the ability of model transformation languages to process large models with millions of objects. The case study is based on the IMDb movie database that stores information about movies, actors, actresses, and ratings.</p><p>We use QVT Operational Mappings (QVTo, <ref type="bibr" target="#b3">[4]</ref>) for solving the different tasks of the movie database case. QVTo is a textual, imperative model transformation language based on OCL <ref type="bibr" target="#b5">[5]</ref> that is standardized by the OMG. It natively supports metamodels specified in EMF <ref type="bibr" target="#b6">[6]</ref> such as the provided IMDb metamodel. In this paper, we use the QVTo implementation of the Eclipse Model to Model Transformation (MMT) project <ref type="foot" target="#foot_0">1</ref> .</p><p>The Eclipse implementation of the QVTo standard is open source and already widely used in other open-source and academical projects. It is used, for example, within the Graphical Modeling Framework (GMF <ref type="foot" target="#foot_1">2</ref> ) and in the Papyrus project <ref type="foot" target="#foot_2">3</ref> . Recently, it has been used for translating software design models to verification models <ref type="bibr" target="#b0">[1]</ref> and for generating operational behavior specifications out of declarative ones <ref type="bibr" target="#b1">[2]</ref>.</p><p>In our implementation, we created seven transformations for solving the different tasks of the movie database case. We implemented the three main tasks and all of the extension tasks. Our implementation demonstrates that QVTo enables a concise specification of the solutions. Four out of seven tasks require less than 30 lines of code. Our benchmark results show that the Eclipse implementation of QVTo is currently able to handle input models with a few thousand objects in a reasonable amount of time.</p><p>The paper is structured as follows. We first briefly review the movie database case in Section 2 and QVTo in Section 3. Thereafter, Section 4 describes our solution that we implemented in QVTo. We provide benchmark results concerning runtime of our transformations in Section 5 before concluding the paper in Section 6.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">The Movie Database Case</head><p>The movie database case is based on a simple metamodel for storing movies and the actors who played in these movies <ref type="bibr" target="#b2">[3]</ref>. Therefore, it provides the classes Movie, Actor, and Actress. In addition, the metamodel comprises classes to represent a Couple or Clique. A clique consists of n persons that played together in at least 3 movies while n ≥ 2. A couple is a clique with n = 2, i.e., two persons who played together in at least 3 movies.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">QVT Operational Mappings</head><p>QVT Operational Mappings (QVTo, <ref type="bibr" target="#b3">[4]</ref>) is a textual, imperative language for defining unidirectional model-to-model transformations. The current Eclipse implementation of QVTo natively supports the specification of model transformations based on EMF metamodels. Since QVTo is an imperative extension of OCL <ref type="bibr" target="#b5">[5]</ref>, the Eclipse implementation also provides access to numerous OCL operations that enable to build collections (e.g., sets) of objects.</p><p>A QVTo transformation refers to one or more input metamodels and one or more output metamodels. Then, a transformation run transforms instances of the input metamodels to instances of the output metamodels. QVTo also enables inplace transformations where one and the same model instance acts as both input and output, enabling model modifications as required for the movie database case. Each transformation has a name and a unique entry point denoted by main(). Using so called configuration properties, QVTo supports the parametrization of transformations by means of primitive data types.</p><p>In our implementation, we use mappings, helpers, and constructors. A mapping translates an object of an input model to an object of an output model. A helper may be used to perform auxiliary computations but also for creating additional objects in the output model. Finally, constructors enable the parametrized instantiation of classes which are part of the output metamodel.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Solution</head><p>In the following, we present our solutions to the tasks that were given as part of the IMDb movie database case. For each of the tasks, we provide a QVTo model transformation operating on concrete instances of the IMDb metamodel. Our overall design goal is to keep the solutions concise with respect to the transformation size. Thus, we prefer using high-level native language features provided by QVTo, avoiding more complex manual implementations by means of low-level constructs whenever possible.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1">Generating Test Data</head><p>For the generation of test data, we developed a QVTo transformation with a single IMDb output model. In addition, we declare a transformation parameter N using a QVTo configuration property such that the resulting amount of test data may be configured along with the invocation of the transformation.</p><p>The implementation of our transformation reflects the structure of the given Henshin specification <ref type="bibr" target="#b2">[3]</ref> in terms of imperative operation calls. Thus, the given Henshin units correspond to dedicated helper operations parametrized by means of integer values. The actual instantiation takes places inside dedicated constructor operations for the types Movie, Actor, and Actress.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2">Finding Couples</head><p>The solution for this task is based on an inplace transformation that accepts an existing IMDb input model and will output the same model after manipulating it. The required manipulation for this task is the addition of Couple elements as defined in Section 2. In order to detect the set of couples, our approach is to traverse all pairs of persons. We achieve this by iterating over the set of persons using an imperative forEach loop with two iterator variables. During the iteration, we create a Couple element for every unique pair that is a valid couple: In order to achieve uniqueness, we must not create a new Couple if an existing one already refers to the same two persons (regardless of their order). Therefore, we use an operational mapping operation to generate a Couple for every valid and unique input pair. The mapping is declared as follows: An operational mapping is an imperative operation that behaves according to a partial mathematical function, i.e., maps each input to at most one output. Thus, the first invocation of a mapping with a certain input will potentially create the appropriate result. However, reinvoking the mapping with an equal input will not produce another result, but return the cached result of the prior invocation. To exploit this mapping behavior for the creation of unique couples, we represent input pairs using the OCL Set type. The equality behavior of this built-in collection type ensures that two pairs compare equal if they refer to the same persons regardless of their ordering.</p><p>In order to not generate any invalid couples, we check the validity inside a when clause of the createCouple mapping. This causes a mapping invocation to be skipped whenever the input Set is not a pair or has less than three common movies.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3">Computing Average Rankings</head><p>Task 3 and Extension Task 3 of the IMDb movie database case require to compute the average rankings for couples or cliques. Our solution to this challenge is based on a QVTo inplace transformation. We traverse the set of groups inside the given IMDb model by means of an imperative forEach loop. During each iteration, we compute the average rating for one of the detected groups. To obtain the sum of ratings for the common movies, we use the sum operation defined for OCL collections. We compute the arithmetic mean by simply dividing the sum of ratings by the number of movies: c o u p l e . a v g R a t i n g : = c o u p l e . commonMovies . r a t i n g −&gt;sum ( ) / c o u p l e . commonMovies−&gt;s i z e ( ) ;</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.4">Computing the Top-15 Groups</head><p>Extension Task 1 and 4 require to query information from the given IMDb model. In particular, the challenge is to query the top-15 couples/cliques according to their average ratings and their number of common movies. Hence, our QVTo-based solutions declare only input and no output models.</p><p>In order to obtain the top-15, we sort all existing groups as required. Whereas this approach constitutes a computational overhead since only the top-15 is of interest, it allows for a concise solution. By using the predefined sortedBy operation for OCL collections, we avoid more complex manual implementations. The listing below illustrates the sorting of couples by average rating. Based on the sorted sequence of couples or cliques, we iterate over the first 15 elements and print out the desired information about each group using QVTo's log operation. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.5">Finding Cliques</head><p>Our solution to Extension Task 2 comprises a QVTo configuration property that represents the desired size n of the cliques to be obtained. The major challenge in comparison to Task 2 is to retrieve all candidate sets consisting of n persons in order to check each of these sets for being a valid clique. Since n is not fixed to a certain value (such as n=2 for Task 2), it is not possible to solve this problem using a fixed number of iterator variables as described in Section 4.2. Instead, we construct the candidate sets explicitly inside a helper operation. The signature below illustrates that the operation accepts a set of persons and returns all candidate subsets for cliques: The implementation of the candidates operation is based on an incremental approach. Starting with an empty set of persons, we iterate over every given person and create new sets by adding the current person to each of the sets already created before.</p><p>In order to save runtime, we evaluate the validity of any constructed set on the fly. This means that we discard a constructed set if the number of common movies goes below three, because no valid extension to a clique with three or more common movies exists. In addition, our solution does not construct sets with more than n persons, which would be an evitable overhead. After constructing all clique candidates, we map each valid candidate set to an appropriate Clique instance similar to our solution for Task 2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Evaluation and Benchmarks</head><p>In our evaluation, we particularly focus on the relationship between code conciseness and runtime performance for QVTo. Table <ref type="table" target="#tab_0">1</ref> summarizes the measured runtime for the transformations from invocation to termination, as well as the transformation size in terms of the underlying source lines of code (SLOC). The performance testing was carried out on a quad-core 2,2 GHz machine with 8 GB of main memory running the 3.4.0 release version of Eclipse QVTo. Our measurements are based on the parameter values N ∈ {50, 100, 150, 200, 250, 300, 350, 400} for the size of the synthetic test data. For each N, Table <ref type="table" target="#tab_0">1</ref> also shows the resulting number of model elements generated in Task 1. Our measurements are based on the size n = 3 for the cliques to be detected in Extension Task 2. Table <ref type="table" target="#tab_0">1</ref> indicates a superlinear increase for the runtime of complex challenges such as Task 2 or Extension Task 2. Consequently, QVTo is not able to provide an acceptable transformation runtime for realistic models based on the IMDb movie database. Thus, the conciseness enabled by QVTo (reflected by the small number of source code lines) is obviously out of proportion to the measured runtime.</p><p>The detected performance limitations are traceable to QVTo's missing native support for the construction of powersets (which is required to generate all candidate sets for couples or cliques). In contrast to QVTo as an imperative language, declarative approaches might achieve considerable runtime improvements by obtaining all possible subsets using nondeterministic matching techniques. Furthermore, QVTo as a dedicated model transformation language does not provide a broader scope of actions when it comes to performance tweaks. In contrast, using general-purpose languages (such as Java) gives rise to specific implementational variations that could drastically improve the performance.</p><p>Nevertheless, focusing on the small number of source code lines illustrated in Table <ref type="table" target="#tab_0">1</ref>, our evaluation shows that QVTo enables a concise specification of the transformations for all tasks. Thus, despite the detected performance drawbacks, we regard our major design goal as reached.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Conclusions</head><p>This paper presents a solution to the movie database case of the Transformation Tool Contest 2014 based on the Eclipse implementation of QVTo. Our results show that QVTo enables for a concise specification of transformations. However, QVTo is only able to handle synthetic test models with a few thousand objects in a reasonable amount of time but not realistic models based on the IMDb movie database.</p><p>Our benchmark results indicate two promising directions for future works. First, realizing parts of a QVTo transformation inside a Java blackbox <ref type="bibr" target="#b3">[4]</ref> is an option to integrate more efficient implementations. We excluded blackboxes in order to keep the focus on plain model-to-model transformations. Second, the QVT/OCL specifications <ref type="bibr" target="#b3">[4,</ref><ref type="bibr" target="#b5">5]</ref> could be extended by missing operations such as computing a power set for Extension Task 2. A promising approach in that direction is the implementation of an extensible standard library for OCL <ref type="bibr" target="#b7">[7]</ref>. However, such library extensions are only useful if the additional operations are equipped with an efficient implementation or further improve the code conciseness.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head></head><label></label><figDesc>p e r s o n s −&gt;forEach ( p1 , p2 ) { S e t {p1 , p2}−&gt;map c r e a t e C o u p l e ( ) ; } ;</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head></head><label></label><figDesc>mapping S e t ( P e r s o n ) : : c r e a t e C o u p l e ( ) : C o u p l e when { s e l f −&gt;i s V a l i d C o u p l e ( ) }</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head></head><label></label><figDesc>var s o r t e d = c o u p l e s −&gt;s o r t e d B y (− a v g R a t i n g ) ;</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head></head><label></label><figDesc>h e l p e r S e t ( P e r s o n ) : : c a n d i d a t e s ( ) : S e t ( S e t ( P e r s o n ) )</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head>Table 1 :</head><label>1</label><figDesc>Evaluation of Conciseness and Performance</figDesc><table><row><cell></cell><cell></cell><cell></cell><cell></cell><cell cols="2">Runtime</cell><cell></cell><cell></cell><cell></cell><cell></cell></row><row><cell>N</cell><cell>50</cell><cell>100</cell><cell>150</cell><cell>200</cell><cell>250</cell><cell>300</cell><cell>350</cell><cell>400</cell><cell>SLOC</cell></row><row><cell># Elements</cell><cell cols="2">1000 2000</cell><cell>3000</cell><cell>4000</cell><cell>5000</cell><cell>6000</cell><cell>7000</cell><cell>8000</cell><cell></cell></row><row><cell>Task 1</cell><cell>2.2s</cell><cell>0.1s</cell><cell>0.2s</cell><cell>0.2s</cell><cell>0.2s</cell><cell>0.3s</cell><cell>0.3s</cell><cell>0.4s</cell><cell>59</cell></row><row><cell>Task 2</cell><cell cols="3">4.3s 15.2s 36.6s</cell><cell>63.3s</cell><cell cols="4">93.9s 134.1s 179.2s 234.7s</cell><cell>24</cell></row><row><cell>Task 3</cell><cell>0.3s</cell><cell>0.1s</cell><cell>0.2s</cell><cell>0.3s</cell><cell>0.4s</cell><cell>0.6s</cell><cell>0.7s</cell><cell>0.9s</cell><cell>8</cell></row><row><cell>Ext. Task 1</cell><cell>0.3s</cell><cell>0.1s</cell><cell>0.2s</cell><cell>0.3s</cell><cell>0.4s</cell><cell>0.6s</cell><cell>0.7s</cell><cell>1.0s</cell><cell>28</cell></row><row><cell cols="9">Ext. Task 2 14.1s 53.6s 122.6s 225.6s 345.5s 487.3s 654.3s 1371.9s</cell><cell>47</cell></row><row><cell>Ext. Task 3</cell><cell>0.2s</cell><cell>0.1s</cell><cell>0.3s</cell><cell>0.5s</cell><cell>0.8s</cell><cell>0.9s</cell><cell>1.2s</cell><cell>3.5s</cell><cell>8</cell></row><row><cell>Ext. Task 4</cell><cell>0.2s</cell><cell>0.2s</cell><cell>0.3s</cell><cell>0.5s</cell><cell>0.8s</cell><cell>1.0s</cell><cell>1.2s</cell><cell>3.4s</cell><cell></cell></row></table></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">http://projects.eclipse.org/projects/modeling.mmt.qvt-oml</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1">http://eclipse.org/gmf-tooling/</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_2">https://www.eclipse.org/papyrus/</note>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<monogr>
		<author>
			<persName><forename type="first">Christopher</forename><surname>Gerking</surname></persName>
		</author>
		<title level="m">Transparent UPPAAL-based Verifcation of MechatronicUML Models</title>
				<imprint>
			<date type="published" when="2013">2013</date>
		</imprint>
		<respStmt>
			<orgName>University of Paderborn</orgName>
		</respStmt>
	</monogr>
	<note type="report_type">Master&apos;s thesis</note>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">Executing reconfigurations in hierarchical component architectures</title>
		<author>
			<persName><forename type="first">Christian</forename><surname>Heinzemann</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Steffen</forename><surname>Becker</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proceedings of the 16th ACM SIGSOFT Symposium on Component Based Software Engineering</title>
				<editor>
			<persName><forename type="first">Philippe</forename><surname>Kruchten</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">Dimitra</forename><surname>Giannakopoulou</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">Massimo</forename><surname>Tivoli</surname></persName>
		</editor>
		<meeting>the 16th ACM SIGSOFT Symposium on Component Based Software Engineering</meeting>
		<imprint>
			<publisher>ACM</publisher>
			<date type="published" when="2013">2013</date>
			<biblScope unit="page" from="3" to="12" />
		</imprint>
	</monogr>
	<note>CBSE&apos;13</note>
</biblStruct>

<biblStruct xml:id="b2">
	<monogr>
		<title level="m" type="main">The TTC 2014 Movie Database Case</title>
		<author>
			<persName><forename type="first">Tassilo</forename><surname>Horn</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Christian</forename><surname>Krause</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Matthias</forename><surname>Tichy</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2014">2014</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<monogr>
		<title level="m">Meta Object Facility (MOF) 2</title>
				<imprint>
			<publisher>Object Management Group</publisher>
			<date type="published" when="2011">2011</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<monogr>
		<ptr target="http://www.omg.org/spec/QVT/1.1/.Documentformal/2011-01-01" />
		<title level="m">Query/View/Transformation</title>
				<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<monogr>
		<ptr target="http://www.omg.org/spec/OCL/2.3.1/.Documentformal/2012-01-01" />
		<title level="m">Object Constraint Language (OCL) 2</title>
				<imprint>
			<date type="published" when="2012">2012</date>
		</imprint>
		<respStmt>
			<orgName>Object Management Group</orgName>
		</respStmt>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<monogr>
		<author>
			<persName><forename type="first">David</forename><surname>Steinberg</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Frank</forename><surname>Budinsky</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Marcelo</forename><surname>Paternostro</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Ed</forename><surname>Merks</surname></persName>
		</author>
		<title level="m">EMF: Eclipse Modeling Framework</title>
				<imprint>
			<publisher>Addison-Wesley</publisher>
			<date type="published" when="2008">2008</date>
		</imprint>
	</monogr>
	<note>2nd edition. The Eclipse Series</note>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">Modeling the OCL Standard Library</title>
		<author>
			<persName><forename type="first">Edward</forename><forename type="middle">D</forename><surname>Willink</surname></persName>
		</author>
		<ptr target="http://journal.ub.tu-berlin.de/eceasst/article/view/663" />
	</analytic>
	<monogr>
		<title level="m">Electronic Communications of the EASST 44</title>
				<imprint>
			<date type="published" when="2011">2011</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
