Baselines

Comment-to-code linking baselines

Blank Line Baseline

This baseline is a straightforward heuristic assuming that a given //inline comment documents all following statements until a blank line is reached.
The code implementing the baseline can be found here.

Token-Based SS

We compute the textual similarity between each comment in the test set and all statements in the method it belongs to. A statement is linked to the comment if its similarity with it is higher or equal than a threshold.
The code implementing the baseline can be found here.

ML-based solution

We reimplemented the approach by Chen et al. relying on the Random Forest machine learning algorithm to classify statements in a method as linked or not to a given comment.
The code implementing the baseline can be found here.

Snippets Summarization

Jaccard Index

The Jaccard baseline identifies the most similar snippet by employing the Jaccard similarity index and summarize the snippet with the documentation of the found snippet.
The code implementing the baseline can be found here.

RL-BlockCom

We run STUNT on the same dataset used in Towards automatically generating block comments for code snippets.
The replication package provided by the authors can be found here.