ConfigurabilitySiDiff has been designed to be a highly configurable framework that can be adapted to all application contexts where model differences are involved. One a major aim was to be able to address special demands of any given model type and, if necressary, the user.
AnnotationsAnnotations can be used to calculate specific static, derived information about elements of the models. They can be used later on in the comparison workflow. Examples are software metrics, signature-values, and path-information.
In certain model types, two elements can only be matched if their parent elements are already matched. In this case an efficient top down matching approach can be applied that reduces the runtime of the SiDiff algorithm to N log N. The disadvantage of a this approach is, that certain differences, e.g. moves, cannot be detected.
In many model types, the similarity between two elements is based on the similiarty of their descendents. The top down approach fails in these cases, and a bottom-up matching approach can be applied. This approach is more complex, but delivers additional difference information, like moves of elements.
If some application contexts universally unique identifiers (UUIDs) of model elements are available. SiDiff is capable of using such IDs to find correspondences between models elements. This algorithm is the fastest and most trivial matching approach.
A signature is an encoding of a set of attributes of model elements. Signature-based matching algorithms match model elements with the same signature. SiDiff supports signature-based matching. The set of attributes contained in the signature can be defined for every element using local attributes or external properties of the element.
If neither an ID nor a signature based matching approach can be applied, SiDiff can calculate the similarity between two elements based on a given set of compare functions. Within a similarity-based approach, the similarity of two elements is usually determined by either local attributes or by elements in the near proximity, e.g. referenced elements or child-elements. SiDiff offers a wide range of functions for computing similarity values based on such characteristics. New functions can be added easily if an application context warrants it.
A similarity function calculates the similarity value between two element properties. It returns the computed similarity as a float value between 0 (no similarity) and 1 (equality). Because the similarity between two elements usually depends not only on one, but on several properties a set of similarity functions can be defined for any given element type. Since some properties may be more significant for the similarity than others, weights can be assigned to properties. The similarity of two elements is thus defined as the weighted arithmetic mean of the similarities of the relevant properties.
To ensure that only elements with a meaningful similarity are matched a threshold can defined for each element type. Only Elements with a similarity above the treshold are considers to be candidates for a correspondence. This prevents matchings between elements with a small similarity. An example configuration for the (pseudo-)element type someElement can be found in the following table.
|Similar value for attribute name||0.5|
|Equal value for attribute state||0.1|
|Similar Elements following outgoing EdgeType A||0.1|
|Similar Elements following incoming EdgeType B||0.1|