These instructions are for a Linux environment, in particular Ubuntu LTS 20.04/22.04 (x64).
- Download the latest RoboTool packaged release from the robotool repository.
- Extract the archive.
- If running under Wayland, start Eclipe from the command line ensuring it is running in X11 mode, to avoid potential incompatibilities,
by setting the
GDK_BACKEND
environment variable toX11
, that is, by using the commandGDK_BACKEND=X11 ./eclipse
. Otherwise, start Eclipse normally. To determine whether you're running under Wayland, you can query the value of the environment variableXDG_SESSION_TYPE
, for example, by running the commandecho $XDG_SESSION_TYPE
in a terminal.
Following on from the steps above, then make sure you uninstall the plug-in you are developing. For example,
to work on the development of the RoboChart Trace Generator
you should first uninstall via the following sequence of steps:
- Select
Help
>About Eclipse IDE
>Installation Details
and select the featureRoboChart Trace Generator
in theInstalled Software
tab. - Uninstall the feature.
- Click
Finish
. - Let Eclipse restart.
You're now ready to import the source Git repositories by following the instructions below.
-
Configure Eclipse to work with a local path for Git repositories by going to
Window
>Preferences
, searching forGit
and selecting it on the left-hand side. Change theDefault repository folder
as appropriate. Then clickApply and Close
. -
For each of the following repositories:
- robochart-trace-gen
- robotest-textual
- robotest-ros-gen (if working with ROS)
Follow the following instructions:
- Open the repository on GitHub by following the link, then copy the SSH URL, e.g. clicking on
Code
and clicking on the clipboard copying icon. - Then, go back to Eclipse. Select
File
>Import
, and selectGit
>Project from Git (with smart import)
and clickNext >
. - Select
Clone URI
and clickNext >
. - If you've copied the correct SSH URL to your clipboard the dialog should be automatically populated. Click
Next >
. - You may now be prompted to authenticat to GitHub, preferably using the passphrase for your SSH private key. Enter it.
- By default at this stage Eclipse will select all branches for the chosen repository. Click
Next >
. - Click
Next >
again, after which you'll be asked to chose which Eclipse projects to import. - Import all projects. Before you do so, you may want to consider organising it by Java working sets (optional).
- Finally click
Next
andFinish
. The projects should now show up in thePackage Explorer
orProject Explorer
.
The following is a description of plug-ins required and used for: (1) calculating forbidden traces; and (2) generating test drivers, that is ROS nodes, that can be used to test ROS software nodes. Setting up of an environment for working on their development is deferred to later in the document.
Forbidden trace generation (robochart-trace-gen)
This plug-in generates forbidden traces of a finite size from a RoboChart component, such as State Machines, Controllers and Modules. These are sequences of interaction that end in an event that is forbidden by the model.
The current implementation can only currently generate untimed forbidden traces. For this, it uses the CSP
semantics automatically calculated by RoboTool and the FDR model-checker. FDR creates a graph representation of
the underlying operational semantics of CSP, which is then used to calculate, at every state in the graph,
what events are forbidden. To facilitate this calculation, the plug-in uses a version of CSP processes with a
compression function called diamond
that guarantees there are no tau
(silent) transitions in the graph,
thus making the implementation much simpler, at the cost, of potentially having to perform more calculations upfront.
Given the name of the desired RoboChart component, the plug-in outputs a file of the same name with an extension
.rtest
, under the folder test-gen
by default, containing a set of forbidden traces up to the length specified. The syntax of the traces follows that of CSPM expressions, and can be parsed by the plug-in
robotest-textual, described below.
This plug-in requires FDR4 to be installed in a path known to the plug-in.
In particular, it interfaces with FDR by loading a fdr.jar
file, via JNI. FDR cannot be distributed
standalone, so this dependency cannot be shipped with RoboTool.
- The plug-in relies on a fixed location for finding the
fdr.jar
as defined in itsMANIFEST.MF
. It should be possible to load this dynamically, possibly by allowing users at run-time to provide the location for FDR, as already captured by therobochart-textual
plug-in options. - Use of JNI with
fdr.jar
seems to have issues with reclaiming back memory from FDR, even after it has been terminated and exited.
Forbidden trace grammar and conversion (robotest-textual)
This plug-in implements an Xtext grammar that can parse the forbidden traces generated by robochart-trace-gen
in files ending with the extension .rtspec
. There are in fact two dialects supported for such files, a CSPM dialect, that has no direct
knowledge of RoboChart components and types, and a RC dialect, that can be used to describe forbidden traces in terms of RoboChart model
elements. It is more concise and can capture more information, that just CSPM traces.
Note that from the Xtext grammar, an EMF metamodel is automatically generated. Instances of the metamodel are automatically populated when a file is parsed.
Conversion between forbidden trace formats is implemented by an Epsilon ETL model transformation program, that can be run from within RoboTool. This is useful, for example, given that the ROS test generator expects forbidden traces in the RoboChart dialect, rather than the CSPM form.
- The ETL transformation currently needs to be run manually from within Eclipse. It is possible to run such transformations programmatically, so ideally an integrated toolchain of these plug-ins should be able to make use of this workflow.
- The ETL program has only been tested on a small set of examples. It is likely not currently comprehensive enough to cover all cases.
ROS test generation (robotest-ros-gen)
The ROS test generator currently targets ROS Noetic and can support testing of ROS Nodes implementing a RoboChart component, such as a state machine, making use of topics and services, but not actions. The generator works by generating C++ code: (1) a libary that contains common code to a test suite, including some minimal amount of code to be provided by the user; (2) a main C++ program per forbidden trace. It is integrated with rostest via XUnit, but there is the possibility to enhance this integration, for example, to allow parallelisation of testing, thus improving on the efficiency.
- ROS1: Instrumentation of the NUT (Node Under Test) needs to be documented better and there is scope for providing a library of patterns, or even explore approaches for implementing the same API, but for testing.
- Considering timed tests.
- Targetting of ROS2 should be more straightfoward given the ability to configure the DDS layer to deliver messages in order.
- The generated nodes have only been tested for a small subset of a case study on a Firegithing UAV. A comprehensive test suite for the tool is required, to provide further coverage and validation.
- Actions are currently not supported, but since they are implemented via topics, this should be feasible, either by changing the generator or configuring the additional required topics.
- No parallel tests at the moment via rostest. Could integrate with CMake for this.