SpoonLabs / astor

Automatic program repair for Java with generate-and-validate techniques :v::v:: jGenProg (2014) - jMutRepair (2016) - jKali (2016) - DeepRepair (2017) - Cardumen (2018) - 3sfix (2018)
https://hal.archives-ouvertes.fr/hal-01321615/document
GNU General Public License v2.0
208 stars 106 forks source link

Error while building Astor with option #2 #203

Closed jeonyeohun closed 5 years ago

jeonyeohun commented 5 years ago

Hello,

I am trying to build Astor with option 2 by following your "Getting starting" for testing jGenProg and while I build Astor, I keep getting a following error at the stage of compiling and running bug example.

Environment:

Mac OS 10.15(19A583)
java version 1.8.0

Command: Yeoui-MacBookPro:Math-issue-280 yeohunjeon$ mvn clean compile test

Error:

Tests in error:
  testMath280(org.apache.commons.math.distribution.NormalDistributionTest)

Tests run: 1979, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  22.493 s
[INFO] Finished at: 2019-10-25T01:12:25+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.3:test (default-test) on project commons-math: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/yeohunjeon/Desktop/2019_2/ISEL/jGenProg/astor/examples/Math-issue-280/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

I assume that the failing tests in the example occur this error, but it looks very common sense to me that the Math-issue-280 should have an at least one failing test case since it is a collection of issues from Jira.

When I omitted the failing files, org.apache.commons.math.distribution.NormalDistributionTest and org.apache.commons.math.optimization.general.MinpackTest, the build was successfully done. However, in this case, I got an another error at the stage of an executing jGenProg with Math-issue-280.

Command: Yeoui-MacBookPro:Math-issue-280 yeohunjeon$ java -cp $(cat /tmp/astor-classpath.txt):target/classes fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test/ -binjavafolder /target/classes/ -bintestfolder /target/test-classes/ -location /Users/yeohunjeon/Desktop/2019_2/ISEL/jGenProg/astor/examples/Math-issue-280 -dependencies examples/Math-issue-280/lib

Error:

[INFO ] fr.inria.main.AbstractMain.determineSourceFolders(AbstractMain.java:973) - Source folders: [/Users/yeohunjeon/Desktop/2019_2/ISEL/jGenProg/astor/examples/Math-issue-280/src/java]
[INFO ] fr.inria.main.AbstractMain.determineSourceFolders(AbstractMain.java:992) - Source Test folders: [/Users/yeohunjeon/Desktop/2019_2/ISEL/jGenProg/astor/examples/Math-issue-280/src/test]
[INFO ] fr.inria.astor.core.setup.ProjectConfiguration.addLocationToClasspath(ProjectConfiguration.java:140) - Adding to classpath junit-4.4.jar
[INFO ] fr.inria.astor.core.solutionsearch.AstorCoreEngine.resolveTestsToRun(AstorCoreEngine.java:1368) - Test retrieved from classes: 212
[INFO ] fr.inria.astor.core.faultlocalization.gzoltar.GZoltarFaultLocalization.calculateSuspicious(GZoltarFaultLocalization.java:74) - -Executing Gzoltar classpath: /Users/yeohunjeon/Desktop/2019_2/ISEL/jGenProg/astor/./output_astor/AstorMain-Math-issue-280//bin//default from 212 classes with test cases
[INFO ] fr.inria.astor.core.faultlocalization.gzoltar.GZoltarFaultLocalization.searchSuspicious(GZoltarFaultLocalization.java:154) - Gzoltar fault localization: min susp value parameter: 0.1
[INFO ] fr.inria.astor.core.faultlocalization.gzoltar.GZoltarFaultLocalization.searchSuspicious(GZoltarFaultLocalization.java:174) - -gz-Adding classpath: [/Users/yeohunjeon/Desktop/2019_2/ISEL/jGenProg/astor/./output_astor/AstorMain-Math-issue-280//bin//default, /Users/yeohunjeon/Desktop/2019_2/ISEL/jGenProg/astor/examples/Math-issue-280/lib/, /Users/yeohunjeon/Desktop/2019_2/ISEL/jGenProg/astor/examples/Math-issue-280/lib/junit-4.4.jar]
[INFO ] fr.inria.astor.core.faultlocalization.gzoltar.GZoltarFaultLocalization.searchSuspicious(GZoltarFaultLocalization.java:226) - Gzoltar Test Result Total:1950, fails: 0, GZoltar suspicious 16451, with positive susp 0
[INFO ] fr.inria.astor.core.faultlocalization.gzoltar.GZoltarFaultLocalization.searchSuspicious(GZoltarFaultLocalization.java:234) - nr test results 1950
[INFO ] fr.inria.astor.core.faultlocalization.gzoltar.GZoltarFaultLocalization.searchSuspicious(GZoltarFaultLocalization.java:289) - Gzoltar found: 0 with susp > 0.1, we consider: 0
Exception in thread "main" java.lang.IllegalArgumentException: No suspicious gen for analyze
    at fr.inria.astor.core.faultlocalization.gzoltar.GZoltarFaultLocalization.calculateSuspicious(GZoltarFaultLocalization.java:100)
    at fr.inria.astor.core.faultlocalization.gzoltar.GZoltarFaultLocalization.searchSuspicious(GZoltarFaultLocalization.java:48)
    at fr.inria.astor.core.solutionsearch.AstorCoreEngine.calculateSuspicious(AstorCoreEngine.java:945)
    at fr.inria.main.evolution.AstorMain.createEngine(AstorMain.java:121)
    at fr.inria.main.evolution.AstorMain.run(AstorMain.java:175)
    at fr.inria.main.evolution.AstorMain.execute(AstorMain.java:235)
    at fr.inria.main.evolution.AstorMain.main(AstorMain.java:206)

Is there any possible advice to get breakthrough for this issue?

Regards Jeon

martinezmatias commented 5 years ago

Hi @jeonyeohun

I assume that the failing tests in the example occur this error, but it looks very common sense to me that the Math-issue-280 should have an at least one failing test case since it is a collection of issues from Jira.

The example, as you show, must have one failing/error test. That test "shows" the presence of the bug to be repair. So, it's ok to have that situation.

When I omitted the failing files, org.apache.commons.math.distribution.NormalDistributionTest

NormalDistributionTest must not be omitted because it's the test that exposes the bug to be repair. Consequently, when Astor runs the fault localization it cannot find any suspicious code:

 Gzoltar Test Result Total:1950, fails: 0, GZoltar suspicious 16451, with positive susp 0
[INFO ] fr.inria.astor.core.faultloc

Dont hesitate to write us if you have some issues with that.

Best Regards Matias