Type Inference Using Concrete Syntax Properties in Flexible Model-Driven Engineering

Athanasios Zolotas, Nicholas Drivalos Matragkas, Sam Devlin, Dimitrios S. Kolovos, Richard F. PaigeFlexMDE@MoDELS 2015

TL;DR

This paper explores how to automatically identify missing "types" in informal, sketch-based software models by analyzing their visual properties. By feeding graphical features like shape, color, and size into a decision tree algorithm, the researchers achieved a 64% accuracy rate in predicting the intended meaning of untyped elements, performing comparably to complex semantic analysis.

Problem Statement

In traditional Model-Driven Engineering (MDE), engineers adhere to strict "metamodels" (blueprints) to create specific models. However, "Flexible MDE" allows engineers to start by sketching example models on digital whiteboards to brainstorm.

Because these sketches lack a strict initial blueprint, they are often inconsistent. Engineers may forget to label a shape's type, use different names for the same concept, or introduce typos. While previous solutions attempted to infer missing types using "semantic" data (e.g., connectivity and node relationships), this paper investigates a simpler approach: Can we guess what a node is just by looking at how it was drawn?

Methodology

The authors propose a type inference approach based on Concrete Syntax Properties—the visual characteristics of the diagram elements. The process follows an automated pipeline to classify unknown elements based on known examples within the same model.

The automated proposed solution workflow for classifying unknown elements in flexible models.

1. Feature Collection

For every node in a diagram, the system extracts a "feature signature" consisting of four primary visual attributes:

  • Shape: (e.g., rectangle, ellipse, hexagon)
  • Color: (HEX code)
  • Width & Height: (in pixels)

2. Classification Algorithm

The system utilizes a Classification and Regression Tree (CART) algorithm. This supervised machine learning method builds a decision tree that maps these visual features to a specific type (e.g., "Animal" or "Doctor").

3. Noise Simulation

To test robustness against human inconsistency, the researchers intentionally added "noise" by randomly altering the visual features of nodes (e.g., changing a rectangle to an ellipse) to measure how much human sloppiness degrades prediction accuracy.

Experimental Setup and Dataset

The study evaluated the approach using a complex "muddle" (a flexible model) created for a real-world web application project. The dataset included over 100 elements across 20 different types. This specific model allowed for a direct comparison between this visual-based approach and previous logic-based (semantic) methods.

Key Results

The experimental results demonstrate that visual properties are a powerful indicator of element types, largely because humans are "accidentally" consistent. The use of copy-paste in drawing tools often preserves the visual signature of specific types.

Average success ratio (accuracy) across varying noise levels and sampling rates.
  • Overall Accuracy: The system correctly identified 64% of missing types on average.
  • Data Sensitivity: Accuracy improves as more of the model is typed. With 90% of the model already typed, accuracy for the remaining 10% reached 71%.
  • Resilience to Noise: The system maintained a 60.4% success rate even when 20% of the nodes had randomized features. There is a strong negative correlation between visual inconsistency (noise) and success rate.
  • Competitive Performance: The visual-based results (64% avg) were nearly identical to the success rates of previous semantic-based inference methods (60.7% avg), despite the visual approach being significantly simpler to implement.

Discussion and Future Work

While effective, the algorithm struggled with "rare" types—elements appearing only once or twice—due to insufficient training data. The authors suggest that the most robust future solution will be a hybrid approach, combining visual features (shape/color) with semantic features (connections/attributes) to create a multi-modal inference engine. Additionally, expanding the feature set to include font size, border thickness, and orientation could further refine accuracy.

Summary updated

BibTeX
@inproceedings{zolotas2015type,
  author = {Athanasios Zolotas and Nicholas Drivalos Matragkas and Sam Devlin and Dimitrios S. Kolovos and Richard F. Paige},
  title = {{Type Inference Using Concrete Syntax Properties in Flexible Model-Driven Engineering}},
  booktitle = {FlexMDE@MoDELS},
  year = {2015},
  url = {https://openreview.net/forum?id=bgkeyl4T24AS},
}
Figure