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
207 stars 106 forks source link

Incorrect operation on Chart-3, Chart-7, Chart-15 #334

Open martinezmatias opened 3 years ago

martinezmatias commented 3 years ago

When running jGenProg with Flacoco mode, we have an error. With Gzoltar it does not appear cause the order of the suspicious is different and it finds a patch first.

Link to CI: https://github.com/martinezmatias/astor/runs/3676645455?check_suite_focus=true

I suspect that the problem is that Flacoco now includes super calls, while GZoltar does not include super call in the suspicious list.

429630] ERROR AstorCoreEngine - Error at generation 444
spoon.SpoonException: cannot insert a statement before a super or this invocation.
spoon.SpoonException: cannot insert a statement before a super or this invocation.
    at spoon.support.reflect.code.CtStatementImpl.insertBefore(CtStatementImpl.java:69)
    at spoon.support.reflect.code.CtStatementImpl.insertBefore(CtStatementImpl.java:57)
    at spoon.support.reflect.code.CtInvocationImpl.insertBefore(CtInvocationImpl.java:104)
    at fr.inria.astor.approaches.jgenprog.operators.InsertBeforeOp.applyChangesInModel(InsertBeforeOp.java:27)
    at fr.inria.astor.core.entities.OperatorInstance.applyModification(OperatorInstance.java:177)
    at fr.inria.astor.core.solutionsearch.AstorCoreEngine.applyNewMutationOperationToSpoonElement(AstorCoreEngine.java:852)
    at fr.inria.astor.core.solutionsearch.EvolutionarySearchEngine.applyNewOperationsToVariantModel(EvolutionarySearchEngine.java:405)
[429633] INFO AstorCoreEngine - Time Repair Loop (s): 112.021
    at fr.inria.astor.core.solutionsearch.EvolutionarySearchEngine.createNewProgramVariant(EvolutionarySearchEngine.java:217)
[429633] INFO AstorCoreEngine - generationsexecuted: 444
    at fr.inria.astor.core.solutionsearch.EvolutionarySearchEngine.processGenerations(EvolutionarySearchEngine.java:148)
    at fr.inria.astor.core.solutionsearch.EvolutionarySearchEngine.startEvolution(EvolutionarySearchEngine.java:70)
    at fr.inria.main.evolution.AstorMain.run(AstorMain.java:189)
    at fr.inria.main.evolution.AstorMain.execute(AstorMain.java:233)
    at fr.inria.astor.test.D4JWorkflowTestSingle.runComplete(D4JWorkflowTestSingle.java:320)
    at fr.inria.astor.test.D4JWorkflowTestSingle.runCompleteJGenProg(D4JWorkflowTestSingle.java:281)
    at fr.inria.astor.test.D4JWorkflowTestSingle.testChart3(D4JWorkflowTestSingle.java:135)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
    at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
    at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:254)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:149)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[429633] WARN AstorCoreEngine - ----SUMMARY_EXECUTION---