Git Product home page Git Product logo

dynamicprogramslicing's People

Contributors

dmholtz avatar

Stargazers

 avatar

Watchers

 avatar

dynamicprogramslicing's Issues

Trimmer.js crashes at IfStatements

If the consequent node of an IfStatement is null, the trimmer crashes.

Example (in case only line 1 is included in the slice and line 2 should be excluded):

if (x>0)
    x++;

Incorrect slice for implict attribute-uses

The slicer produces wrong results, if implicit uses of object attributes occur.

If the slicing criterion is of type object, all of its attributes are implicitly accessed. However, the current implementation does not reflect this implicit behaviour and produces an incorrect slice.

Example: testcases/progress2/e2_in.js (here simplified):

function sliceMe() {
    var a = { course: 'Program Analysis' };
    a.semester = 'Winter';
    return a; // slicing criterion
}
sliceMe();

Expected slice:

function sliceMe() {
    var a = { course: 'Program Analysis' };
    a.semester = 'Winter';
    return a; // slicing criterion
}
sliceMe();

However, the analysis does not include the putField statement of line 3 and computes a wrong slice:

function sliceMe() {
    var a = { course: 'Program Analysis' };
    return a; // slicing criterion
}
sliceMe();

Track only relevant branching points

Yet, all branching points are tracked even if both ways are not included in the slice.

Example:

function sliceMe() {
    var x = 0;
    var y = 1;
    if (y) {
        y++;
    }
    else {
        y--;
    }
    return x;
}
sliceMe();

The predicted slice is: Note that the branching points remains and even data dependencies are further propagated, which are not relevant for computing the slice:

function sliceMe() {
    var x = 0;
    var y = 1;
    if (y) {
    }
    return x;
}
sliceMe();

However, the ideal slice is:

function sliceMe() {
    var x = 0;
    return x;
}
sliceMe();

Tracking data dependencies of SwitchStatement's discriminant node

This issue has two effects:

Syntactical issue: The discriminant node is not included in the AST, as there is no callback which adds the line of switch (...) to the keepLines set in the dataflow-analysis.js script

Semantical isuuse: Data dependencies of the discriminant node are not tracked either.

Test Exceptions

Includes throws, tryand single and multiple uses of catch and finally

Excluding refused cases

Given a program like, which is called with x=1:

switch(x) {
  case 0: // refused case, but callback was triggered
    bar();
    break;
  case 1: // refused case, but callback was triggered
  case 2: // callback was NOT triggered
     foo(); // slicing criterion
     break;
}

The slicer does not exclude case 0.

How to handle declarations with unused definitions

Given a JS program like

var x = 9;
x = 10;
console.log(x); // slicing criterion

Should the unnecessary define in line 1 be included?

var x = 9;
x = 10;
console.log(x); // slicing criterion

or instead removed?

var x;
x = 10;
console.log(x); // slicing criterion

Test Arrays

Initialization of Arrays and the use of methods, which do not change the array, e.g. lastIndexOf

Missing break statements

The breakstatement is not included in the slice.

Jalangi does not provide any callbacks for explicitly handling break statements.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.