Files
logseq/pages/CrystalBLEU%3A Precisely and Efficiently Measuring the Similarity of Code.md
T
2025-06-05 22:07:12 +02:00

17 KiB
Raw Blame History

title:: CrystalBLEU: Precisely and Efficiently Measuring the Similarity of Code

type:: REVIEWS tags:: year:: 2022 venue:: ASE-AE full-title:: CrystalBLEU: Precisely and Efficiently Measuring the Similarity of Code date-start:: date-submitted:: external-links:: ASE'22 Artifacts status:: DONE deadline-submission:: file:: ase2022-paper108.pdf

- [[Highlights]]
- [[Comments]]
- [[REVIEWS/Notes]]
  • Abstract

    • Recent years have brought a surge of work on predicting pieces of source code, e.g., for code completion, code migration, program repair, or translating natural language into code. All this work faces the challenge of evaluating the quality of a prediction w.r.t. some oracle, typically in the form of a reference solution. A common evaluation metric is the BLEU score, an n-gram-based metric originally proposed for evaluating natural language translation, but adopted in software engineering because it can be easily computed on any programming language and enables automated evaluation at scale. However, a key difference between natural and programming languages is that in the latter, completely unrelated pieces of code may have many common n-grams simply because of the syntactic verbosity and coding conventions of programming languages. We observe that these trivially shared n-grams hamper the ability of the metric to distinguish between truly similar code examples and code examples that are merely written in the same language. This paper presents CrystalBLEU, an evaluation metric based on BLEU, that allows for precisely and efficiently measuring the similarity of code. Our metric preserves the desirable properties of BLEU, such as being language-agnostic, able to handle incomplete or partially incorrect code, and efficient, while reducing the noise caused by trivially shared n-grams. We evaluate CrystalBLEU on two datasets from prior work and on a new, labeled dataset of semantically equivalent programs. Our results show that CrystalBLEU can distinguish similar from dissimilar code examples 1.94.5 times more effectively, when compared to the original BLEU score and a previously proposed variant of BLEU for code.
    • ((63063e31-2f9f-4a2b-9308-d98c5c9b71d3))
      • ((63064327-6edb-4a1d-9e22-12f553aa941f))
    • ((63063e49-ec06-4fb1-8a5f-567100bf353e))
  • CFPs

    • Badges for Papers Published at ASE 2022

      • Authors of papers accepted in any of the tracks of ASE 2022 may submit artifacts associated with those papers to the ASE Artifact Track. Submitted artifacts will receive one of the following badges:
      • Available

        • Open Research Objects (ORO)
        • Placed on a publicly accessible archival repository. A DOI or link to this persistent repository along with a unique identifier for the object is provided. Artifacts have not been formally evaluated.
      • Reusable

        • Research Objects Reviewed (ROR)
        • Available + Artifacts are very carefully documented and well-structured, consistent, complete, exercisable, and include appropriate evidence of verification and validation to the extent that reuse and repurposing is facilitated. In particular, norms and standards of the research community for artifacts of this type are strictly adhered to.
        • Papers with such badges contain reusable products that other researchers can use to bootstrap their own research. Experience shows that such papers earn increased citations and greater prestige in the research community. Artifacts of interest include (but are not limited to) the following.
          • Software, which are implementations of systems or algorithms potentially useful in other studies.
          • Data repositories, which are data (e.g., logging data, system traces, survey raw data) that can be used for multiple software engineering approaches.
          • Frameworks, which are tools and services illustrating new approaches to software engineering that could be used by other researchers in different contexts.
        • This list is not exhaustive, so the authors are asked to email the chairs before submitting if their proposed artifact is not on this list.
    • Badges for Reproduced and Replicated Papers

      • Authors of any prior SE work (published at any previous ASE or other SE venue) may submit an artifact for evaluation as a candidate replicated or reproduced.
      • Reproduced

      • Results Reproduced (ROR-R)
      • The main results of the paper have been obtained in a subsequent study by a person or team other than the authors, using, in part, artifacts provided by the original authors. Also, artifacts are very carefully documented and well-structured, consistent, complete, exercisable, and include appropriate evidence of verification and validation
      • Replicated

      • Results Replicated (RER)
      • The main results of the paper have been independently obtained in a subsequent study by a person or team other than the authors, without the use of author-supplied artifacts.
    • Details of the Badges

      • Available
      • This badge is applied to papers in which associated artifacts have been made permanently available for retrieval.
        • We consider temporary drives (e.g., Dropbox, Google Drive) to be non-persistent, same as individual/institutional websites of the submitting authors, as these are prone to changes.
        • We ask that authors use Zenodo as this service is persistent and also offers the possibility to assign a DOI.
        • Artifacts do not need to have been formally evaluated in order for an article to receive this badge. In addition, they need not be complete in the sense described above. They simply need to be relevant to the study and add value beyond the text in the article. Such artifacts could be something as simple as the data from which the figures are drawn, or as complex as a complete software system under study.
      • Reusable
      • The artifacts must meet the following requirements.
        • Documented: At minimum, an inventory of artifacts is included, and sufficient description provided to enable the artifacts to be exercised.
        • Consistent: The artifacts are relevant to the associated paper, and contribute in some inherent way to the generation of its main results.
        • Complete: To the extent possible, all components relevant to the paper in question are included. (Proprietary artifacts need not be included. If they are required to exercise the package then this should be documented, along with instructions on how to obtain them. Proxies for proprietary data should be included so as to demonstrate the analysis.)
        • Exercisable: Included scripts and / or software used to generate the results in the associated paper can be successfully executed, and
      • Authors are strongly encouraged to target their artifact submissions for Reusable as the purpose of artifact badges is, among other things, to facilitate reuse and repurposing, which may not be achieved at the Functional level.
      • Reproduced
      • This badge is applied to papers in which the main results of the paper have been successfully obtained by a person or team other than the original authors of the work, with, at least in part, artifacts provided by the original authors.
      • Example: If Asha published a paper with artifacts in 2020, and Tim published a reproduction in 2021 using the artifacts, then Asha can now apply for the Reproduced badge on the 2020 paper.
      • Replicated
      • This badge is applied to papers in which the main results of the paper have been successfully obtained by a person or team other than the author, but without any artifacts provided by the original authors.
      • Example: If Janet published a paper in 2020 with no artifacts, and Miles published a paper with artifacts in 2021 that independently obtained the main result, then Janet can apply for the Replicated badge on the 2020 paper.
      • Papers with such badges contain reusable products that other researchers can use to bootstrap their own research. Experience shows that such papers earn increased citations and greater prestige in the research community. Artifacts of interest include (but are not limited to) the following.
        • Software, which are implementations of systems or algorithms potentially useful in other studies.
        • Data repositories, which are data (e.g., logging data, system traces, survey raw data) that can be used for multiple software engineering approaches.
        • Frameworks, which are tools and services illustrating new approaches to software engineering that could be used by other researchers in different contexts.
      • This list is not exhaustive, so the authors are asked to email the chairs before submitting if their proposed artifact is not on this list.
    • Submission

      • Authors are to submit to our HotCRP website.
      • Note that that there are two separate separate submission procedures: 1) for available and reusable artifacts, and 2) for replicated and reproduced badges.
    • Submission for Available and Reusable artifacts

      • All submitters must make their repositories available using the following steps.
      • Your Github repo should have documentation files explaining how to obtain the artifact package, how to unpack the artifact, how to get started, and how to use the artifacts in sufficient detail. The artifact submission must describe only the technicalities of the artifacts and uses of the artifact that are not already described in the paper. The submission should contain the following documents (in markdown plain text format).
        • A README.md main file describing what the artifact does and where it can be obtained (with hidden links and access password if necessary).
        • A LICENSE.md file describing the distribution rights. Note that to score “available” or higher, then that license needs to be some form of open source license.
        • An INSTALL.md file with installation instructions. These instructions should include notes illustrating a very basic usage example or a method to test the installation. This could be, for instance, information on what output to expect that confirms that the code is installed and working; and that the code is doing something interesting and useful. IMPORTANT, there should be a clear description of how to reproduce the results presented in the paper.
        • A copy of the accepted paper in pdf format.
      • Authors may update their research artifacts after submission only for changes requested by reviewers in the rebuttal phase. To update artifacts: (1) Go to Github; (2) Make your changes; (3) Make a new release; (4) Make a comment in HotCrp that “in response to comment XYZ we have made a new release that addresses that issues as follows: ABC”
    • Submission for Replicated and Reproduced badges

      • Submit a one page (max) pdf documenting the maturity of the artifact. This needs to include:
        • TITLE: A (Partial)? (Replication|Reproduction) of XYZ. Please add the term partial to your title if only some of the original work could be replicated/reproduced.
        • WHO: name the original authors (and paper) and the authors that performed the replication/reproduction. Include contact information (emails). Mark one author as the corresponding author.
        • IMPORTANT: include also a web link to a publicly available URL directory containing (a) the original paper (that is being reproduced) and (b) any subsequent paper(s)/documents/reports that do the reproduction.
        • WHAT: describe the “thing” being replicated/reproduced;
        • WHY: clearly state why that “thing” is interesting/important;
        • PLATFORM: being the operating system where this artifact was mostly developed on;
        • HOW: say how it was done first;
        • WHERE: describe the replication/reproduction. If the replication/reproduction was only partial, then explain what parts could be achieved or had to be missed.
        • DISCUSSION: What aspects of this “thing” made it easier/harder to replicate/reproduce. What are the lessons learned from this work that would enable more replication/reproduction in the future for other kinds of tasks or other kinds of research.
    • Review

      • The ASE artifact evaluation track uses a single-blind review process. All artifacts will receive two reviews.
      • Two PC members will review each abstract, possibly reaching out to the authors of the abstract or original paper. Abstracts will be ranked as follows.
        • If PC members do not find sufficient substantive evidence for replication/reproduction, the abstract will be rejected.
        • Any abstract that is judged to be unnecessarily critical of prior work will be rejected (*).
        • The remaining abstracts will be sorted according to (a) interestingness and (b) correctness.
        • The top ranked abstracts will be invited to give lightning talks.
      • (*) Our goal is to foster a positive environment that supports and rewards researchers for conducting replications and reproductions. To that end, we require that all abstracts and presentations pay due respect to the work they are reproducing/replicating. Criticism of prior work is acceptable only as part of a balanced and substantive discussion of prior accomplishments.
      • Note that prior to reviewing, there may be some interactions to handle setup and install. Before the actual evaluation reviewers will check the integrity of the artifact and look for any possible setup problems that may prevent it from being properly evaluated (e.g., corrupted or missing files, VM wont start, immediate crashes on the simplest example, etc.). The Evaluation Committee may contact the authors to request clarifications on the basic installation and start-up procedures or to resolve simple installation problems. Artifact evaluation can be rejected for artifacts whose configuration and installation takes an undue amount of time.
  • REVIEW

    • Paper summary

      • The paper presents the software artifacts that are related to the ASE2022 submission titled "CrystalBLEU: Precisely and Efficiently Measuring the Similarity of Code", which gives an extension of the BLEU score to measure the similarity of source code. The shared GitHub repository contains all the scripts needed to replicate the tables and figures shown in the ASE submission.
    • Comments for author

      • To make the scripts WORK, I had to convert them through the doc2unix command (I'm using a Win11 machine with the Linux subsystem):
        • dos2unix ./scripts/*
        • To avoid issues like this, I recommend adding a section in the README.md file presenting the requirements (further than those listed in the file requirement.txt) that must be satisfied to make the proposed scripts work. For instance, I would have presented the system configuration used to develop and run the presented approach, including, e.g., the version of the used Python and Java runtime environments.
      • Further than listing the sequence of commands to execute, I would have clarified the roles of all the considered datasets. Since it took a while to prepare all of them, users would appreciate why such a so long operation is needed and, in particular, for which of the following commands each of them is required. By following such a comment, I would clarify/refine the current statement:
        • Note: this might cause some scripts to crash if they cannot find the required data files
        • With a more detailed description of what would crash in the case and why.
      • Even though the repository contains the scripts to reproduce the tables and figures of the ASE paper correctly, it does not describe in detail how to use the CrystalBLEU approach without the prepared bash scripts. Thus, the usage of the CrystalBLEU approach outside the boundaries of the prepared use cases is limited.
    • Comments for PC

      • None.