SpoonLabs / npefix

Open-science code of the program repair tool described in "Dynamic Patch Generation for Null Pointer Exceptions Using Metaprogramming" (SANER'17)
https://hal.archives-ouvertes.fr/hal-01419861/document
14 stars 9 forks source link

How does NPEFix validate the candidate patches? #22

Closed DehengYang closed 4 years ago

DehengYang commented 4 years ago

Sorry for disturbing you with this issue. I am interested in the NPEFix that is a good APR technique and also integrated into RepairThemAll. I now would like to ask for your help and guidance on the way of NPEFix to validate a candidate patch.

For example, does it firstly re-compile the candidate patch, and then run failing tests, and finally run all positive tests or all test cases?

It would be sincerely appreciated if any help could be provided.

Thank you in advance for your time and help!

monperrus commented 4 years ago

For example, does it firstly re-compile the candidate patch, and then run failing tests, and finally run all positive tests or all test cases?

It does run the failing tests, but not the passing ones.

Note that it does not "recompile" the program per se, because everything is done with metaprogramming.

DehengYang commented 4 years ago

Thank you so much for so prompt reply and kind help! May I ask a further question: so would it possibly break the functionality if it does not run passing ones?

Thanks agains for your help!

monperrus commented 4 years ago

so would it possibly break the functionality if it does not run passing ones?

In theory yes, if a passing test throws and catches an NPE, and breaks if the NPE is not thrown anymore. In practice, this is very very rare.

DehengYang commented 4 years ago

Thank you for the detailed explanation. My doubt is perfectly solved with your kind help.

Thanks!