Ideas Behind the ICER Tool

When we look back at software development, we find that the history of software development is actually the history of raising the level of abstractions. At the modern age of the compilers whose technique for programming languages has become so mature, people are looking for raising the compiler to the model level from the programming language level. Traditionally, a compiler for a programming language can achieve the following tasks:

In this project, we are trying to expand the role of compilers from programming languages to model development. That is, we are trying to compile a model to find "syntax" and "semantic" errors. No matter what level of abstraction, almost every model should represent some static structures of a software system; our goal of this project is to support software developers to find inconsistencies/errors in models at different level of abstraction. After seeing the important role of a model compiler in software development, we decided to investigate the possibility to build a model compiler generator which lets software developers write their model compiler. That is, the model compiler generator can have developers feel free to define what a valid model is when they design a software system based on a specific development context.

Before introducing our work, let us take a look at an automatic compiler generator tool, which is called YACC/BISON. It is YACC/BISON that allows the designers of a programming language to easily write a new compiler. When a user of YACC writes a compiler for a language, he should first give the syntax of the language in terms of YACC rules. Then he can embed the actions such as some semantics checking and translation into the rules. Last a compiler for the language has been generated.

However the mechanism used in YACC to generate a compiler for a programming language is not obvious to software models. Due to the graphical characteristics of a model, developers for model compilers cannot easily write a compiler for a modeling language as programming language compiler writers have done. But when studying the definition of the UML, we see the hope. As an application of the four layer architecture, the UML is defined by a UML metamodel. Applying the instance-of relation, many inconsistencies/errors in UML models can be found. Here are the details about the meta-model mechanism.

While many errors such as the duplicated role names associated with one association can be found, we found that there still exist many inconsistencies/errors which cannot be predefined by a model compiler. Furthermore, software engineering, as an engineering task, heavily depends on many factors which affect designing a high quality software system, such as a development platform. Thus, like the compiler writers who write their language's definition, we should leave software developers to decide what a valid model is according to an application they will deisgn. Fortunately, we find it is the profile mechanism that can provide such a feature. The idea behind a profile is that software developers can extend the UML metamodel which belongs to the M2 level by introducing some meta-elements using stereotype. Applying the instance-of relation between an application model and its profile, we can find many inconsistencies/errors which are ignored by many software developers. Based on the above idea, we build a tool, called ICER (Instance-of Relation ChekER) As an example to illustrate the feature of this research, we apply the ICER tool to the model applications of the famous GoF design patterns. Here are the details about how to find errors which violate the design patterns.

All the inconsistencies/errors we have found so far are based on a model at one level of abstraction. However, software development is a process which keeps increasing the level of refinement. A model at one level of less abstraction can be regarded as a refinement of another model at a level of more abstraction. Is it possible to apply the ICER tool to check whether two models at different levels of abstraction have some refinement relations? Can the ICER tool be applied to support a software development process based on different sets of refinement rules? Our answer is yes. As an application of a model compiler to check two models of different levels of abstraction, we apply our tool to the class diagram refinement and here is an example.

From the previous examples, we think that the ICER tool can play a more important role than a compiler for a programming language. The ICER tool can not only find errors in a model at one level of abstraction but also check two different models at different levels of abstraction during software development. Therefore, the ICER tool can support different software development processes. Furthermore, we think that most of non-runtime errors introduced during software development can be detected by the ICER once a profile defines a metamodel appropriately.

As the first step of the model compiler generator we have built, the generator can check whether a class structure (M1 level model(s)) satisfies a profile (M2 level) and an object diagram (M0 level model) is a valid instance of a class diagram (M1 level). Our current model compiler generator is based on the AsmL, which is implemented by FSE group in Microsoft. The implementation of the generator consists of the following three parts: