Artifacts for "Continuous Model Validation Using Reference Attribute Grammars"
Note: please use the HTML version of this README.
Also Note: There is a variant of this submission including a docker image (provided as a link) and one without it (uploaded in HotCRP). We encourage using the one including the image, since building the image takes a long time.
Authors
- Johannes Mey johannes.mey@tu-dresden.de
- Carl Mai carl.mai@tu-dresden.de
- René Schöne rene.schoene@tu-dresden.de
- Görel Hedin gorel.hedin@cs.lth.se
- Emma Söderberg emma.soderberg@cs.lth.se
- Thomas Kühn thomas.kuehn3@tu-dresden.de
- Niklas Fors niklas.fors@cs.lth.se
- Jesper Öqvist jesper.oqvist@cs.lth.se
- Uwe Aßmann uwe.assmann@tu-dresden.de
Introduction
The paper discusses the utilization of reference attribute grammars (RAGs) for model validation and presents two specific contributions. First, the differences between models and trees specified by reference attribute grammars, specifically non-containment references, are discussed and a manual, yet optimised method to efficiently overcome these differences is presented. Secondly, an extension of RAG grammar specifications is proposed to model non-containment references automatically. The proposed modelling techniques are compared to state-of-the-art modelling tools utilizing a benchmarking framework for continuous model validation, the Train Benchmark.
Structure of the Supplementary Artifacts
The artifacts are structured in three parts:
- A standalone example of the non-containment references preprocessor
- Benchmark code to reproduce the measurements, including all relevant source codes
- Full collection of all measurement data and diagrams mentioned in the paper
General Remarks on the presented Listings and Measurements
For reasons of readability and simplicity, there are some minor differences in naming in the source codes and the measured resulting data. Most importantly, the names of the three presented JastAdd implementation variants are different in the code and the diagrams.
The following table shows the relation of the terminology used in the paper and in the code.
Name used in Paper | Name used in result data | Name used in source code |
---|---|---|
Name Lookup | Jastadd (Name Lookup) | jastadd-namelookup |
Intrinsic References | Jastadd (Optimized) | jastadd-optimized |
Grammar Extension | Jastadd (Specialized) | jastadd-specialized |
The Grammar Extension Preprocessor RelAst
To transform the grammar extension we provide a preprocessor for JastAdd.
This preprocessor including its source code is provided in the preprocessor
subdirectory.
Its usage is:
-
Run preprocessor on train benchmark (output written to standard output):
cat examples/TrainBenchmark.relast
java -jar relast-compiler.jar examples/TrainBenchmark.relast
-
Run preprocessor and write output to files:
java -jar relast-compiler.jar examples/TrainBenchmark.relast --file
cat examples/TrainBenchmarkGen.ast
cat examples/TrainBenchmarkGen.jadd
-
Run preprocessor and write output to files (with a different list class):
java -jar relast-compiler.jar examples/TrainBenchmark.relast --listClass=MyListClass --file
cat examples/TrainBenchmarkGen.ast
cat examples/TrainBenchmarkGen.jadd
The Train Benchmark
Structure of the Train Benchmark
The benchmark is able to measure different scenarios specified by configurations with several kinds of parameters:
-
Input Data: There are two types of input data used in the benchmark, the
inject
and therepair
data set. The former contains valid models, i.e., models, which do not contain any of the faults that are supposed to be found by the presented queries. The latter,repair
, contains models already containing faults. - Queries: The queries are used to find the aforementioned faults. For each fault, there are two queries: repair, to find the fault, and inject, to find places where a fault can be injected.
- Transformations: The transformations performed by the benchmark are, again, two sets: inject and repair transformations.
- Transformation Strategies: The benchmark does not perform the operation on all matches. The strategy fixed performs the transformation on a given number of matches, while the proportional strategy performs them on a given percentage of all matches.
These settings are defined in a benchmark scenario, which can be edited before running the benchmark.
Measurement Data
The result data is stored in the directory paper-results/. This directory contains two subdirectories:
-
measurements contains two directories.
The inject subdirectory contains the measurements for the inject scenario, which is also included in inject/BenchmarkScript.groovy.
The repair subdirectory contains the same data for the repair scenario in repair/BenchmarkScript.groovy.
Both directories contain files with time measurement data (starting with
times
) and the numbers of matches (starting withmatches
). Each file name contains information on the tool used, the query, and the size of the model. -
diagrams contains the same subdirectories, both containing diagrams with the respective measurements.
The diagrams are generated from the same data as in the paper, but enlarged for better readability.
In particular, the six diagrams presented in the paper are
- Fig. 7a. Read and Check for RouteSensor (repair)
- Fig. 7b. Read and Check for ConnectedSegments (repair)
- Fig. 7c. Transformation and Recheck for RouteSensor (inject)
- Fig. 7d. Transformation and Recheck for ConnectedSegments (inject)
- Fig. 7e. Transformation and Recheck for RouteSensor (repair)
- Fig. 7f. Transformation and Recheck for ConnectedSegments (repair)
Please Note: The measurements were conducted using a timeout for the whole run. If a run was not completed, no individual times of the steps appear in the measurements and diagrams. Thus, some tools do not have measurements for all problem sizes.
The Source Code
For this publication, we tried to modify the source code of the benchmark itself as little as possible. Therefore, unfortunately, the code base is rather large and confusing. The following section tries to point to the parts relevant for this paper.
The benchmark is structured in modules, some of which form the code of the benchmark, some are provided by the contesting tools, and some are related to required model serializations. There are some naming conventions:
- Tool-related modules are in directories starting with
trainbenchmark-tool
. - Model serialization-related modules start with
trainbenchmark-generator
. - All other modules are core modules of the benchmark.
The JastAdd-based solutions use a preprocessor to generate Java files, for the presented variant. Each JastAdd configuration must be presented to the benchmark as a separate tool. Thus, there are two directories for each variant, one for the batch processing mode and one for the incremental mode. Because these two modes share almost all the source code, a third directory is used to store this shared code. Finally, there is a directory for code shared between all JastAdd variants. These are the important directories:
- JastAdd with Name Lookup
- JastAdd with Intrinsic References
- JastAdd with Grammar Extension
- Common JastAdd Code
Reproducing the Measurements
Please Note: Reproducing the graphs as presented in the paper and supplied here takes a very long time depending on the utilized hardware. It is strongly suggested running the benchmark with a smaller maximum problem size, fewer repetitions, and a shorter timeout. Most results of the benchmark are observable with more restricted setup as well. In the following, we will provide a suggested way to run the benchmark in different sizes. Note that running the benchmark requires a significant amount of disk space (up to 10GB when running the full benchmark).
To reproduce the measurements, there are several options. We provide a prepared Docker image that can be run directly. Alternatively, it is, of course, also possible to simply run the provided gradle build scripts. However, since there are some software requirements imposed by the benchmark, particularly for creating the diagrams using R. We strongly suggest running the Docker variant.
Running the Benchmark with Docker
Loading the Docker Image
- Variant 1 (recommended): Load the provided docker image
- Prerequisites: An installation of Docker in the
PATH
- Steps:
- Unpack the provided archive and open a terminal in the extracted directory
docker load --input trainbenchmark-docker.tar
- Prerequisites: An installation of Docker in the
- Variant 2: Build the docker image from the provided Dockerfile
- Prerequisites: An installation of Docker in the
PATH
- Steps:
- Unpack the provided archive and open a terminal in the extracted directory
docker build -t trainbenchmark .
- Prerequisites: An installation of Docker in the
Running the Docker Image
docker run -it -v "$PWD"/docker-results:/trainbenchmark/results:Z -v "$PWD"/docker-diagrams:/trainbenchmark/diagrams:Z trainbenchmark
- This makes the results and diagrams available outside the container in the directories
docker-results
anddocker-diagrams
respectively - Once running, a command prompt is opened and some information is displayed
- Follow the instructions below
Running the Benchmark directly
- For running a standard run, use one of the following commands:
Name | Command | Minimum size | Maximum size | Timeout | Runs |
---|---|---|---|---|---|
Small | ./run_small |
1 | 32 | 60s | 1 |
Medium | ./run_medium |
1 | 64 | 10min | 5 |
Full | ./run_full |
1 | 512 | 15min | 10 |
-
For running a custom run,
- run
./gradlew preprocess
to generate the grammar from the extended grammar specification - run
./gradlew build shadowJar -x test
- run
./gradlew initScripts
- configure the scripts by running
./scripts/configure.sh 1 <MAXSIZE> <TIMEOUT in s> <REPETITIONS>
- Where MAXSIZE is one of 2, 4, 8, 16, 32, 64, 128, 256, 512, or, 1024. The larger sizes use a lot of disk space!
- run
./gradlew initScripts
- run
./gradlew generate
- run the benchmark
- run
./gradlew individualInjectBenchmark
for the inject scenarios - run
./gradlew individualRepairBenchmark
for the repair scenarios
- run
- Plot the diagrams for the current run:
./gradlew plotIndividual
- run
-
The resulting data and diagrams is placed in the
results
and thediagrams
folder- When running with docker, the data is also in
docker-results
anddocker-diagrams
on the host machine.
- When running with docker, the data is also in