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

gcd example - Astor finds a solution, however continues to generate more variants #324

Open ssk1216 opened 3 years ago

ssk1216 commented 3 years ago

package gcd;

public class GCD {

public int computegcd(int a, int b) {
    if (a == 0) 
    {
        return a;
    }
    while (b != 0)
        if (a > b)
            a = a - b;else
            b = b - a;
    **return b;**  //  buggy statement
}

}

13:20:52 [main] INFO Line:452 AstorCoreEngine - -Found Solution, child variant #6

However it contnues to generate more variants , Why does that happen? Shouldn't it stop iterating

Also , couple of questions:

  1. If there are multiple suspicious statements with various suspicious value, which is the .java file in which a selection of these statements are done to create new variants.
  2. When there is a tie between the suspicious values, how is the choice done?
  3. Which .java writes the variant to the folder for saveall:true option (I am trying to check the various variants generated)