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

jGenProg cannot fix a bug with a test suite, but fix it correctly with a subset of the test suite #299

Open Amirfarhad-Nilizadeh opened 3 years ago

Amirfarhad-Nilizadeh commented 3 years ago

Three buggy programs in a BuggyJava+JML dataset can be repaired correctly with a test suite using jGenProg in about 50 seconds. However, when I add some more tests to the test suite, then after around 45 seconds, it cannot generate a patch (correct or overfitted).

What can be the reason?

Is there any time limitation for running a candidate patch to validate it in the Astor framework? Maybe this time is not enough to run the larger test suite for each candidate patch. Does any option consider managing the time to execute a candidate patch?

martinezmatias commented 3 years ago

Hi @Amirfarhad-Nilizadeh

when I add some more tests to the test suite, then after around 45 seconds, it cannot generate a patch

I should see the log to see what is happening. Could you create a PR with a test case that exercise that behaviour.

Does any option consider managing the time to execute a candidate patch?

Yes, see, for example, here: https://github.com/SpoonLabs/astor/blob/master/docs/arguments.md#validation

Thanks Matias

Amirfarhad-Nilizadeh commented 3 years ago

Hi @martinezmatias Thank you for your quick response. You can find a buggy program with two different test suites (the smaller test suite is the subset of the larger one) and reports of jGenProg for each one.

jGenProg can repair the buggy program with the smaller ones but cannot fix it with the larger test suite. Also, the program has only one bug, which is in line 245.

report.zip

Amirfarhad-Nilizadeh commented 3 years ago

Hi @martinezmatias

Did you have a chance to look at attached examples in the zip file? Please let me know if I should provide them differently.

Thank you for your time and consideration in advance.

Best Wishes, Amirfarhad

martinezmatias commented 3 years ago

Hi @Amirfarhad-Nilizadeh

Could you create a PR with a failing test case that exercise this example you attach?

Regards Matias