Hi Everyone,
On Friday, Paolo and I decided to check XMI Round Trip for our model. We did this using Beyond Compare - a very useful tool.
Firstly, we defined Beyound Compare rules to ignore data in the XMI files that will change every time. If you have Beyond Compare, you can import these rules using the XML below:
<bc_settings>
<rules>
<list name="XML">
<str_val name="RulesClass" value="TFreeForm1Rules"/>
<str_val name="FileTypes" value="*.xml;*.xsl"/>
<str_val name="Version" value="###"/>
<int_val name="Tab" value="4"/>
<int_val name="Speed" value="5"/>
<int_val name="CodePage" value="0"/>
<int_val name="Case" value="1"/>
<str_val name="WS" value="-LTEB"/>
<list name="Classify">
<wstr_val name="-Delim" value="%3C!--%00--%3E%00M"/>
<wstr_val name="-Delim" value="%3Ctimes%00%3E%00M"/>
<wstr_val name="-Delim" value="ea_localid=%00%22 %00M"/>
<wstr_val name="-Delim" value="localID=%00%22 %00M"/>
<wstr_val name="+Delim" value="%22%00%22%00M"/>
</list>
</list>
</rules>
</bc_settings>
This causes the timestamp lines and EA Local IDs (which seem to change all the time) to be shown as unimportant differences.
As background information, we have a skeleton model in an EAP file. This EAP file only contains packages, and at a certain level of the hierachy the packages are controlled. We have a file structure that matches the package structure in CVS which contains the XMI files. This allows us to create a complete model from scratch by running the EA batch import function for all controlled packages twice (twice due to issues with EA - thanks for this workaround Simon). It also allows us to recreate different models using the same skeleton using different CVS tags.
To use Beyond Compare in a quick way, we checked out the XMI from CVS twice in two different directories - one as a reference, one for the live copy. We then did a double import (as above), then a batch export of all packages in the live directory tree.
We then used the following Beyond Compare Session to compare the live to the reference:
<bc_settings>
<sessions>
<list name="PROD Model XML with Reference">
<str_val name="1" value="C:\@CVS Sandboxes\PROD_Reference\model"/>
<str_val name="2" value="C:\@CVS Sandboxes\PROD_Sandbox\model"/>
<int_val name="RO" value="0"/>
<int_val name="Expand" value="1"/>
<int_val name="ExpandDiffs" value="1"/>
<int_val name="Auto" value="1"/>
<int_val name="Readonly" value="0"/>
<int_val name="UseCutoff" value="0"/>
<int_val name="CutoffNew" value="0"/>
<int_val name="UseDaysAgo" value="0"/>
<int_val name="DaysAgo" value="0"/>
<int_val name="CutoffLo" value="-779739552"/>
<int_val name="CutoffHi" value="29820136"/>
<int_val name="Tolerance" value="2"/>
<int_val name="LeftAdjustLo" value="0"/>
<int_val name="LeftAdjustHi" value="0"/>
<int_val name="RightAdjustLo" value="0"/>
<int_val name="RightAdjustHi" value="0"/>
<int_val name="IncludeAttrib" value="0"/>
<int_val name="ExcludeAttrib" value="0"/>
<int_val name="SizeFilterMode" value="0"/>
<int_val name="Criteria" value="258"/>
<int_val name="Display" value="127"/>
<int_val name="SortBy" value="1"/>
<str_val name="Cols" value="n190s90t130"/>
<list name="IncludeFiles">
<str_val name="0" value="*.xml"/>
</list>
<list name="ExcludeFolders">
<str_val name="0" value="CVS"/>
</list>
</list>
</sessions>
</bc_settings>
This expands the directory tree to show files with important changes. This process has proven to be very quick and effective.
The following issues were identified:
XMI roundtrip creates spurious attached Note connector entries
XMI roundtrip changes Component connector GUID
XMI roundtrip changes <anonymous> nested Enumerations to be corrupted
XMI roundtrip changes order of operations with different signatures
XMI roundtrip changes order of elements in a package
XMI roundtrip changes order of associated classifier links
and have been reported to Sparx.
Although we are using a fairly "different" approach, we believe these (and perhaps more) issues apply to all XMI import/export (eg. controlled packages, baselines).
Sparx cannot possibly test every combination - our use of the tool is only really limited by our imagination. The input of the EA user community is vital. We'd like like to propose a push to identify all the bugs in this area. If you could do a similar check when you do XMI imports to ensure you don't lose any data and report all the bugs you find, we will all have a better tool to work with.
A 30-day trial of Beyond Compare is available from
http://www.scootersoftware.com/Darren.