CoChat

Semantic similarity metrics for evaluating source code summarization

Open access
Haque, Sakib, Eberhart, Zachary, Bansal, Aakash, McMillan, Collin · 2022 · Proceedings of the 30th IEEE/ACM International Conference on Program Comprehension

The DOI matches its Crossref record; 59 of the 59 references it cites were found in a registry or an index.

Abstract

Source code summarization involves creating brief descriptions of source code in natural language. These descriptions are a key component of software documentation such as JavaDocs. Automatic code summarization is a prized target of software engineering research, due to the high value summaries have to programmers and the simultaneously high cost of writing and maintaining documentation by hand. Current work is almost all based on machine models trained via big data input. Large datasets of examples of code and summaries of that code are used to train an e.g. encoder-decoder neural model. Then the output predictions of the model are evaluated against a set of reference summaries. The input is code not seen by the model, and the prediction is compared to a reference. The means by which a prediction is compared to a reference is essentially word overlap, calculated via a metric such as BLEU or ROUGE. The problem with using word overlap is that not all words in a sentence have the same importance, and many words have synonyms. The result is that calculated similarity may not match the perceived similarity by human readers. In this paper, we conduct an experiment to measure the degree to which various word overlap metrics correlate to human-rated similarity of predicted and reference summaries. We evaluate alternatives based on current work in semantic similarity metrics and propose recommendations for evaluation of source code summarization.

Overview

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.1145/3524610.3527909

Cites

59 of 59 references verified0 citation errors · 0 not checkable

Statistics

Verification

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Citations

Cites

Research works printed but not linked: 11

  1. [3] D. Kramer, 'Api documentation from source code comments: a case study of javadoc,' in Proceedings of the 17th annual international conference on Computer documentation . ACM, 1999, pp. 147-153. -
  2. [4] A. Forward and T. C. Lethbridge, 'The relevance of software documentation, tools and technologies: a survey,' in Proceedings of the 2002 ACM symposium on Document engineering . ACM, 2002, pp. 26-33. -
  3. [13] D. Gros, H. Sezhiyan, P. Devanbu, and Z. Yu, 'Code to comment 'translation': Data, metrics, baselining evaluation,' in 2020 35th IEEE/ACM International Conference on Automated Software Engineering (ASE) , 2020, pp. 746-757. -
  4. [21] P. Rodeghero, C. McMillan, P. W. McBurney, N. Bosch, and S. D'Mello, 'Improving automated source code summarization via an eye-tracking study of programmers,' in Proceedings of the 36th international conference on Software engineering . ACM, 2014, pp. 390-401. -
  5. [22] S. Iyer, I. Konstas, A. Cheung, and L. Zettlemoyer, 'Summarizing source code using a neural attention model,' in Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , 2016, pp. 2073-2083. -
  6. [25] U. Alon, S. Brody, O. Levy, and E. Yahav, 'code2seq: Generating sequences from structured representations of code,' International Conference on Learning Representations , 2019. -
  7. [26] U. Alon, M. Zilberstein, O. Levy, and E. Yahav, 'code2vec: Learning distributed representations of code,' Proceedings of the ACM on Programming Languages , vol. 3, no. POPL, pp. 1-29, 2019. -
  8. [34] E. Clark, A. Celikyilmaz, and N. A. Smith, 'Sentence mover's similarity: Automatic evaluation for multi-sentence texts,' in Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics , 2019, pp. 2748-2760. -
  9. [44] H. C. Kraemer, 'Kappa coefficient,' Wiley StatsRef: Statistics Reference Online , pp. 1-4, 2014. -
  10. [54] Y. Li, D. McLean, Z. A. Bandar, J. D. O'shea, and K. Crockett, 'Sentence similarity based on semantic nets and corpus statistics,' IEEE transactions on knowledge and data engineering , vol. 18, no. 8, pp. 1138-1150, 2006. -
  11. [70] C. P. Dancey and J. Reidy, Statistics without maths for psychology . Pearson education, 2007.

Cited by

See all 143

Metadata

Authors
Haque, S., Eberhart, Z., Bansal, A., & McMillan, C.
Affiliations
University of Notre Dame (US)
Venue
Proceedings of the 30th IEEE/ACM International Conference on Program Comprehension
Publisher
ACM
Published
2022-05-16
Pages
36-47
OpenAlex
W4313185449
Cited by
116
References
59
Citations by year
2026: 13 · 2025: 42 · 2024: 40 · 2023: 20 · 2022: 1
FWCI
23.02
Type
conference paper
Language
en
Open access
Locations
  • IEEE International Conference on Program Comprehension (ICPC) (publishedVersion)
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Funders
NSF (CCF-2100035)
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
Keywords
source code summarization, semantic similarity metrics, BLEU, ROUGE, synonymy (linguistics), software documentation

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.