Welcome. This repository contains implementation for our paper
Title: MINTS: Unsupervised Temporal Specification Miner
Conference: International Conference on Software Quality, Reliability, and Security, 2021
- Build a Time Automaton (TA) using event-time series trace.
- Extract Dominant Properties from the TA
- Extract Temporal Properties from the TA
- Provide capability for event prediction using TA and prediction_trace
OS (tested on): Ubuntu 18.04.5 LTS x86_64
System Spec (tested on) Intel i7-2630QM (8) @ 2.900GHz, 8 GB DDR3, 256 GB SSD
Language: Python 3.6.11
Libraries
1. rstr (For synthetic trace generation)
2. pyvis (Interactive Python Visualizer)
3. graphviz pygraphviz (For drawing the Timed Automaton)
4. seaborn, tabulate (For ploting result)
The above packages can be silently installed using
!pip install -q graphviz seaborn tabulate rstr pyvis
!apt-get -qq install graphviz graphviz-dev -y && pip install -q pygraphviz;
├── Dataset [Contains the Dataset for pattern extraction. Sample trace files provided]
│ ├── synthetic_trace2.csv
│ └── synthetic_trace.csv
├── LICENSE
├── PatternMiner [Dominant and Temporal Pattern Miners]
│ ├── DominantPatternMiner.py
│ ├── TemporalPatternMiner.py
│ └── TemporalPatternTemplate.py
├── Predictor [Event Predictor]
│ ├── EventPredictor.py
├── README.md
├── Result [Results are stored in this folder. Some common files are dominant/temporal pattern csv, State diagram, Transition diagram and Event Prediction plot]
│ ├── dominant_patterns.csv
│ ├── event_prediction_plot.png
│ ├── State diagram.gv
│ ├── State diagram.gv.png
│ ├── temporal_patterns.csv
│ ├── Transition diagram.gv
│ └── Transition diagram.gv.png
├── temporalMiner.py [Sample file providing example on the usage of the model]
├── TimedTrie.py [Base class for TimedTrie]
├── TrieNode.py [Base class for TrieNode]
└── Utility [Util folder]
├── SampleTraceUtil.py
├── TimedTrieVisualizer.py
└── Util.py
8 directories, 12 files
Sample file (temporalMiner.py
) is divided into 5 parts. They are as follow:
- Necessary imports, reading trace file, preprocessing
- Build Model
- Extract Pattern (Dominant and Temporal)
- Event Prediction (using a trace for which the next subsequent event has to be predicted)
- Visualize the Timed Automaton.
- Save result (miscellaneous)
For quick usage, the following command can be executed
python temporalMiner.py --inputpath Dataset/synthetic_trace.csv
or
python temporalMiner.py --inputpath Dataset/hexcopter_trace.csv
For additional tweaking with the model, please see temporalMiner.py
. It contains more description on the how to use each module. Major building blocks are to
- Read trace file
- Build Timed Trie Model
- Extract patterns
- Visualize
- Perform event prediction (if there is a necessity to predict the next subsequent event)
Five interesting dominant properties extracted from the Hexcopter trace (hexcopter_trace.csv
)
Few Temporal properties extracted from the Hexcopter trace (hexcopter_trace.csv
)
[Please note, with every execution the results will change however it should follow the below trend. The following results are an average of 10 trials]
Restricted License. Cannot be replicated or used without prior authorization.