ASSERT-KTH / drr

Tool & data on the correctness of Defects4 patches generated by program repair tools http://arxiv.org/pdf/1909.13694
http://arxiv.org/pdf/1909.13694
Creative Commons Attribution Share Alike 4.0 International
10 stars 6 forks source link

devise a consistent and documented strategy for pushing and applying the patch #8

Open monperrus opened 6 years ago

monperrus commented 6 years ago

should we store patches with no context (0 lines), or N lines of context? (which N)?

should we apply patches based on line numbers? context? both? using a fuzz factor?

the goal is be able to directly use the patch on Defects4J

martinezmatias commented 6 years ago

should we store patches with no context (0 lines), or N lines of context? (which N)?

Defects4J patches consider context (5 lines if I am not wrong)

martinezmatias commented 6 years ago

Considering the same criterion than D4J could help to automatically compare synthesized matches with the manual patches proposed by D4J.

tdurieux commented 6 years ago

I think it would be safer to compare the resulting file (the patched file) because depending on the diff implementation you can have differences in the patches.

martinezmatias commented 6 years ago

I think it would be safer to compare the resulting file (the patched file) because depending on the diff implementation you can have differences in the patches.

You are right.

tdurieux commented 6 years ago

We can even to a diff between the human patched version and the generate patched version

monperrus commented 6 years ago

We can even to a diff between the human patched version and the generate patched version

good idea!

SophieHYe commented 6 years ago

Currently I am using the command by using a fuzz factor: patch -l -u --fuzz=5 [original_file] -i [patched_file] -o [updated_file] to apply a patch to defects4J.

As our patches are unified diff, so when I try the option of context, some patches fail to apply.

SophieHYe commented 6 years ago

Hi @martinezmatias,

When applying patches, you can first run the command ./setup.sh defects4j ./setup.sh project ./patched_programs.sh (change the dir path if you only want to apply patches for specific folders)

But these scripts will be updated to Python scripts soon, this is an another task :)

martinezmatias commented 6 years ago

Hi @SophieHYe

you can first run the command

Perfect, thanks!, I will try those scripts today.

martinezmatias commented 6 years ago

Hi @SophieHYe In the script test-patch there are two commented lines, related to the application and revert of patches. https://github.com/kth-tcs/defects4-repair-reloaded/blob/master/test-patch.sh#L35

Are those lines commented for a particular issue/bug?