Main Logo

Code Generation with MERODE-tools

Code Generator Demo

Where to find the code generator?

The Code Generator is a standalone Java application that can be used to generate code from an .mxp file. To install the Code Generator download the ZIP archive, unzip the archive in a folder where you have writing permissions, and run the .jar file. In case if you have any issues with running the Code Generator, you can check out this FAQ file
This version of the Code Generator will not work on Mac. Therefore, MAC OS users can run the Code Generator via docker. The instructions can be found in this manual.

The current version is able to handle all models without inheritance and some (not all) models with inheritance.

General flow

This picture shows the general flow of how code is generated.

  • Step 1 is to design a MERODE-model in MERLIN
  • Step 2 is to invoke the code generator to generate code out of it
  • The result is a JAR with the generated application
Code Generation Process
How to generate code

To generate a prototype application, proceed with the following steps:

  • Browse to your MERODE model (mxp file). In the standalone version, click "Open an mxp or folder" to load the previously stored .mxp file.
  • Press the 'Generate' button to generate a prototype of your model.
  • A window will popup where you can define the location of your generated prototype.
  • A prototype named 'merode_application' will be generated in the specific location.
  • Press 'Run' button (once it becomes green) to compile and start your generated application.

To re-run an already generated application, browse to to your saved application folder and click the RUN.bat in that folder to start your application.
Note that each time before starting, the application will be incrementally compiled to include any manual modification of the code.

Code Generation Steps
Generated Application

The generated prototype application will contain one tab per each business object type. Each tab

  • shows the list of created object instances
  • provides buttons to create, modify and end instances
  • provides, per instance, a link to view the details of that instance.

When trying to execute a non-allowed action, the prototype application will explain which part of the model contains the constraint that causes the action to be refused.

Generated Application
Testing the Generated Application

Testing is crucial to establish the quality of software. The most common mistakes when learning testing is suboptimal coverage. A high testing coverage indicates that most of the developed software has been tested, therefore, reducing the quality issues that the final software product may have. TesCaV allows validating the test cases defined by students and graphically determines the level of testing coverage over the system modeled. Preliminary results show TesCaV as a promising approach for MBT teaching/learning processes.

TesCaV can be run as follows:

  • Click 'Tools' in the top left corner.
  • Click "Run TesCaV".
  • Now you will see a pop-up window informing you whether your test coverage is complete.
  • To get more information click on "View details".
  • Select on entity class you would like to get more information on.
  • Visualize which test cases of a criterion have not yet been tested by clicking 'View' next to that criterion.

After you have done more tests on the generated application, you have to start TesCaV again by clicking "Run TesCaV" to update the visualizations.

TesCaV Steps