GZoltar / gzoltar

GZoltar - Java Library for Automatic Debugging http://www.gzoltar.com
Other
77 stars 34 forks source link

how to collect coverage at method level ? #9

Closed WuYiwen97 closed 5 years ago

WuYiwen97 commented 5 years ago

Excuse me, I am a senior student from China. I want to learn something about SBFL. After reading Fault-localization-data repository in bitbucket,I have already konw how to collect coverage at line level. But I donnot know how to collect coverage at method level.(Because my ability is limited😭) could you tell me how to....I will be very thankful~

jose commented 5 years ago

Hi @WuYiwen97,

GZoltar supports out-of-the-box three granularity levels: class, method, and line (default). To use a different granularity level you must configure the fault-localization report with a different granularity level.

For example:

In case you are using external scripts such the ones in the fault-localization repository you need to modify line #438 to method, or class. Please not that if you change #438 to method, or class you would also have to comment out or remove the sanity checks performed in lines 283 -- 533 in the job.sh script. (the job.sh script runs GZoltar on a single D4J bug).

-- Best, Jose

WuYiwen97 commented 5 years ago

Wonderful ~Thank you very much ,that is what exactly I want. 😘

delsner commented 5 years ago

Just a note on this: on MacOS (maven version: 3.6.1, gzoltar: 1.7.2) I had to manually provide the flag -Dgzoltar.granularity=method, e.g. mvn gzoltar:fl-report -Dgzoltar.granularity=method. Providing the method value via the plugin configuration did not work.