Skip to content
Shafiul Azam Chowdhury edited this page Dec 12, 2019 · 28 revisions

SLEMI: Finding Compiler bugs in Simulink via Equivalence Modulo Input (EMI)

Our paper on EMI-based mutation of Simulink models to find compiler bugs has been accepted for ICSE 2020! Checkout the resultant SLEMI tool which is both efficient than SLforge in finding bugs and also found more bugs than SLforge, using similar compute.

Curated Collection of Simulink Models for Model-based Empirical Studies

Our coprus of public Simulink models

To benefit empirical studies of model-based cyber-physical systems (CPS) and commercial CPS development tool chains (e.g. Matlab/Simulink), we are developing and maintaining the by-far largest corpus of freely available Simulink models, containing over 1,000 models.

SLforge: Automatically Finding Bugs in a Commercial Cyber-Physical Systems Development Tool

SLforge generates random, valid Simulink models to use them for differential testing of MATLAB/Simulink, the popular commercial CPS development tool chain from MathWorks. The tool parses modeling specifications from the vendor-provided documentations, and utilizes them to construct valid Simulink models which can be used for randomized differential testing of Simulink. Our technique has already found 10+ confirmed bugs in the Simulink tool chain.

Tool implementation for Simulink is located in the slsf directory.

Getting SLforge

Clone using git to get the latest version and the correct third-party dependencies. If you have git installed, invoke the followings in a shell:

git clone https://github.com/verivital/slsf_randgen.git
cd slsf_randgen
git submodule init
git submodule update

See requirements at the end of this page.

Running

Recent News

  • SLEMI: EMI-based mutation of Simulink models to find compiler bugs in Simulink. Our paper has been accepted for ICSE 2020!
  • SLforge++: now SLforge supports utilizing many-core parallelization out-of-the-shelf!
  • Our paper Automatically Finding Bugs in a Commercial Cyber-Physical System Development Tool Chain with SLforge has been accepted at 40th International Conference on Software Engineering (ICSE) 2018; ICSE 2018 Artifacts
  • SLforge has received third prize in the prestigious ACM/Microsoft Student Research Competition at 40th International Conference on Software Engineering (ICSE) 2018.
  • Presented poster Understanding and Improving Cyber-Physical System Models and Development Tools at the Doctoral Symposium at 40th International Conference on Software Engineering (ICSE) 2018
  • Presented our paper A Curated Corpus or Simulink Models for Model-based Empirical Studies at 4th International Workshop on Software Engineering for Smart Cyber-Physical Systems (SEsCPS), co-located at 40th International Conference on Software Engineering (ICSE) 2018
  • Presented in the students' presentation session and tools demonstration session at Seventh Summer School on Formal Techniques, by Stanford Research Institute (SRI) International, May 2017
  • Presented demo Fuzzing Cyber-Physical Systems Development Environments with CyFuzz in HSCC 2017
  • Presented at the 6th Workshop on Design, Modeling, and Evaluation of Cyber Physical Systems (CyPhy'16)
  • ICSE 2018 Artifacts
  • Tool demo (video)

Contribute

We welcome new contributors! Please check out getting started guide.

Requirements

  • Windows/Linux (tested on Ubuntu and CentOS)
  • MATLAB with Simulink version R2017a/R2018a
  • Parallel Computing Toolbox for parallel generation of models using multiple CPUs.

Optional requirements:

  • Python3: if you want to detect crash-bugs. Python2 might not work. Also requires Linux (We have tested the scripts in Ubuntu 14.04+) to run the Python scripts, as we have not tested them in other platforms.
  • https://embed.cs.utah.edu/csmith/: if you want to generate custom blocks (see below for instructions)

Building and installing Csmith (required if you want to create custom blocks using s-functions)

  • Please clone source code from (customized Csmith)[ttps://github.com/shafiul/csmith].
  • To build csmith, follow official doc at https://embed.cs.utah.edu/csmith/
  • If using Ubuntu: You need m4 library (apt-get it)
  • Once built, the Csmith binary is located inside src directory.
  • We have to ensure csmith executable and include directory is in operating system path (see below).

Set up environment variables (in Linux)

Adding following in your bash.rc will add Csmith and MATLAB executable in OS path:

export CSMITH_PATH=/path/to/csmith
export PATH=$PATH:/$CSMITH_PATH/src:path/to/matlab/binary
export C_INCLUDE_PATH=$CSMITH_PATH/runtime
export CSMITH_HOME=$CSMITH_PATH # Needed for running csmith test driver