README.md 4.46 KB
Newer Older
Tanwir Ahmad's avatar
Tanwir Ahmad committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
# Model-based Monitoring from Åbo Akademi (MBMÅA) tool
The MBMÅA tool uses UPPAAL timed automata for creating the behavioral model of the system under test. The UPPAAL model can be edited using a graphical user interface. The test adapter for MBMÅA tool can be specified using Jython. The model can be simulated and verified using UPPAAL with respect to the requirements of the system. MBMÅA can analyze execution traces specified in textual format. 

## Installation
The tool can be executed on Windows and Linux machines. 

1. Download and install Jython 2.5.4
http://www.jython.org/downloads.html

1. Java SE Runtime Environment 6 or later
http://www.oracle.com/technetwork/java/javase/downloads

1. Download the binaries of the Spread from
http://www.spread.org/download.html

Unpack the spread-bin-4.x.tar.gz file into the target directory and go to bin directory to run the Spread

1. Download TRON 1.5 from
http://people.cs.aau.dk/~marius/tron/download.html#download

1. Download Dtron 4.9.1
http://dijkstra.cs.ttu.ee/~aivo/dtron/download/

1. Set an environment variable TRON_HOME to the directory of UPPAAL TRON
e.g., 
```
export TRON_HOME=/home/test/uppaal-tron-1.5-linux 
```

## Usage

- Select path for log file: edit Adapter/config.py or OldAdapter/config.py
- Execute startup.bat

- Four MSDOS Command Prompt windows appear

- Select window called Adapter (“having text “press any key to start adapter….”) and press any key


### Configurations

```
$ java -jar dtron.jar -f <FILE> -o <UNITS> [-s <HOST>]  -u <MSEC> -p <PORT>     
-f,--file <FILE>        UPPAAL model file to be used. 
-o,--timeout <UNITS>    TRON timeout in timeunits. 
-s,--spread <HOST>      Spread host addres, with port (default: localhost) 
-u,--timeunit <MSEC>    TRON timeunit in msec. 
-p,--port <PORT>        UPPAAL Reporter port (default: 666)
```
            
#### Test Tracker

```
$ java -jar TestTracker-0.2.jar -m <file> -coverageTypes <types> -t <templates> -outputFile <file> -details
 -channel <channel>                 Channel to listen for messages on 
 -coverageTypes <coverageTypes>     Requirement types, separated by ,. Available types are: edge, edge-pair, join-pointW, join-pointS, user-story 
 -details                         	Set this flag to print a more detailed coverage report. 
 -fileOutput                      	Enable reporting to file 
 -help                            	Print this message and exit. 
 -m <modelFile>                   	UPTA model file with counters on edges. 
 -outputFile <outputFile>         	File name for coverage output, use auto for automatic file name generation
 -silent                          	No output to console 
 -spread <spread>                 	Host of the spread network. (default: localhost) 
 -t <templates>                   	Provides templates names for test coverage. Separated by ',' 
 -time <time>                     	Time intervall of coverage output in ms. (default: 5000) 
```

**Example**
```
$ java -jar TestTracker-0.2.jar -m CLIC.xml -coverageTypes user-story -t IOAC -outputFile report.txt -details
```
where:
- m CLIC.xml                   	UPTA model file with counters on edges. 
- coverageTypes user-story		Coverage criteria is user-story
- t IOAC	                   		IOAC template for test coverage.
- outputFile <outputFile>        File name for coverage output, use auto for automatic file name generation 
- details                       Set this flag to print a more detailed 	coverage report. 



#### Adapter

1. Set following parameters in *config.py* file to configure the adapter:
```
speed_factor	adjust the time scaling (default :1 )
log_path		path of BTS log file
counter_timeout	counter timeout
```
1. Dtron jar file should be set in the python path.
1. Run adapter with the following command:
```
$ jython -Dpython.path=dtron-4.9.1.jar -Dpython.cachedir=/tmp/jython Main.py
```
where:
- Dpython.path: set the path for dtron library
- Dpython.cachedir: the directory to use for caches 
- Main.py: start the adapter

#### Spread

1. Run Spread with following command:
```
$ spread -n localhost
```

#### DTRON

1.  Run dtron to simulate the model:
```
$ java -jar dtron-4.9.1.jar -f CLIC.xml -o 10000 -u 1000000 -p 6666
```
where:
- jar dtron.4.12.jar: dtron java executable file
- f CLIC.xml: UPTA model file 
- o 10000: simulation timeout in timeunit
- u 1000000: defined here that 1 timeunit should be equal to 1 second
- p 6666: UPPAAL Reporter port

*PS: There is no need to specify the Spread host address if the spread and dtron are running on same machine.*