You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Artifact repository for the paper _Feature Trace Recording_, accepted at _ESEC/FSE 2021_.
12
16
Authors are [Paul Maximilian Bittner][paul], [Alexander Schultheiß][alexander], [Thomas Thüm][thomas], [Timo Kehrer][timo], [Jeffrey M. Young][jeffrey], and [Lukas Linsbauer][lukas].
@@ -15,21 +19,54 @@ The artefact mainly consists of a library written in the Haskell language that i
15
19
The library is accompanied with a demo application that uses the library to reproduce our motivating example (Alice and Bob using feature trace recording in Section 2 in our paper) as well as examples of the edit patterns we used to evaluate feature trace recording (Section 5).
16
20
17
21
22
+
## What is Feature Trace Recording?
23
+
24
+
Feature trace recording is a semi-automated method for recording feature-to-code mappings during software development.
25
+
It unlocks evolution as a new source of information for feature location.
Consider a developer Alice editing the `pop` method of a `Stack` class in Java as depicted in the image above.
31
+
Feature-to-code mappings are indicated by corresponding colours.
32
+
By labeling her edits with the feature she edits, we derive feature mappings for edited source code.
33
+
We refer to such a label as [_feature context_](https://pmbittner.github.io/FeatureTraceRecording/docs/FeatureTraceRecording.html#t:FeatureContext).
34
+
It can be left empty when developers do not know the feature they edit.
35
+
In our example, Alice does not know the feature of the moved line in her second edit and omits the feature context (i.e., sets it to null).
36
+
37
+
From feature contexts we can compute feature mappings for the current code base but also for other variants.
38
+
Assume there is a second developer, Bob, working on another variant (e.g., branch or fork) of the software.
39
+
Bob’s variant might implement other features than Alice’s.
40
+
Assume Bob’s variant implements the blue feature <spanstyle="color:#00BEEB">SafeStack</span> but not the orange feature <spanstyle="color:#D95F02">ImmutableStack</span>.
41
+
Although Alice made many edits to <spanstyle="color:#D95F02">ImmutableStack</span>, we can still derive feature mappings for Bob’s code.
42
+
When Alice deletes code from <spanstyle="color:#D95F02">ImmutableStack</span>, we can infer that this code does not belong to <spanstyle="color:#D95F02">ImmutableStack</span> anymore.
43
+
We thus introduce the new feature mapping <spanstyle="color:#7570B3">¬ImmutableStack</span> for the deleted code that is still present in Bob’s variant (highlighted in purple):
44
+
45
+
<imgsrc="meta/BobsVariant.png"alt="Bob's Recorded Feature Traces"image-rendering="pixelated"width="250" />
46
+
47
+
A detailed explanation of this example can be found in our [paper][paper] and [preprint][preprint].
48
+
49
+
Feature trace recording is the first step towards our vision for bridging the gap between clone-and-own and software product lines in our project [VariantSync][variantsync].
50
+
You may read about it in our [ICSE NIER paper](https://tinyurl.com/variantsync) or watch our talk on [YouTube](https://www.youtube.com/watch?v=oJf8W4cE25A):blush:.
51
+
52
+
18
53
## How to Run the Demo
19
54
Our library is written in Haskell and uses the _Stack_ build system (see [REQUIREMENTS.md](REQUIREMENTS.md)).
20
55
Instructions for installing Stack, building our library and running the demo are given in the [INSTALL.md](INSTALL.md).
21
56
22
57
23
-
## Documentation
58
+
## [Documentation][documentation]
24
59
25
60
A detailed documentation can be found in `docs/index.html` and can be browsed on the [Github page][documentation].
26
61
27
62
Some interesting code locations are:
28
-
-`showExamples` function in [`app/Main.hs`](app/Main.hs): Here you can choose which examples to run and in which format the source code should be displayed. Choose from:
29
-
-`userFormat` (default): The perspective of the developer who is editing source code while traces are recorded in the background. This is the format used in the figures in the paper. The tool will show the presence conditions of the snapshots.
30
-
-`userFormatDetailed`: A variation of `userFormat` where traces and presence conditions can be investigated seperately at the same time. Code is coloured in the colour of its feature trace while presence conditions are indicated by coloured lines on the left.
31
-
-`astFormat`: Shows the abstract syntax tree of the source code with feature traces as formulas.
32
-
-`tikzFormat`: Tikz export of abstract syntax trees with traces. Used for figures in the paper.
63
+
-[`main`](https://pmbittner.github.io/FeatureTraceRecording/docs/Main.html#v:main) function in [`app/Main.hs`](app/Main.hs): Here you can choose in which format source code should be displayed in the terminal. Choose from:
64
+
-[`userFormat`](https://pmbittner.github.io/FeatureTraceRecording/docs/Main.html#v:userFormat) (default): The perspective of the developer who is editing source code while traces are recorded in the background. This is the format used in the figures in the paper. The tool will show the presence conditions of the snapshots.
65
+
-[`userFormatDetailed`](https://pmbittner.github.io/FeatureTraceRecording/docs/Main.html#v:userFormatDetailed): A variation of `userFormat` where traces and presence conditions can be investigated seperately at the same time. Code is coloured in the colour of its feature trace while presence conditions are indicated by coloured lines on the left.
66
+
-[`astFormat`](https://pmbittner.github.io/FeatureTraceRecording/docs/Main.html#v:astFormat): Shows the abstract syntax tree of the source code with feature traces as formulas.
67
+
-[`tikzFormat`](https://pmbittner.github.io/FeatureTraceRecording/docs/Main.html#v:tikzFormat): Tikz export of abstract syntax trees with traces. Used for figures in the paper.
68
+
69
+
-[`showExamples`](https://pmbittner.github.io/FeatureTraceRecording/docs/Main.html#v:showExamples) function in [`app/Main.hs`](app/Main.hs): Here you can choose which examples to run.
33
70
34
71
-[`src/feature/recording/FeatureTraceRecording.hs`](src/feature/recording/FeatureTraceRecording.hs): This file includes type definitions and interfaces for feature trace recording to make it configurable (e.g., plug in custom recording functions).
35
72
@@ -44,7 +81,38 @@ Some interesting code locations are:
44
81
-[`src/propositions/NullPropositions.hs`](src/propositions/NullPropositions.hs): Operators for the ternary logic with `null`.
45
82
We provide truthtables for the logic in [meta/Truthtable.md](meta/Truthtable.md).
46
83
The implementation is based on our implementation for propositional logic in [`src/propositions/Propositions.hs`](src/propositions/Propositions.hs).
47
-
You can inspect the truth tables for the ternary logic by uncommenting the respective line (`showTruthtables`) in the `main` function in [`app/Main.hs`](app/Main.hs) and running the project again.
84
+
You can inspect the truth tables for the ternary logic by uncommenting the respective line (`showTruthtables`) in the `main` function in [`app/Main.hs`](app/Main.hs) and running the demo again.
85
+
86
+
87
+
## Please cite as
88
+
```tex
89
+
@inproceedings{BST+:ESECFSE21,
90
+
author = {Paul Maximilian Bittner and Alexander Schulthei\ss{} and Thomas Th{\"{u}}m and Timo Kehrer and Jeffrey M. Young and Lukas Linsbauer},
So far, this library contains no implementation for parsing and diffing source code.
107
+
Instead, users of this library have to provide [Abstract Syntax Trees (ASTs)](https://pmbittner.github.io/FeatureTraceRecording/docs/AST.html) and [edits to them](https://pmbittner.github.io/FeatureTraceRecording/docs/Edits.html) as input for feature trace recording (see `runFTR` and `runFTRWithIntermediateSteps` in [FeatureTraceRecording.hs](https://pmbittner.github.io/FeatureTraceRecording/FeatureTraceRecording.html)).
108
+
Examples for creating edits and ASTs can be found in the demos for Alice ([docs](https://pmbittner.github.io/FeatureTraceRecording/docs/StackPopAlice.html), [src](app/examples/StackPopAlice.hs)), Bob ([docs](https://pmbittner.github.io/FeatureTraceRecording/docs/StackPopBob.html), [src](app/examples/StackPopBob.hs)), and edit patterns ([docs](https://pmbittner.github.io/FeatureTraceRecording/docs/EditPatterns.html), [src](app/examples/EditPatterns.hs)).
109
+
110
+
Currently, the library also does not provide (de-)serialisation of feature traces.
111
+
112
+
113
+
## Contact
114
+
115
+
Don't hesitate to open issues or pull-request, or to contact us directly ([email protected]). We are thankful for any questions, constructive criticism, or interest. :blush:
0 commit comments