jeffoffutt / muJava

Mutation system for Java programs, including OO mutation operators.
Apache License 2.0
66 stars 43 forks source link

Bug IOR operator #9

Closed leofernandesmo closed 2 years ago

leofernandesmo commented 7 years ago

The IOR operator should rename a overriding method and update method calls. But it is creating a new method with same body and a different name.

Eg. Original

public class ClassId_1{
    public  long methodid_1( long a )
    {
        return methodid_0( 2 );
    }

    public  long methodid_0( int a ){
        if (fieldid_0 < fieldid_1) {
            return fieldid_0 * fieldid_1;
        }
        return 0;
    }
    private long fieldid_1 = 10;
    protected int fieldid_0 = 11;
}

And the mutant...

public class ClassId_1{
    public  long methodid_1( long a ){
        return methodid_0_( 2 );
    }
    public  long methodid_0( int a ){
        if (fieldid_0 < fieldid_1) {
            return fieldid_0 * fieldid_1;
        }
        return 0;
    }
    public long methodid_0_( int a ){
        if (fieldid_0 < fieldid_1) {
            return fieldid_0 * fieldid_1;
        }
        return 0;
    }
    private long fieldid_1 = 10;
    protected int fieldid_0 = 11;
}