IBM
Contents Index Previous Next



Comparing TTCN Documents


The Compare tool is used for comparing two TTCN documents with respect to finding similarities that exist between them, i.e. two TTCN objects that have the same name. These objects need not necessarily be of the same type.

The Compare tool is accessed from a Browser and is applied to selections of items in that Browser.

Compare will check either only for similar names or for names and object type. The comparison can also include the contents of tables if required.

The Compare tool can also check the group structure of TTCN documents for similarities, i.e. it will indicate Test Group, Test Step Group and Default Group paths that are the same in both TTCN documents.

Any similarities that are found may be logged in a log file. There are three levels of log verbosity: quiet, some and full. Execution of the Compare tool may result in a new selection, which can be used to create a separate Browser if so wished.

One of the main uses of this tool will be to help remove conflicts from two TTCN documents prior to performing a merge operation.

Comparing by Using the Compare Tool

To use the Compare tool, you need two TTCN documents to operate on: the destination document and the compare document.

Figure 190 : How Compare works

A selection from the destination document may be compared with the compare document. If any similarities are found between the two TTCN documents this will result in the modification of the original selection in the destination TTCN document.

Tools > Compare

Compares a Browser selection from one TTCN document with another TTCN document with respect to similarities. Make the selection in a destination TTCN document Browser and call the Compare tool from the same Browser.

Figure 191 : Compare Documents dialog

Log Device

Controls the log device for the Compare tool. The default value is Screen, but the log can be directed to a named file by choosing File or turn it off altogether by choosing None.

For a full description of this command see The TTCN Suite Logs.

Documents

Presents a list of currently open documents. For Compare to work correctly at least two documents must be present in this list. The document name in bold italic font is the document from which the Compare tool was called, i.e. the destination document. The user must choose another document in this list, i.e. the compare document, in order to do a comparison.

Example 201

In the dialog above the destination document is Test_Suite_A and hence the compare document may only be Test_Suite_B.

Action

Specifies the effect that the Compare operation will have on the original selection in the destination TTCN document.

Figure 192 : Compare: Action

Verbosity

Sets the verbosity level for the log file.

Figure 193 : Compare: Verbosity

Note:

Using the Nothing action together with the Quiet option is rather meaningless!

Figure 194 : Compare: log (Verbosity: some)

If the Content switch is on, the log will also indicate that a difference has been detected.

Figure 195 : Compare: log (Verbosity: full)

If the Compare Content switch is on, the log will also indicate in detail the differences detected.
Compare Content

Extends the scope of the comparison to include the contents (down to the level of a single character) of the tables as well. Thus, two objects are considered to be identical if their names, object types and entire contents are identical. If the verbosity is full the differences are detailed.

Compare structure

Extends the scope of the comparison to include the Test Group, Test Step Group and Default Group references in the relevant behaviour tables. This option is only available when the Compare content option is chosen.

Comparing by Using itexdiff

A separate program, itexdiff, may also be used to quickly compare the contents of two TTCN Suite files. The tool is less powerful than the Compare tool, but it may be very useful when there is a need for quickly comparing two revisions of the same TTCN document for equality.

The program is run like:

itexdiff FooSuite.itex /home/user1/FooSuite.itex

This will test the content of the two TTCN documents for equality and report the result in a printout. To get a more elaborate compare, the -d switch may be added like:

itexdiff -d FooSuite.itex /home/user1/FooSuite.itex

This will give the output of running the program diff on the MP representation of the content of the two documents.

Running the program without any arguments will print out a terse usage message.

Using Compare Before Merging Two TTCN Documents

The Merge tool will always try to perform the merge operation, also when the two documents have conflicts. A conflict occurs if any TTCN objects in the TTCN documents have the same name.

One of the first things Merge does is to compare the two TTCN documents. Any conflicts found will be notified in the log and the Merge operation will then continue. The Compare tool can be used to find and resolve the conflicts.

For a full description of this command see Merging TTCN Documents.


http://www.ibm.com/rational
Contents Index Previous Next