Skip to content

Commit

Permalink
Remove branch coverage selector (#335)
Browse files Browse the repository at this point in the history
* clean: remove BranchCoverageSelector, replaced by JacocoCoverageSelector and CloverCoverageSelector

* docs: remove options and docs of BranchCoverageSelector

* clean: remove method used only by BranchCoverageSelector

* clean: remove all usages of the BranchCoverageSelector

* fix: computation of the path in the multi-module

* remove old code used by the BranchCoverageSelector

* remove usage of old codes

* depreciate code, should be replaced by eu.stamp.testrunner project

* remove logger package
  • Loading branch information
danglotb committed Feb 26, 2018
1 parent e4a2262 commit 6d86c87
Show file tree
Hide file tree
Showing 40 changed files with 19 additions and 2,664 deletions.
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -166,7 +166,7 @@ java -cp target/dspot-*-jar-with-dependencies.jar fr.inria.stamp.Main -p path/To
### Command Line Usage
```
Usage: java -jar target/dspot-1.0.0-jar-with-dependencies.jar
[(-p|--path-to-properties) <./path/to/myproject.properties>] [(-a|--amplifiers) Amplifier1:Amplifier2:...:AmplifierN ] [(-i|--iteration) <iteration>] [(-s|--test-criterion) <PitMutantScoreSelector | ExecutedMutantSelector | CloverCoverageSelector | BranchCoverageTestSelector | JacocoCoverageSelector | TakeAllSelector | ChangeDetectorSelector>] [(-g|--max-test-amplified) <integer>] [-d|--descartes] [-k|--evosuite] [(-t|--test) my.package.MyClassTest1:my.package.MyClassTest2:...:my.package.MyClassTestN ] [(-c|--cases) testCases1:testCases2:...:testCasesN ] [(-o|--output-path) <output>] [-q|--clean] [(-m|--path-pit-result) <./path/to/mutations.csv>] [(-b|--automatic-builder) <MavenBuilder | GradleBuilder>] [(-j|--maven-home) <path to maven home>] [(-r|--randomSeed) <long integer>] [(-v|--timeOut) <long integer>] [--verbose] [-e|--example] [-h|--help]
[(-p|--path-to-properties) <./path/to/myproject.properties>] [(-a|--amplifiers) Amplifier1:Amplifier2:...:AmplifierN ] [(-i|--iteration) <iteration>] [(-s|--test-criterion) <PitMutantScoreSelector | ExecutedMutantSelector | CloverCoverageSelector | JacocoCoverageSelector | TakeAllSelector | ChangeDetectorSelector>] [(-g|--max-test-amplified) <integer>] [-d|--descartes] [-k|--evosuite] [(-t|--test) my.package.MyClassTest1:my.package.MyClassTest2:...:my.package.MyClassTestN ] [(-c|--cases) testCases1:testCases2:...:testCasesN ] [(-o|--output-path) <output>] [-q|--clean] [(-m|--path-pit-result) <./path/to/mutations.csv>] [(-b|--automatic-builder) <MavenBuilder | GradleBuilder>] [(-j|--maven-home) <path to maven home>] [(-r|--randomSeed) <long integer>] [(-v|--timeOut) <long integer>] [--verbose] [-e|--example] [-h|--help]
[(-p|--path-to-properties) <./path/to/myproject.properties>]
[mandatory] specify the path to the configuration file (format Java
Expand Down Expand Up @@ -337,7 +337,6 @@ Following the list of avalaible test selector:
* `ExecutedMutantSelector`: uses [**PIT**](http://pitest.org/) to computes the number of executed mutants. It uses the number of mutants as a proxy for the instruction coverage. It selects amplfied test that execute new mutants. **WARNING!!** this selector takes a lot of time, and is not worth it, please look at CloverCoverageSelector or JacocoCoverageSelector.
* `TakeAllSelector`: keeps all amplified tests not matter the quality.
* `ChangeDetectorSelector`: runs against a second version of the same program, and selects amplified tests that fail. This selector selects only amplified test that are able to show a difference of a behavior betweeen two versions of the same program.
* `BranchCoverageTestSelector`: uses a custom way to compute the branch coverage. **DEPRECATED**

### Licence

Expand Down
Expand Up @@ -92,7 +92,6 @@ public void amplification(CtType<?> classTest, List<CtMethod<?>> methods, int ma
}

LOGGER.info("amplification of {} ({} test)", classTest.getQualifiedName(), tests.size());
testSelector.reset();
List<CtMethod<?>> ampTest = new ArrayList<>();

updateAmplifiedTestList(ampTest, preAmplification(classTest, tests));
Expand All @@ -101,7 +100,6 @@ public void amplification(CtType<?> classTest, List<CtMethod<?>> methods, int ma
for (int i = 0; i < tests.size(); i++) {
CtMethod test = tests.get(i);
LOGGER.info("amp {} ({}/{})", test.getSimpleName(), i + 1, tests.size());
testSelector.reset();
TestListener result = compileAndRunTests(classTest, Collections.singletonList(tests.get(i)));
if (result != null) {
if (result.getFailingTests().isEmpty()
Expand Down Expand Up @@ -226,7 +224,6 @@ private List<CtMethod<?>> preAmplification(CtType classTest, List<CtMethod<?>> t
});
return preAmplification(classTest, tests);
} else {
testSelector.update();
LOGGER.info("Try to add assertions before amplification");
final List<CtMethod<?>> amplifiedTestToBeKept = assertGenerator.generateAsserts(
classTest, testSelector.selectToAmplify(tests));
Expand Down Expand Up @@ -308,8 +305,6 @@ private TestListener compileAndRunTests(CtType classTest, List<CtMethod<?>> curr
numberOfSubClasses != result.getRunningTests().size())) {
return null;
} else {
LOGGER.info("update test testCriterion");
testSelector.update();
return result;
}
}
Expand Down
3 changes: 1 addition & 2 deletions dspot/src/main/java/fr/inria/diversify/dspot/DSpot.java
Expand Up @@ -5,7 +5,6 @@
import fr.inria.diversify.automaticbuilder.AutomaticBuilder;
import fr.inria.diversify.automaticbuilder.AutomaticBuilderFactory;
import fr.inria.diversify.dspot.amplifier.*;
import fr.inria.diversify.dspot.selector.BranchCoverageTestSelector;
import fr.inria.diversify.dspot.selector.CloverCoverageSelector;
import fr.inria.diversify.dspot.selector.TestSelector;
import fr.inria.diversify.dspot.support.json.ClassTimeJSON;
Expand Down Expand Up @@ -86,7 +85,7 @@ public DSpot(InputConfiguration inputConfiguration, int numberOfIterations, List

public DSpot(InputConfiguration inputConfiguration, int numberOfIterations, List<Amplifier> amplifiers, TestSelector testSelector) throws Exception {

Initializer.initialize(inputConfiguration, testSelector instanceof BranchCoverageTestSelector);
Initializer.initialize(inputConfiguration);
this.inputConfiguration = inputConfiguration;
this.inputProgram = inputConfiguration.getInputProgram();

Expand Down

0 comments on commit 6d86c87

Please sign in to comment.