Wodel4diac: model mutation for IEC 61499 industrial automation

Wodel4diac extends Wodel — a domain-independent, language-independent tool for model mutation — so that it can mutate IEC 61499 models authored in Eclipse 4diac.

This makes it possible to systematically generate variants of function-block applications for purposes such as mutation testing, fault seeding, robustness analysis, and the automated generation of learning exercises for industrial-automation engineering.

Background

Wodel is a tool for mutating models conforming to arbitrary meta-models. A Wodel program specifies, in a high-level and metamodel-agnostic syntax, a set of mutation operators (create, remove, modify, retype, clone, select, …) to apply to a seed model. Wodel generates syntactically and (optionally) semantically valid mutants, computes metrics, and post-processes the results. It is built on the Eclipse Modeling Framework (EMF) and Xtext.

Eclipse 4diac is an open-source framework for distributed industrial automation and control based on the IEC 61499 standard. It comprises the 4diac IDE engineering environment and the FORTE runtime, and models control logic as networks of function blocks.

Wodel4diac bridges the two: it lets you express mutation operators over 4diac / IEC 61499 models and obtain a population of mutated function-block applications.

What Wodel4diac adds

On top of the standard Wodel ecosystem, Wodel4diac contributes:

Requirements

Installation

Option A — Install into Eclipse via the update site (recommended)

  1. In Eclipse (with the 4diac IDE features installed), open Help → Install New Software…
  2. Add the update site built from this repository (wodel.updatesite):
    https://gomezabajo.github.io/Wodel4diac/update-site/
  3. Select the Wodel4diac features and complete the wizard.
  4. Restart Eclipse.

Option B — Build from source

git clone https://github.com/gomezabajo/Wodel4diac.git
cd Wodel4diac

Then import the plugin projects into an Eclipse 4diac 3.2.0 workspace (File → Import → Existing Projects into Workspace) and launch a runtime Eclipse instance with 4diac 3.2.0 installed.

Quick start

Real, runnable Wodel programs are included under wodeltest.extension.examples/mutator (ATL, Java, finite automata, and more). The grammar is defined in wodel.dsls.wodel.

  1. Create (or open) a Wodel project and add a .mutator program.
  2. Point it at a seed 4diac model and the corresponding meta-model.
  3. Run it to generate mutants; the 4diac post-processor writes them out as 4diac projects.

The mutation language is standard Wodel. As a taste of the real syntax, here is an abridged excerpt from testFA1.mutator, which ships with the repository (it mutates finite automata; the same operators apply to 4diac / IEC 61499 models through the wodel.fordiac integration):

generate 10 mutants
in "data/out/"
from "data/model/"
metamodel "/[@**@]/data/model/DFAAutomaton.ecore"

with blocks {
	dtr "Delete transition" {
		remove one Transition
	}
	mfs "Set final state to non-final" {
		modify one State where {isFinal = true} with {reverse(isFinal)}
	}
	rts "Set transition's target to a new final state" {
		s = create State with {name = 'f', isFinal = true}
		modify target tar from one Transition to s
	}
}

Generated mutants appear in the output folder and can be opened directly in the 4diac IDE.

Project structure

Wodel4diac is a multi-bundle Eclipse project. The most relevant areas:

AreaModules
4diac integrationwodel.fordiac, wodel.postprocessor.fordiac
AI assistantwodel.ai.assistant
Wodel DSL & corewodel.core, wodel.dsls.wodel*, wodel.run, wodel.registry*, wodel.extension, wodel.utils
Post-processing & outputwodel.postprocessor*, wodel.json
Validation & comparisonwodel.syntactic.*, wodel.semantic.*, wodel.emf.validation, wodel.emf.comparison
Metricswodel.metrics.*, wodel.footprints
Synthesiswodel.synthesizer, wodel.seed.synthesis
ASPLE DSLwodel.asple, wodel.dsls.asple*
Education layerwodel.wodeledu, wodeledu.* (modeldraw, modeltext, mutatext, edutest)
Mutation testingwodel.wodeltest
Bundled toolinganatlyzer.* (ATL analysis), efinder.* (model finding), tinytools.*
Update siteswodel.updatesite, efinder.updatesite

AI assistant (experimental)

The wodel.ai.assistant module integrates an experimental generative-AI assistant to help users author and refine Wodel mutation programs. It is under active development and not yet considered stable.

Citing

If you use Wodel4diac or Wodel in academic work, please cite the relevant Wodel publication and, where applicable, the Wodel4diac work (WIP):

@inproceedings{GomezAbajo2016Wodel,
  author    = {G\'omez-Abajo, Pablo and Guerra, Esther and de Lara, Juan},
  title     = {Wodel: A Domain-Specific Language for Model Mutation},
  booktitle = {Proceedings of the 31st Annual ACM Symposium on Applied Computing (SAC)},
  pages     = {1968--1973},
  year      = {2016},
  doi       = {10.1145/2851613.2851751}
}

Acknowledgements and third-party components

Wodel4diac builds upon and redistributes components from several projects, including:

We also acknowledge the developers of the frameworks used to implement Wodel:

Developed in the context of work at the Universidad Autónoma de Madrid and the Universidad de Murcia.

License

Distributed under the Eclipse Public License 2.0 (EPL-2.0). See LICENSE for details. Redistributed third-party components remain under their respective licenses.