Skip to content

Commit d8abc39

Browse files
committed
refactoring
1 parent d6db870 commit d8abc39

File tree

3 files changed

+53
-131
lines changed

3 files changed

+53
-131
lines changed

src/main/java/TestCaseInfo.java

Lines changed: 0 additions & 131 deletions
This file was deleted.

src/main/java/instrumentor/JSASTInstrumentor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,8 @@ private void analyzeTestCodeFunctionCallNode(AstNode node) {
567567
if (testsFramework.equals("qunit")){
568568
if (targetNode.toSource().equals("QUnit.test") || targetNode.toSource().equals("test")){
569569
testCounter++;
570+
// add a new TestCaseInfo object
571+
TestCaseInfo t = new TestCaseInfo(testCounter);
570572
}
571573
if (targetNode.toSource().equals("QUnit.asyncTest") || targetNode.toSource().equals("asyncTest")){
572574
testCounter++;
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package instrumentor;
2+
3+
public class TestCaseInfo {
4+
private int testNumber;
5+
private String type; // {"async", "sync"}
6+
private int numFunCall; // number of unique function calls in the test case
7+
private int numAssertions;
8+
private int numObjCreation;
9+
private int numTriggers;
10+
11+
public TestCaseInfo(int testNumber){
12+
this.testNumber = testNumber;
13+
}
14+
15+
public int getTestNumber() {
16+
return testNumber;
17+
}
18+
public void setTestNumber(int testNumber) {
19+
this.testNumber = testNumber;
20+
}
21+
public String getType() {
22+
return type;
23+
}
24+
public void setType(String type) {
25+
this.type = type;
26+
}
27+
public int getNumFunCall() {
28+
return numFunCall;
29+
}
30+
public void setNumFunCall(int numFunCall) {
31+
this.numFunCall = numFunCall;
32+
}
33+
public int getNumAssertions() {
34+
return numAssertions;
35+
}
36+
public void setNumAssertions(int numAssertions) {
37+
this.numAssertions = numAssertions;
38+
}
39+
public int getNumObjCreation() {
40+
return numObjCreation;
41+
}
42+
public void setNumObjCreation(int numObjCreation) {
43+
this.numObjCreation = numObjCreation;
44+
}
45+
public int getNumTriggers() {
46+
return numTriggers;
47+
}
48+
public void setNumTriggers(int numTriggers) {
49+
this.numTriggers = numTriggers;
50+
}
51+
}

0 commit comments

Comments
 (0)