xgdsmileboy / SimFix

Automatically fix programs by leveraging existing patches from other projects and similar code snippets from the faulty project.
GNU General Public License v2.0
201 stars 27 forks source link

Generation of subsequent patches #10

Closed Wooza closed 4 years ago

Wooza commented 4 years ago

Hello,

as far as I understood the SimFix paper, the evaluation of SimFix was performed on the first generated patch which passed the test suite. I would like to take a look at the patches which are generated beyond that. Can the configuration switch Constant.PATCH_NUM be increased to achieve the generation of subsequent patches?

best regards Florian

xgdsmileboy commented 4 years ago

Sure, please refer to https://github.com/xgdsmileboy/SimFix/blob/master/src/cofix/main/Repair.java#L273

Wooza commented 4 years ago

Alright, thanks for your quick reply.

Wooza commented 4 years ago

Sorry to bother you again. As far as I can tell, SimFix does not create a direct patch file, but rather individual changes that are necessary to pass certain purified test cases. So can the whole patch be seen as the application of all these changes?

I'm curious about this, because for example, Chart-22 has two competing changes to the method removeRow(Comparable) (Change 1, Change 2). Is such a patch automatically considered incorrect (Chart-22 was) if it contains competing changes?

xgdsmileboy commented 4 years ago

Exactly, multiple places should be repaired for some bugs in Defects4J. However, after test case purification, bugs in different places may have nothing with each other. In such cases, if all places can be correctly repaired separately, the correct patch should be their combination. Please note, if there is at least one place that is not repaired, we think the repair for the bug is incorrect.

Such as the bug of Chart-22, the combination of Change 1 and Change 2 is not the complete repair according to https://github.com/rjust/defects4j/blob/master/framework/projects/Chart/patches/22.src.patch.

Hope it will help.