Specstractor is the implementation of the specification-extraction framework originally presented in Ackermann2010 and elaborated on in Schulze2017. The Extractor implements an iterative test -> infer -> instrument -> retest cycle to extract specifications in the form of system invariants from automatically generated test data using data-mining techniques.
The resulting invariants can be analyzed in the [Insight] tool.
The Extractor implements the workflow illustrated in the image below:
Prerequisites: * Windows 64bit (Tested on Windows 10) * Reactis 2017 (Tested version 2017.0.1) * Java 8 (Tested on version 8v121)
A 30 day trial license for Reactis can be requested from http://www.reactive-systems.com/ after creating a user account.
The extractor zip file can be downloaded here. After downloading it you can unzip it into a folder of your chosing. The folder structure should look like this:
For licensing reasons we cannot package the Reactis dll files required to execute Reactis from Spectractor. However, the necessary files are included in the Reactis installation. Please copy the file libreactis.dll from ReactisInstallationFolder/lib/api/ to the folder SpecstractorFolder/lib/TestGeneratorDLL/.
Now double click on the Specstractor.jar file to start the Extractor. This should bring up the following screen:
For the Extractor tutorial we will first start by setting up the tutorial system that is in the Specstrator folder. For instructions on how to setup your own system please click here.
Please double click on the Specstractor.jar file. After the start screen comes up please click on System Setup. Which will bring up the following screen:
Here click New which will bring up the setup screen below:
On the System Setup screen you have to select the folder that contains the system files, which for our tutorial resides in SpecstractorFolder/tutorial/cruiseSimplified. This is a simplified cruise control system based on the one that comes bundled with Reactis in the folder ReactisInstallationFolder/examples/R2013a/.
Next select the Simulink model of the system SpecstractorFolder/tutorial/cruiseSimplified/tutorial.slx. After selecting the system the Extractor will parse the model file and its inputs and outputs appear in the lists below:
The parser just extracts the input and output blocks of the system. Some of the outputs can be instrumentations of internal states of the system. In this case the output oldActive is such an instrumentation output and has to manually moved to the Inports list by clicking on it and then clicking on the <- red arrow pointing left.
To finish up, select the rsi file SpecstractorFolder/tutorial/cruiseSimplified/tutorial.rsi and the abstraction file SpecstractorFolder/tutorial/cruiseSimplified/abstractions.abs and press the Save button. This will create the file SpecstractorFolder/tutorial/cruiseSimplified/tutorial.rsys which we will use in the next step.
Click the Back button to return to the main screen and then press the Run button which will bring you to a screen with an empty list:
Press the Add button and in the popup window choose the file we created in the System Setup step SpecstractorFolder/tutorial/cruiseSimplified/tutorial.rsys. The screen will change again and the settings for the Extractor execution will appear:
For this example we are supplying manual abstractions and we are therefore using the FP-Growth algorithm. For an example that uses the Range Miner algorithm please press here.
The test generation settings are automatically set to 100/1000/20000 but if you like you can change the number/length of random tests and the number of targeted steps. Before starting the extraction process you have to choose an experiment folder. To do so press the folder button on the top right. Warning: Choose an empty folder since existing files in the folder can be deleted. To start the extraction press the Execute button on the top which will bring up the execution screen.
After the extraction process has finished it will open the folder of the final iteration that contains the Requirements.txt file with the resulting Invariants. To analyze the file either open it in a text editor or load it in the [Insight] tool.