dmholtz / dynamicprogramslicing Goto Github PK
View Code? Open in Web Editor NEWDynamic program analysis for intra-procedural slicing of JavaScript programs
License: MIT License
Dynamic program analysis for intra-procedural slicing of JavaScript programs
License: MIT License
Test string methods
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++;
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();
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();
Including delete
, typeof
Especially the lazy evaluation of &&
and ||
to avoid conflicts with branching.
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.
Includes throws
, try
and single and multiple uses of catch
and finally
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
.
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
Initialization of Arrays and the use of methods, which do not change the array, e.g. lastIndexOf
do-while
Use a built-in class such as Date
The break
statement is not included in the slice.
Jalangi does not provide any callbacks for explicitly handling break statements.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.