ksen007 / jalangi2analyses

Analyses repository for Jalangi2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic Analyses

Wiki | Configuring | Checkers | Develop | Mailing List

This repository contains dynamic analyses for JavaScript code based on Jalangi2. It mainly consists of analyses ported from JITProf and DLint.

What is DLint?

DLint is a tool for dynamically checking JavaScript coding practices.

Briefly speaking, JSHint, JSLint and ESLint uses static analysis (scan the code) to find bad coding practices, while DLint uses dynamic analysis (by analysing runtime behavior) to do the detection.

By analyzing runtime information, DLint is capable of capturing violations of coding practices missed by those static analysis tools.

For more details, a Wiki page is available.

Academic Resources: Preprint in ISSTA'15 | Presentation Slides | Technical Report | Bibtex

What is JITProf?

JITProf is a tool that tells you which part of your JavaScript code may be slow on JIT-engine. We call those slow code JIT-unfriendly code.

For more details, see this GitHub repository.

Academic Resources: Preprint in ESEC/FSE'15 | Presentation Slides | Technical Report | Bibtex

Visualizing JIT-unfriendly Code: For more details, see here.

Install

Make sure that your computer meets these requirements.

To run analyses with Jalangi2 on real-world websites, you need to install:

To install, type the following commands in your console:

git clone https://github.com/ksen007/jalangi2analyses.git
cd jalangi2analyses
npm install

Usage

All the following commands should be executed under directory jalangi2analyses/.

Run DLint in Browser

node src/js/command/run.js dlint

This command sets a web proxy, open a web page with your browser (e.g., Chrome or Safari). Click the Jalangi button on your web page to view the analysis result.
To close the web proxy, simply rerun the above command (See Step-by-Step Guide).

Run Unit Tests for DLint

node tests/dlint/runAllTests.js 

Run JITProf in Browser

node src/js/command/run.js jitprof

This command sets a web proxy, open a web page with your browser (e.g., Chrome or Safari). Click the Jalangi button on your web page to view the analysis result.
To close the web proxy, simply rerun the above command (See Step-by-Step Guide).

Note: To run JITProf and DLint on node.js, see this Wiki page.

Configuration

To configure which analysis module to be used, see this Wiki page.

Directory Structure

The directory structure and purpose is listed as follows:

jalangi2analyses
    |
    + -- doc                  # documentation files and resources
    |
    + -- tests                # all test cases for DLint and JITProf
    |
    + -- config
    |       |
    |  (1)  + -- dlint        # configuration file for DLint
    |       |
    |  (2)  + -- JITProf      # configuration file for JITProf
    |
    + -- scripts              # some bash scripts ussed in this project
    |
    + -- src/js
    	  |
    	  + -- command        # command script used in the terminal (or console)
          |
          + -- analyses
                |
       (3)      + -- dlint    # runtime checkers (Jalangi2 analyses) for DLint
                |
       (4)      + -- jitprof  # runtime checkers (jalangi2 analyses) for JITProf
                |
                + -- utils    # built-in analyses of DLint and JITProf

To add a new analysis for DLint, first add a few analysis file that overides the Jalangi2 callbacks in directory (3); then add add the file name of the new analysis to the configuration file in directory (1). Likewise, to add a new analysis for JITProf, first add a few analysis file that overides the Jalangi2 callbacks in directory (4); then add add the file name of the new analysis to the configuration file in directory (2).

License

DLint and JITProf is distributed under the Apache License.

About

Analyses repository for Jalangi2


Languages

Language:JavaScript 99.4%Language:Python 0.4%Language:Shell 0.3%