-
Notifications
You must be signed in to change notification settings - Fork 15
Home
Welcome to the flacoco wiki!
flacoco is a fault localization tool for Java based on Jacoco and test-runner that aims at encompassing several fault localization techniques.
flacoco is currently only available as a SNAPSHOT.
You can use it by installing locally yourself, or by adding flacoco as a maven dependency:
$ mvn install
<dependency>
<groupId>com.github.spoonlabs</groupId>
<artifactId>flacoco</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
flacoco can currently be used through the API or the command line interface.
The following example illustrates a common usage of the flacoco API, where we run flacoco on a test project using spectrum-based fault localization with the Ochiai formula. As a result, we obtain a mapping between suspicious lines and suspiciousness scores.
Example usage:
Flacoco flacoco = new Flacoco();
FlacocoConfig config = FlacocoConfig.getInstance();
config.setProjectPath("./examples/exampleFL1/FLtest1");
config.setClasspath(classpath);
config.setFamily(FlacocoConfig.FaultLocalizationFamily.SPECTRUM_BASED);
config.setSpectrumFormula(SpectrumFormula.OCHIAI);
Map<String, Double> susp = flacoco.runDefault();
Full reference can be found under API.
Currently, there are two ways of using the flacoco cli. The following examples illustrate the aforementioned example:
java -cp 'target/flacoco-0.0.1-SNAPSHOT-jar-with-dependencies.jar' fr.spoonlabs.flacoco.FlacocoMain --projectpath examples/exampleFL1/FLtest1/
java -jar target/flacoco-0.0.1-SNAPSHOT-jar-with-dependencies.jar --projectpath examples/exampleFL1/FLtest1/
Full reference can be found under CLI.