Open monperrus opened 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)
Considering the same criterion than D4J could help to automatically compare synthesized matches with the manual patches proposed by D4J.
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.
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.
We can even to a diff between the human patched version and the generate patched version
We can even to a diff between the human patched version and the generate patched version
good idea!
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.
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 :)
Hi @SophieHYe
you can first run the command
Perfect, thanks!, I will try those scripts today.
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?
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