Skip to content

Commit fcc6ca1

Browse files
docs: add README and Javadocs for core algorithm
1 parent 9372a90 commit fcc6ca1

3 files changed

Lines changed: 103 additions & 3 deletions

File tree

README.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1-
# ECCO-Ext
1+
# trace-boosting: Give an Inch and Take a Mile? Effects of Adding Reliable Knowledge to Heuristic Feature Tracing
22

3-
ECCO extended with mapping propagation.
3+
## Overview
4+
This research artifact is based on the findings of our SPLC 2024 paper on boosting retroactive feature tracing techniques with proactive traces.
5+
Our paper explores how providing a minimal seed of accurate feature traces proactively can significantly enhance the accuracy of automated, heuristic-based retroactive tracing.
6+
The paper demonstrates that increasing amounts of proactive information can boost the overall accuracy of the tracing and that the number of variants compared affects the effectiveness of the combined tracing approach.
7+
8+
TraceBoosting is an algorithm designed to enhance retroactive feature tracing with proactively collected feature traces.
9+
It is particularly useful for projects with multiple product variants, where it can improve the accuracy and efficiency of the tracing process.
10+
This projects presents a prototype of our algorithm that boosts comparison-based retroactive feature tracing.
11+
The used retroactive tracing method is heavily inspired by ECCO.
12+
13+
## Setup Using Maven
14+
To include the TraceBoosting library in your Maven project, add the following dependency to your `pom.xml` file:
15+
16+
```xml
17+
<dependency>
18+
<groupId>org.variantsync</groupId>
19+
<artifactId>traceboosting</artifactId>
20+
<version>1.0.0</version>
21+
</dependency>
22+
```
23+
24+
## Usage
25+
To use the TraceBoosting algorithm, follow these steps:
26+
27+
1. Initialize a list to hold `ProductPassport` objects that describe the artifact locations for each variant.
28+
2. Iterate over the collection of variants for which traces are to be computed, creating a `ProductPassport` for each and adding it to the list.
29+
3. Instantiate the TraceBoosting algorithm with the product passports, working directory, and the supported language for tracing.
30+
4. Retrieve the list of products from the TraceBoosting instance.
31+
5. Apply the proactively collected traces to the products.
32+
6. Compute the Main tree, which represents the merged variant AST with feature traces.
33+
34+
Here is a code snippet demonstrating how to use the TraceBoosting algorithm:
35+
36+
```java
37+
List<ProductPassport> productPassports = new ArrayList<>();
38+
for (Variant variant : variants) {
39+
String variantName = variant.getName();
40+
productPassports.add(new ProductPassport(variantName,
41+
variantsDirectory.resolve(variantName), configFileMap.get(variantName)));
42+
}
43+
44+
TraceBoosting traceBoosting = new TraceBoosting(productPassports,
45+
workingDirectory, ESupportedLanguages.LINES);
46+
47+
List<Product> products = traceBoosting.getProducts();
48+
49+
// Now apply proactively created traces to the products. You can directly access the AST nodes of the products.
50+
// TODO: Implement distribution of proactively collected mappings
51+
52+
// Finally, execute the boosting algorithm
53+
MainTree mainTree = traceBoosting.compute();
54+
```

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<groupId>org.variantsync</groupId>
99
<!-- Adjust the project name -->
1010
<artifactId>trace-boosting</artifactId>
11-
<version>1.0</version>
11+
<version>1.0.0</version>
1212

1313
<properties>
1414
<!-- Adjust your java version here -->

src/main/java/de/hub/mse/variantsync/boosting/TraceBoosting.java

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,60 @@
5353
import de.hub.mse.variantsync.boosting.product.ProductPassport;
5454
import de.hub.mse.variantsync.boosting.product.ProductSaveTask;
5555

56+
/**
57+
* The {@code TraceBoosting} class encapsulates the algorithm for enhancing
58+
* retroactive feature tracing with proactively collected feature traces.
59+
* It is designed to work with a set of product variants and their associated
60+
* feature traces to produce a more accurate and efficient tracing process.
61+
* The algorithm is inspired by the ECCO tracing algorithm and is tailored to
62+
* improve upon it by utilizing additional trace information.
63+
*
64+
* <p>
65+
* Usage example:
66+
* </p>
67+
*
68+
* <pre>{@code
69+
* // Initialize a list to hold ProductPassport objects that describe the
70+
* // artifact locations for each variant
71+
* List<ProductPassport> productPassports = new ArrayList<>();
72+
* // Iterate over the collection of variants
73+
* for (Variant variant : variants) {
74+
* String variantName = variant.getName();
75+
* // Create a new ProductPassport for the variant and add it to the list
76+
* productPassports.add(new ProductPassport(variantName,
77+
* variantsDirectory.resolve(variantName), configFileMap.get(variantName)));
78+
* }
79+
* // Instantiate the TraceBoosting algorithm with the product passports,
80+
* // working directory, and the supported language for tracing.
81+
* // LINES creates a simple line-based AST that is language-agnostic.
82+
* TraceBoosting traceBoosting = new TraceBoosting(productPassports,
83+
* workingDirectory, ESupportedLanguages.LINES);
84+
* // Retrieve the list of products from the TraceBoosting instance
85+
* List<Product> products = traceBoosting.getProducts();
86+
* // Apply the proactively collected traces to the products
87+
* distributeMappings(products, variantGenerationResult.variantGroundTruthMap(),
88+
* percentage, config.getStrip());
89+
* // Compute the Main tree which represents the merged variant AST with feature
90+
* // traces
91+
* MainTree mainTree = traceBoosting.compute();
92+
* }</pre>
93+
*
94+
* <p>
95+
* Note: The actual implementation of methods like {@code distributeMappings}
96+
* and {@code computeEcco} are not shown in this example and should be defined
97+
* elsewhere in the codebase.
98+
* </p>
99+
*/
56100
public class TraceBoosting {
57101

58102
private static final DNFFactorization dnf_simplifier_1 = new DNFFactorization();
59103
private static final DNFSubsumption dnf_simplifier_2 = new DNFSubsumption();
60104
public static FormulaFactory f = new FormulaFactory();
105+
106+
/**
107+
* Static block to initialize the FormulaFactory object with a CNFConfig object
108+
* that specifies the simplification algorithm.
109+
*/
61110
static {
62111
final var builder = CNFConfig.builder();
63112
builder.algorithm(CNFConfig.Algorithm.FACTORIZATION);

0 commit comments

Comments
 (0)