Echtzeitsysteme / java-refactoring-ttc

Object-oriented Refactoring of Java Programs using Graph Transformation (TTC'2015)
0 stars 0 forks source link

Implementation of specific class expected but is not implemented #19

Closed GerardPaligot closed 9 years ago

GerardPaligot commented 9 years ago

I would like to know what is the meaning of this message from ARTE:

Implementation of specific class expected but is not implemented. (false-negative)

Because my method of the refactoring returns true and prints well refactored files.

Thanks in advance!

SvenPeldszus commented 9 years ago

At this point a check whether a specific child extends a a specific parent failed.

I assume this appeared in a Create Superclass test case and the inheritance relations have not been updated by the refactoring.

In this case the program is still executable but nothing changed, except for a new but unused class.

The failure message is maybe not the best one.

GerardPaligot commented 9 years ago

My conclude was the same but when I print the result in another directory to see generated sources, I see that child classes extends parent class:

package example04;

public class ChildClass1 extends example04.parent {
    public static void main(java.lang.String[] args) {
    }

    public void method() {
        java.lang.System.out.println("Hello World!");
    }
}

package example04;

public class ChildClass2 extends example04.parent {
    public void method() {
        java.lang.System.out.println("Hello World!");
    }
}

package example04;

public class parent {}

I assume this appeared in a Create Superclass test case

Yep. Sorry, I forgot to specify it.

SvenPeldszus commented 9 years ago

Maybe we are not able to check the explicit given fully classified name correctly. I will check this.

GerardPaligot commented 9 years ago

Thanks. I'm waiting them because I can't test this refactoring for now.

SvenPeldszus commented 9 years ago

I have pushed a new version of ARTE which now checks this correct.

GerardPaligot commented 9 years ago

I've updated my clone of java-refactoring-ttc project to get the new version of ARTE but the bug is still there.

execute --test pub_exs1_1

####################################################################
####################   Executing public tests.  ####################
####################################################################

Executing test case: "pub_exs1_1"
    Description:
        EXS-POS: Create a superclass for two child classes not explicitly extending an other class.

SUCCESS: The java program has been compiled.

    Output of execution before refactoring:

sssssssssssssss Triggering Program Graph Generation ssssssssssssssss
avr. 23, 2015 9:15:34 AM fr.inria.SpoonTtc createProgramGraph
INFOS: parse /var/folders/yd/kdk6_3wn4fvc71sblyjpgnn80000gn/T/tmp_ttc/paper-example04
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

ssssssssssss  Triggering Extract Superclass Refactoring ssssssssssss
avr. 23, 2015 9:15:34 AM fr.inria.SpoonTtc applyCreateSuperclass
INFOS: create superclass: example04.parent
avr. 23, 2015 9:15:34 AM fr.inria.SpoonTtc applyCreateSuperclass
INFOS: change child: example04.ChildClass1
avr. 23, 2015 9:15:34 AM fr.inria.SpoonTtc applyCreateSuperclass
INFOS: change child: example04.ChildClass2
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

ssssssssssss  Triggering Synchronization with Java Code ssssssssssss
avr. 23, 2015 9:15:34 AM fr.inria.SpoonTtc synchronizeChanges
INFOS: will print to /var/folders/yd/kdk6_3wn4fvc71sblyjpgnn80000gn/T/tmp_ttc/paper-example04/src
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

FAILURE: Implementation of specific class expected but is not implemented. (false-negative)

    Output of execution after refactoring:

SUCCESS: Output before and after refactoring are equal.

--------------------------------------------------------------------
FAILURE: Test case "pub_exs1_1" has not been executed successfully.
The solution needed 0,002 seconds for execution. 
--------------------------------------------------------------------

####################################################################
####################  Summary of test results.  ####################
####################################################################

The test case "pub_exs1_1" was executed with status "FAILURE".
SvenPeldszus commented 9 years ago

At least this test should work as I've tested it with your solution.

Can you Plesse send me the jar-File oft your solution.

GerardPaligot commented 9 years ago

There: https://www.dropbox.com/s/rzxb2o1y07ehg6h/ttc-competition-1.0-SNAPSHOT-jar-with-dependencies.jar?dl=0

or mvn clean assembly:assembly on this project.

SvenPeldszus commented 9 years ago

On my system your solution runs successful

####################################################################
####################   Executing public tests.  ####################
####################################################################

Executing test case: "pub_exs1_1"
    Description:
        EXS-POS: Create a superclass for two child classes not explicitly extending an other class.

SUCCESS: The java program has been compiled.

    Output of execution before refactoring:

sssssssssssssss Triggering Program Graph Generation ssssssssssssssss
Apr 23, 2015 10:09:29 AM fr.inria.SpoonTtc createProgramGraph
INFORMATION: parse /tmp/tmp_ttc/paper-example04
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

ssssssssssss  Triggering Extract Superclass Refactoring ssssssssssss
Apr 23, 2015 10:09:30 AM fr.inria.SpoonTtc applyCreateSuperclass
INFORMATION: create superclass: example04.parent
Apr 23, 2015 10:09:30 AM fr.inria.SpoonTtc applyCreateSuperclass
INFORMATION: change child: example04.ChildClass1
Apr 23, 2015 10:09:30 AM fr.inria.SpoonTtc applyCreateSuperclass
INFORMATION: change child: example04.ChildClass2
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

ssssssssssss  Triggering Synchronization with Java Code ssssssssssss
Apr 23, 2015 10:09:30 AM fr.inria.SpoonTtc synchronizeChanges
INFORMATION: will print to /tmp/tmp_ttc/paper-example04/src
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

    Output of execution after refactoring:

SUCCESS: Output before and after refactoring are equal.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SUCCESS: Test case "pub_exs1_1" has been executed SUCCESSFULLY.
The solution needed 0,02 seconds for execution. 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

####################################################################
####################  Summary of test results.  ####################
####################################################################

The test case "pub_exs1_1" was executed with status "SUCCESS".

Summary of the test results:
+ 100% of the test cases were executed successfull
? 0% of the test cases ended in a warning but were still successful.
- 0% of the test cases resulted in a failure.

I think this problem and your second problem are related and are due to some MAC specific reasons.

I will try to fix it.

SvenPeldszus commented 9 years ago

I have created a version of ARTE with additional debug messages for you.

Can you please execute the test cases of your two issues and post the results.

https://www.dropbox.com/s/ojq7augwif3exgn/ARTEDebugGerardPaligot.zip?dl=0

GerardPaligot commented 9 years ago

With this version, the test is green:

execute --test pub_exs1_1

####################################################################
####################   Executing public tests.  ####################
####################################################################

Executing test case: "pub_exs1_1"
    Description:
        EXS-POS: Create a superclass for two child classes not explicitly extending an other class.

SUCCESS: The java program has been compiled.

    Output of execution before refactoring:

sssssssssssssss Triggering Program Graph Generation ssssssssssssssss
avr. 23, 2015 11:02:01 AM fr.inria.SpoonTtc createProgramGraph
INFOS: parse /var/folders/yd/kdk6_3wn4fvc71sblyjpgnn80000gn/T/tmp_ttc/paper-example04
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

ssssssssssss  Triggering Extract Superclass Refactoring ssssssssssss
avr. 23, 2015 11:02:01 AM fr.inria.SpoonTtc applyCreateSuperclass
INFOS: create superclass: example04.parent
avr. 23, 2015 11:02:01 AM fr.inria.SpoonTtc applyCreateSuperclass
INFOS: change child: example04.ChildClass1
avr. 23, 2015 11:02:01 AM fr.inria.SpoonTtc applyCreateSuperclass
INFOS: change child: example04.ChildClass2
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

Print java program
Proces java file: /var/folders/yd/kdk6_3wn4fvc71sblyjpgnn80000gn/T/tmp_ttc/paper-example04/src/example04/ChildClass1.java
### Content:
> package example04;
> 
> public class ChildClass1 {
> 
>   public static void main(String[] args) {
>       // TODO Auto-generated method stub
> 
>   }
>   
>   public void method(){
>       System.out.println("Hello World!");
>   }
> 
> }
###
Proces java file: /var/folders/yd/kdk6_3wn4fvc71sblyjpgnn80000gn/T/tmp_ttc/paper-example04/src/example04/ChildClass2.java
### Content:
> package example04;
> 
> public class ChildClass2 {
> 
>   public void method(){
>       System.out.println("Hello World!");
>   }
> 
> }
###
ssssssssssss  Triggering Synchronization with Java Code ssssssssssss
avr. 23, 2015 11:02:01 AM fr.inria.SpoonTtc synchronizeChanges
INFOS: will print to /var/folders/yd/kdk6_3wn4fvc71sblyjpgnn80000gn/T/tmp_ttc/paper-example04/src
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

Print java program
Proces java file: /var/folders/yd/kdk6_3wn4fvc71sblyjpgnn80000gn/T/tmp_ttc/paper-example04/src/example04/ChildClass1.java
### Content:
> package example04;
> 
> 
> public class ChildClass1 extends example04.parent {
>     public static void main(java.lang.String[] args) {
>     }
> 
>     public void method() {
>         java.lang.System.out.println("Hello World!");
>     }
> }
> 
###
Proces java file: /var/folders/yd/kdk6_3wn4fvc71sblyjpgnn80000gn/T/tmp_ttc/paper-example04/src/example04/ChildClass2.java
### Content:
> package example04;
> 
> 
> public class ChildClass2 extends example04.parent {
>     public void method() {
>         java.lang.System.out.println("Hello World!");
>     }
> }
> 
###
Proces java file: /var/folders/yd/kdk6_3wn4fvc71sblyjpgnn80000gn/T/tmp_ttc/paper-example04/src/example04/parent.java
### Content:
> package example04;
> 
> 
> public class parent {}
> 
###

    Output of execution after refactoring:

SUCCESS: Output before and after refactoring are equal.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SUCCESS: Test case "pub_exs1_1" has been executed SUCCESSFULLY.
The solution needed 0,016 seconds for execution. 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

####################################################################
####################  Summary of test results.  ####################
####################################################################

The test case "pub_exs1_1" was executed with status "SUCCESS".

Summary of the test results:
+ 100 % of the test cases were executed successfull
? 0 % of the test cases ended in a warning but were still successful.
- 0 % of the test cases resulted in a failure.
SvenPeldszus commented 9 years ago

Have you also tested the hidden test cases with this version?

GerardPaligot commented 9 years ago

Have you also tested the hidden test cases with this version?

It doesn't work.

execute --test hidden_pum1_2

####################################################################
####################   Executing public tests.  ####################
####################################################################

There is no test case "hidden_pum1_2" in the test suite.
GerardPaligot commented 9 years ago

Can you update the jar file of this Git project with the custom version given here?

SvenPeldszus commented 9 years ago

There should already be a version online with all the changes from the custom version.

Sorry, I forgot to mention it here.

Especially in the test cases were some bug fixes, so please update to the public version.

GerardPaligot commented 9 years ago

Yep, everything is ok.