From OCL-based model static analysis to quick fixes
Résumé
Giving accurate and relevant static analysis feedback to modeling tool users significantly helps them design useful models. This feedback is even more valuable when it comes with completion proposals, called quick fixes, which users can apply to automatically resolve specific issues. However, implementing such static analysis and quick fix tooling is tedious and error prone. For instance, providing accurate messages typically requires decomposing complex model queries into simpler ones, while suitably handling their dependencies. Moreover, each quick fix should actually resolve the issue it is supposed to fix, which is not always easy to ensure. This paper presents an approach that leverages reverse propagation of OCL-like boolean expressions to provide correct-by-construction quick fixes. It only requires adding specific annotations to expressions in order to guide quick fix computation. A proof-of-concept implementation of this approach on the AnimUML partial modeling tool is described. It is able to automatically construct messages, to report different messages depending on which part of a predicate fails, and to provide quick fixes.