Fix the bug exposed by Time_7 fault localization #3
Conversation
Obtain the buggy program directory that will then be passed to GZoltar fault localizer.
Changing the GZoltar work dir from current FL project dir to buggy program dir.
Pass dp.bugDir parameter to localizeSuspiciousCodeWithGZoltar( ) method.
| // (e.g., this leads to the failure of org.joda.time.TestSerialization#testSerializedMutableDateTime when localizing Time_7. | ||
| // The failing detail includes: java.io.FileNotFoundException: src/test/resources/MutableDateTime.dat (No such file or directory) | ||
| // Therefore, the GZoltar working dir should be the bugDir, rather than the current FL project dir. | ||
| GZoltar gzoltar = new GZoltar(bugDir); |
There was a problem hiding this comment.
Did you try this parameter setting for each Defects4J bug?
I remembered that I tried this parameter, it can throw some unexpected exceptions for some Defects4J bugs.
There was a problem hiding this comment.
No, I have only studied the failure exposed by Time_7. In Time_7, it does not throw any exceptions, instead, the failure (i.e., the unexpected failed tests) needs to be examined manually (using Debugging or print statements).
And we can ensure that if GZoltar is not initialized with the buggy program directory, there will be also some Defectes4J bugs that may obtain many extra failed tests which use relative paths to test projects, just like org.joda.time.TestSerialization#testSerializedMutableDateTime in Time_7.
As you mentioned, if GZoltar is initialized with the buggy program directory, there will be some unexpected exceptions.
So... I think GZoltar 0.1.1 may have several bugs in itself, which has already negatively affected the accuracy of current fault localization. It is really necessary and highly demanded to implement GZoltar with java. (This can be an idea as well as a meaningful contribution for the APR and FL community).
Finally, maybe this pull request still needs/deserves more explorations/efforts.
Thank you again for your reply.
the original code in GZoltarFaultLoclaization.java :
new GZoltar(System.getProperty("user.dir"))will lead to unexpected failed test cases when localizing Time buggy projects, (e.g., this leads to the failure of
org.joda.time.TestSerialization#testSerializedMutableDateTimewhen localizing Time_7.The failing trace is :
Based on this, we can know that these unexpected failed tests are caused by incorrect working directory when initializing GZoltar fault localizer.
Therefore, the GZoltar working dir should be the bugDir, rather than the current FL project dir.