resess / Slicer4J

Slicer4J is an accurate, low-overhead dynamic slicer for Java programs.
MIT License
39 stars 17 forks source link

False positives by Slicer4J #28

Open shrBadihi opened 1 year ago

shrBadihi commented 1 year ago

While I was working with slicer4J I discovered the below two false positives in the slice (statements that are irrelevant to the criteria but exist in the slice).

Issue 1: performing backward slice from produce (line 11) should not include the statements related to sum (line 10).

image

In the slice-dependencies.log there is the below dependency which caused the statement depending on sum to be included in the slice: (testDebug:10) virtualinvoke $stack12.<java.io.PrintStream: void println(double)>(sum) <--data:java.lang.System.out-- testDebug:11

Issue 2: performing backward slice from line 22 should not include lines 1 and 2. In the slice-dependencies.log, these two lines are included in the slice because the control dependency of Func() (line 10) on them. Since C is depending on Func(), the lines 1 and 2 are eventually in the slice. This was the essence of the issue but I attached one of the defects4J cases (Math 37) which slicing from line 1054 in org.apache.commons.math.complex.ComplexTest includes lines 39 and 40 in this file. bug.zip

1: A = Func(1) 2: B = Func(2) 3: C = Func(3) .... 10: Func(){…} ... 20: Test(A, 10) 21: Test(B, 20) 22: Test(C, 30) ==> slicing critters